mc-imperial / dredd

A mutation testing tool designed to work with large C++ (and C) codebases.
Apache License 2.0
13 stars 3 forks source link

Segfault in member initializer list of class template #176

Closed james-perretta closed 1 year ago

james-perretta commented 1 year ago

Greetings, and thanks for telling me about this tool at ICST, Alastair! I was trying it out with a linked-list assignment and ran into a segfault. Here is a reduced version of the code that causes it:

template <typename T>
class List {
public:
  struct Node {
  };

  List() : node_ptr(0) {}

  Node *node_ptr; 
};

The segfault disappears if I make any of the following changes:

I'm using the pre-compiled Ubuntu 20.04 version. Please let me know if there's any additional information I can provide.

Thanks! James

afd commented 1 year ago

Thanks James!

I tried this on the latest version built from source, and it seems to work:

./temp/build-Debug/src/dredd/dredd fromjames.cpp --mutation-info-file blah.json

This leads to the attached output file (which I had to rename to .txt).

fromjames.cpp.txt

I'll look into doing another release and will see whether there's crash with the released version.

afd commented 1 year ago

OK, I have done another release - I only have things configured to release for Ubuntu 22.04 at the moment. Will that work for you? (Not sure what happens when you run an Ubuntu X application on Ubuntu Y < X when X and Y are still close.

I can certainly look into supporting 20.04 if you're keen to try dredd and would prefer that.

james-perretta commented 1 year ago

Super, thanks! The new release doesn't seem to work out of the box on Ubuntu 20.04 (it's missing a particular version of glibc/glibcxx), but I can just upgrade to 22.04. I'll let you know if I run into any other problems after upgrading.

james-perretta commented 1 year ago

I upgraded to Ubuntu 22.04, and it works as expected. Thanks!

afd commented 1 year ago

Great, thanks @james-perretta! Do open new issues if you run into any further problems, or have feature requests relating to your interests.