amplab / snap

Scalable Nucleotide Alignment Program -- a fast and accurate read aligner for high-throughput sequencing data
https://www.microsoft.com/en-us/research/project/snap/
Apache License 2.0
287 stars 66 forks source link

segfault: OpenMemoryMappedFile datatest/OverflowTable mmap failed: Invalid argument #129

Closed mr-c closed 3 years ago

mr-c commented 3 years ago

Hello, while updating the snap-aligner package to version 1.0.0 I've run into a segfault running a test:

snap-aligner single datatest datatest.fq -o output.sam
Welcome to SNAP version 1.0.0.

Loading index from directory... snap-aligner: OpenMemoryMappedFile datatest/OverflowTable mmap failed: Invalid argument
debian/tests/run-unit-test: line 37: 3913446 Segmentation fault      (core dumped) snap-aligner single datatest datatest.fq -o output.sam
Core was generated by `snap-aligner single datatest datatest.fq -o output.sam'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000055a729889ec4 in AdviseMemoryMappedFilePrefetch (mappedFile=0x0) at SNAPLib/Compat.cpp:1602

1602      if (madvise(mappedFile->map, mappedFile->length, MADV_SEQUENTIAL)) {
(gdb) bt
#0  0x000055a729889ec4 in AdviseMemoryMappedFilePrefetch (mappedFile=0x0) at SNAPLib/Compat.cpp:1602
#1  0x000055a72989970d in GenericFile_map::prefetch (this=0x55a729c5c370) at SNAPLib/GenericFile_map.cpp:61
#2  0x000055a72989d68c in GenomeIndex::loadFromDirectory (directoryName=0x7ffcdfe1d04a "datatest", map=<optimized out>, prefetch=<optimized out>) at SNAPLib/GenomeIndex.cpp:1791
#3  0x000055a72986d1a0 in AlignerContext::initialize (this=0x7ffcdfc1b610) at SNAPLib/AlignerContext.cpp:211
#4  0x000055a72986e994 in AlignerContext::runAlignment (this=0x7ffcdfc1b610, argc=5, argv=<optimized out>, version=<optimized out>, argsConsumed=0x7ffcdfc1b60c) at SNAPLib/AlignerContext.cpp:101
#5  0x000055a729888ba4 in ProcessNonDaemonCommands (argc=6, argv=0x7ffcdfe1ba48) at SNAPLib/CommandProcessor.cpp:67
#6  0x000055a72986b069 in main (argc=<optimized out>, argv=<optimized out>) at apps/snap/Main.cpp:32

Here's the complete build log with Debian package versions and exact compilation flags used: https://gist.github.com/mr-c/c8b4c61d511a80bfcae7bef65fde105e

arun-sub commented 3 years ago

Thanks for reporting this. I pushed a fix to the affineGap branch. Could you please try it out and let me know if it works for you ?

--Arun

mr-c commented 3 years ago

Dear @arun-sub ; that worked, thanks! I've just upload snap-aligner v1.0.0 to Debian's development distribution with your patch.

arun-sub commented 3 years ago

I merged the changes to master, so you can pull the latest commit with the fix as well.

bolosky commented 3 years ago

I pushed a new binary and updated the web page/readme.

I don’t have a way to make OSX binaries, but we probably only need to update those sometimes. It’s not like too many people are going to run an aligner with a reference that has no duplication at all.

From: Arun Subramaniyan notifications@github.com Sent: Sunday, November 29, 2020 12:16 AM To: amplab/snap snap@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [amplab/snap] segfault: OpenMemoryMappedFile datatest/OverflowTable mmap failed: Invalid argument (#129)

I merged the changes to master, so you can pull the latest commit with the fix as well.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Famplab%2Fsnap%2Fissues%2F129%23issuecomment-735359488&data=04%7C01%7Cbolosky%40microsoft.com%7Caf58140c38704b2466f008d8943f08a7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637422345736398707%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=7onX0N0RjEIC%2BDUyqZ3OEZ%2FCKxeE9kjV%2FgaJYDNLvv0%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAHPTWI6235BU2CDBDOHJKTSSH7MZANCNFSM4UF4PIOA&data=04%7C01%7Cbolosky%40microsoft.com%7Caf58140c38704b2466f008d8943f08a7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637422345736408656%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=5kRBL81hFhSloh2XT2fQzOaIlIbh1zGZKmZznfoKKc4%3D&reserved=0.

mr-c commented 3 years ago

Thanks all, I think this issue has been resolved!