gmarcais / Jellyfish

A fast multi-threaded k-mer counter
Other
471 stars 136 forks source link

Segmentation fault #54

Open anuragraj opened 8 years ago

anuragraj commented 8 years ago

After binding jellyfish with perl, getting segmentation fault in this part of code:

foreach my $m (@ARGV) {
  my $mer = Jellyfish::MerDNA->new($m);
  `$mer->canonicalize;`
  print($mer, " ", $qf->get($mer), "\n");
}

The possible cause is in: $mer->canonicalize;

And there is one typo error too if you see this line: my $mer = Jellyfish::MerDNA->new($m); i.e. "Jellyfish" should be "jellyfish".

Thanks

culpinnis commented 8 years ago

I am getting random segmentation faults on our linux machine, too. Red Hat Linux with Kernel 3.10.0-327.18.2.el7.x86_64 and perl v5.16.3 . I will upload my code into our git repository in the next days. I am using a lot of different kmers with the MerDNA-function. Interestingly the segmentation fault is deterministic to the used perl code. It is always crashing for the same kmer. But if I change my code (just creating a new variable is enough), it will crash at another kmer. Seems to be an issue with pointers. For me it is not the $mer->canonicalize-function causing this, it is the creation of the mer-object.

Cheers Chris

ps. If it is necessary to debug the code in detail, just give me the instructions.

gmarcais commented 8 years ago

This Perl binding bugs has been reported a couple of times now, on both Mac and Linux system. I am looking into it.