Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on running example command #15

Closed
hexylena opened this issue Nov 2, 2015 · 5 comments
Closed

Crash on running example command #15

hexylena opened this issue Nov 2, 2015 · 5 comments

Comments

@hexylena
Copy link

hexylena commented Nov 2, 2015

Howdy! Mash looks like a lot of fun and I'd like to try it out, but after getting it built, I see a crash when running the example command:

./mash dist genome1.fna genome2.fna

Here's the crash message:

hxr@leda:~/work/Mash$ ./mash dist genome1.fna genome2.fna
Sketching genome1.fna (provide sketch file made with "mash sketch" to skip)...*** stack smashing detected ***: ./mash terminated
Aborted (core dumped)

And opening the core dump up in gdb:

[New LWP 13107]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./mash dist genome1.fna genome2.fna'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007f1065a46267 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
55      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.

can post core dump/etc if needed :)

Other stuff:

$ uname -a
Linux leda 3.19.0-30-generic #34-Ubuntu SMP Fri Oct 2 22:08:41 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ gcc --version
gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2
@ondovb
Copy link
Member

ondovb commented Nov 2, 2015

I'm curious about the "No such file or directory" part of the core dump. Is it possible that either of your input files is missing or can't be opened (due to permissions maybe)? There should be a nicer error for that, but it's possible our error checking doesn't work with this GCC version.

@hexylena
Copy link
Author

hexylena commented Nov 2, 2015

I was too, but I'm using the example data from the repository. After the first crash I figured it might be my data, or running from ~/ but when testing with this repository's data it became clear that that wasn't the issue at hand.

hxr@leda:~/work/Mash$ ls -al genome* data/genome*
-rw-rw-r-- 1 hxr hxr     132 Nov  2 09:09 data/genome1.fna
-rw-rw-r-- 1 hxr hxr     132 Nov  2 09:09 data/genome2.fna
-rw-rw-r-- 1 hxr hxr     132 Nov  2 09:09 data/genome3.fna
-rw-r----- 1 hxr hxr 4706047 Nov  2 09:30 genome1.fna
-rw-r----- 1 hxr hxr 5577087 Nov  2 09:30 genome2.fna
hxr@leda:~/work/Mash$ md5sum genome*.fna
385181dd87acd9dfac85b4f03d8840c2  genome1.fna
2819c48fc28e4399eefdcd6b1695c6c0  genome2.fna
hxr@leda:~/work/Mash$ head genome1.fna 
>gi|49175990|ref|NC_000913.2| Escherichia coli str. K-12 substr. MG1655, complete genome
AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGC
TTCTGAACTGGTTACCTGCCGTGAGTAAATTAAAATTTTATTGACTTAGGTCACTAAATACTTTAACCAA
TATAGGCATAGCGCACAGACAGATAAAAATTACAGAGTACACAACATCCATGAAACGCATTAGCACCACC
ATTACCACCACCATCACCATTACCACAGGTAACGGTGCGGGCTGACGCGTACAGGAAACACAGAAAAAAG
CCCGCACCTGACAGTGCGGGCTTTTTTTTTCGACCAAAGGTAACGAGGTAACAACCATGCGAGTGTTGAA
GTTCGGCGGTACATCAGTGGCAAATGCAGAACGTTTTCTGCGTGTTGCCGATATTCTGGAAAGCAATGCC
AGGCAGGGGCAGGTGGCCACCGTCCTCTCTGCCCCCGCCAAAATCACCAACCACCTGGTGGCGATGATTG
AAAAAACCATTAGCGGCCAGGATGCTTTACCCAATATCAGCGATGCCGAACGTATTTTTGCCGAACTTTT
GACGGGACTCGCCGCCGCCCAGCCGGGGTTCCCGCTGGCGCAATTGAAAACTTTCGTCGATCAGGAATTT

Here's the backtrace (sorry, forgot that earlier)

(gdb) backtrace 
#0  0x00007ffff677a267 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
#1  0x00007ffff677beca in __GI_abort () at abort.c:89
#2  0x00007ffff67bdc53 in __libc_message (do_abort=do_abort@entry=1, fmt=fmt@entry=0x7ffff68d3dad "*** %s ***: %s terminated\n")
    at ../sysdeps/posix/libc_fatal.c:175
#3  0x00007ffff685de8c in __GI___fortify_fail (msg=<optimised out>, msg@entry=0x7ffff68d3d95 "stack smashing detected") at fortify_fail.c:38
#4  0x00007ffff685de30 in __stack_chk_fail () at stack_chk_fail.c:28
#5  0x000000000041935f in getHash(char const*, int) ()
#6  0x000000000041f154 in addMinHashes(HashSet&, HashPriorityQueue&, bloom_filter*, char*, unsigned int, Sketch::Parameters const&, unsigned long&, unsigned long&) ()
#7  0x0000000000420a3e in Sketch::initFromSequence(std::vector<std::string, std::allocator<std::string> > const&, Sketch::Parameters const&, int) ()
#8  0x00000000004066fd in CommandDistance::run() const ()
#9  0x0000000000426272 in Command::run(int, char const**) ()
#10 0x0000000000418299 in CommandList::run(int, char const**) ()
#11 0x000000000040406d in main ()

after some cursory searching, that same "No such file or directory" error seems to show up in other places as well, so that error may be a spurious warning next to the stack smashing attempt which I'm guessing is just an overflowing buffer somewhere.

@ondovb
Copy link
Member

ondovb commented Nov 2, 2015

It looks likes that's true; there is an overflowing buffer during hashing that just never manifested as an error in older environments (presumably due to less error-checking). Here is a binary that should be fixed; if you can confirm I will push the code and incorporate into the first minor update:

https://www.dropbox.com/s/opznul48z1745ak/mash.gz?dl=0

@hexylena
Copy link
Author

hexylena commented Nov 3, 2015

Yep, that's fixed it! Thanks so much :)

hxr@leda:~/work/Mash$ ./mash dist genome1.fna genome2.fna 
Sketching genome1.fna (provide sketch file made with "mash sketch" to skip)...*** stack smashing detected ***: ./mash terminated
Aborted (core dumped)
hxr@leda:~/work/Mash$ ./mash-new dist genome1.fna genome2.fna 
Sketching genome1.fna (provide sketch file made with "mash sketch" to skip)...done.
genome1.fna     genome2.fna     0.0222766       0       456/1000

I'll be working on developing a Galaxy wrapper for this now that I can run it.

@ondovb
Copy link
Member

ondovb commented Nov 4, 2015

Fix posted in v1.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants