vice87 / gam-ngs

Genomic Assemblies Merger for NGS
GNU General Public License v3.0
26 stars 10 forks source link

Memory corruption error in gam-merge #15

Closed jjolanta closed 9 years ago

jjolanta commented 10 years ago

I am getting this error while running gam-merge script with a particular data. I was able to run it successfully with a different data set. It is a fairly new system install and Ubuntu 14.04 64 bits. Here is the output:

Starting program: /opt/gam-ngs/bin/gam-merge --master-bam map2clcbio.txt --slave-bam map2mas.txt --blocks-file NFe45115.blocks --master-fasta GK45115_Contigs_clcbio.fasta --slave-fasta NFe45115_masurca_contigs.fasta --min-block-size 25 --threads 8 --output NFe45115 2> merge_err.log [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [main] Loading blocks [main] Loaded blocks = 219541 [main] Loading BAMs data [bam] Master PE-alignments file map2clcbio.txt successfully opened: /home/jola/CLS_GAM/NFe45115/aln_clcbio.sorted.bam inserts size = 387.409 +/- 44.7897 coverage = 122.059 [bam] Slave PE-alignments file map2mas.txt successfully opened: /home/jola/CLS_GAM/NFe45115/aln_mas.sorted.bam inserts size = 389.54 +/- 43.7031 coverage = 138.556 [main] Loading contigs data * Error in `/opt/gam-ngs/bin/gam-merge': malloc(): memory corruption: 0x000000000372b770 *

Program received signal SIGABRT, Aborted. 0x00007ffff676bf79 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) backtrace

0 0x00007ffff676bf79 in __GI_raise (sig=sig@entry=6)

at ../nptl/sysdeps/unix/sysv/linux/raise.c:56

1 0x00007ffff676f388 in __GI_abort () at abort.c:89

2 0x00007ffff67a91d4 in __libc_message (do_abort=1,

fmt=fmt@entry=0x7ffff68b7a10 "*** Error in `%s': %s: 0x%s ***\n")
at ../sysdeps/posix/libc_fatal.c:175

3 0x00007ffff67b6d76 in malloc_printerr (ptr=0x372b770,

str=0x7ffff68b3b84 "malloc(): memory corruption", action=<optimized out>)
at malloc.c:4996

4 _int_malloc (av=0x7ffff6af4760 , bytes=40) at malloc.c:3447

5 0x00007ffff67b85f0 in __GI___libc_malloc (bytes=40) at malloc.c:2891

6 0x00007ffff7075f2d in operator new(unsigned long) ()

from /usr/lib/x86_64-linux-gnu/libstdc++.so.6

7 0x000000000055fe56 in __gnu_cxx::new_allocatorstd::_Rb_tree_node::allocate (this=0x7fffffffd1a0, __n=1)

at /usr/include/c++/4.8/ext/new_allocator.h:104

8 0x000000000055fce8 in std::_Rb_tree<int, int, std::_Identity, std::less, std::allocator >::_M_get_node (this=0x7fffffffd1a0)

at /usr/include/c++/4.8/bits/stl_tree.h:370

9 0x000000000055f9d3 in std::_Rb_tree<int, int, std::_Identity, std::less, std::allocator >::_M_create_node (this=0x7fffffffd1a0,

__x=@0x7fffffffcc70: 1) at /usr/include/c++/4.8/bits/stl_tree.h:380

10 0x000000000055f516 in std::_Rb_tree<int, int, std::_Identity, std::less---Type to continue, or q to quit---

, std::allocator >::_M_insert_ (this=0x7fffffffd1a0, __x=0x0, __p=0x7fffffffd1a8, __v=@0x7fffffffcc70: 1) at /usr/include/c++/4.8/bits/stl_tree.h:1023 #11 0x000000000055eb00 in std::_Rb_tree, std::less, std::allocator >::_M_insert_unique (this=0x7fffffffd1a0, ``` __v=@0x7fffffffcc70: 1) at /usr/include/c++/4.8/bits/stl_tree.h:1382 ``` #12 0x000000000055db4f in std::set, std::allocator >::insert (this=0x7fffffffd1a0, __x=@0x7fffffffcc70: 1) ``` at /usr/include/c++/4.8/bits/stl_set.h:463 ``` #13 0x000000000055c5b1 in getNoBlocksContigs (masterRef=..., slaveRef=..., ``` blocks=..., masterNBC=..., slaveNBC=...) at /opt/gam-ngs/lib/src/assembly/Block.cc:847 ``` #14 0x0000000000526c01 in modules::Merge::execute (this=0x7fffffffdd40) ``` at /opt/gam-ngs/src/Merge.cc:260 ``` #15 0x0000000000524f79 in main (argc=17, argv=0x7fffffffde68) ``` at /opt/gam-ngs/src/gam-merge.cc:49 ``` (gdb)
Tetrajf commented 10 years ago

I seem to have run into this problem now. I ran my merging one way and now I've attempted to do it the other way (i.e. swapped master and slave). It worked well the one way but the other way gave me the error:

[bam] Master PE-alignments file SOAP110ass.txt successfully opened: /scratch/sysusers/Jonathan/src/gam-ngs-master/bin/SOAP110.bam inserts size = 342.094 +/- 90.76 coverage = 82.4943 [bam] Slave PE-alignments file SOAP35ass.txt successfully opened: /scratch/sysusers/Jonathan/src/gam-ngs-master/bin/SOAP35.bam inserts size = 334.747 +/- 86.6491 coverage = 66.9417 [main] Loading contigs data * glibc detected * ./gam-merge: malloc(): memory corruption: 0x000000000a9f8c70 ***

Did you respond to this question because I can't see it here.

vice87 commented 10 years ago

To perform the merging with master and slave swapped you should run also gam-create with master and slave swapped (and use the new "blocks file" created).

jjolanta commented 10 years ago

I am sorry, I've closed this issue unintentionally. Still experiencing the same problem. Any helpful remarks are greatly appreciated.

gedankenstuecke commented 10 years ago

Hi, I'm seeing a similar error. I call gam-merge with /home/bastian/bin/gam-ngs/bin/gam-merge --blocks-file merging-results.blocks --master-bam master-libraries.txt --master-fasta master-contigs.fasta --slave-bam slave-libraries.txt --slave-fasta slave-contigs.fasta --min-block-size 10 --output merge-results --threads 1 >gam-merge.log.out 2>gam-merge.log.err

and the process crashes with

*** glibc detected *** /home/bastian/bin/gam-ngs/bin/gam-merge: malloc(): memory corruption: 0x0000000008ed3690 ***
======= Backtrace: =========
/lib64/libc.so.6[0x3cd7476166]
/lib64/libc.so.6[0x3cd7479bf4]
/lib64/libc.so.6(__libc_malloc+0x71)[0x3cd747a9a1]
/usr/lib64/libstdc++.so.6(_Znwm+0x1d)[0x3ce24bd09d]
/home/bastian/bin/gam-ngs/bin/gam-merge(_ZNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE10_M_insert_EPKSt18_Rb_tree_node_baseS8_RKi+0x43)[0x45caf3]
/home/bastian/bin/gam-ngs/bin/gam-merge(_Z18getNoBlocksContigsRKSt6vectorI11reference_tSaIS0_EES4_RKSt4listI5BlockSaIS6_EERSt3setIiSt4lessIiESaIiEESG_+0x4d7)[0x459677]
/home/bastian/bin/gam-ngs/bin/gam-merge(_ZN7modules5Merge7executeEv+0x15d1)[0x43a201]
/home/bastian/bin/gam-ngs/bin/gam-merge(main+0x32)[0x437dd2]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x3cd741ed1d]
/home/bastian/bin/gam-ngs/bin/gam-merge[0x437c59]
======= Memory map: ========
00400000-004fc000 r-xp 00000000 00:18 32943311                           /home/bastian/bin/gam-ngs/bin/gam-merge
006fc000-006fe000 rw-p 000fc000 00:18 32943311                           /home/bastian/bin/gam-ngs/bin/gam-merge
006fe000-006ff000 rw-p 00000000 00:00 0 
00803000-0b710000 rw-p 00000000 00:00 0                                  [heap]
3832800000-3832883000 r-xp 00000000 fd:00 1310727                        /lib64/libm-2.12.so
3832883000-3832a82000 ---p 00083000 fd:00 1310727                        /lib64/libm-2.12.so
3832a82000-3832a83000 r--p 00082000 fd:00 1310727                        /lib64/libm-2.12.so
3832a83000-3832a84000 rw-p 00083000 fd:00 1310727                        /lib64/libm-2.12.so
3cd7000000-3cd7020000 r-xp 00000000 fd:00 1310928                        /lib64/ld-2.12.so
3cd721f000-3cd7220000 r--p 0001f000 fd:00 1310928                        /lib64/ld-2.12.so
3cd7220000-3cd7221000 rw-p 00020000 fd:00 1310928                        /lib64/ld-2.12.so
3cd7221000-3cd7222000 rw-p 00000000 00:00 0 
3cd7400000-3cd758b000 r-xp 00000000 fd:00 1310929                        /lib64/libc-2.12.so
3cd758b000-3cd778a000 ---p 0018b000 fd:00 1310929                        /lib64/libc-2.12.so
3cd778a000-3cd778e000 r--p 0018a000 fd:00 1310929                        /lib64/libc-2.12.so
3cd778e000-3cd778f000 rw-p 0018e000 fd:00 1310929                        /lib64/libc-2.12.so
3cd778f000-3cd7794000 rw-p 00000000 00:00 0 
3cd7c00000-3cd7c17000 r-xp 00000000 fd:00 1310931                        /lib64/libpthread-2.12.so
3cd7c17000-3cd7e17000 ---p 00017000 fd:00 1310931                        /lib64/libpthread-2.12.so
3cd7e17000-3cd7e18000 r--p 00017000 fd:00 1310931                        /lib64/libpthread-2.12.so
3cd7e18000-3cd7e19000 rw-p 00018000 fd:00 1310931                        /lib64/libpthread-2.12.so
3cd7e19000-3cd7e1d000 rw-p 00000000 00:00 0 
3cd8400000-3cd8407000 r-xp 00000000 fd:00 1310933                        /lib64/librt-2.12.so
3cd8407000-3cd8606000 ---p 00007000 fd:00 1310933                        /lib64/librt-2.12.so
3cd8606000-3cd8607000 r--p 00006000 fd:00 1310933                        /lib64/librt-2.12.so
3cd8607000-3cd8608000 rw-p 00007000 fd:00 1310933                        /lib64/librt-2.12.so
3cd8800000-3cd8815000 r-xp 00000000 fd:00 1310953                        /lib64/libz.so.1.2.3
3cd8815000-3cd8a14000 ---p 00015000 fd:00 1310953                        /lib64/libz.so.1.2.3
3cd8a14000-3cd8a15000 r--p 00014000 fd:00 1310953                        /lib64/libz.so.1.2.3
3cd8a15000-3cd8a16000 rw-p 00015000 fd:00 1310953                        /lib64/libz.so.1.2.3
3cdd000000-3cdd016000 r-xp 00000000 fd:00 1311021                        /lib64/libgcc_s-4.4.7-20120601.so.1
3cdd016000-3cdd215000 ---p 00016000 fd:00 1311021                        /lib64/libgcc_s-4.4.7-20120601.so.1
3cdd215000-3cdd216000 rw-p 00015000 fd:00 1311021                        /lib64/libgcc_s-4.4.7-20120601.so.1
3ce2400000-3ce24e8000 r-xp 00000000 fd:00 2257802                        /usr/lib64/libstdc++.so.6.0.13
3ce24e8000-3ce26e8000 ---p 000e8000 fd:00 2257802                        /usr/lib64/libstdc++.so.6.0.13
3ce26e8000-3ce26ef000 r--p 000e8000 fd:00 2257802                        /usr/lib64/libstdc++.so.6.0.13
3ce26ef000-3ce26f1000 rw-p 000ef000 fd:00 2257802                        /usr/lib64/libstdc++.so.6.0.13
3ce26f1000-3ce2706000 rw-p 00000000 00:00 0 
7fe188a19000-7fe18902c000 rw-p 00000000 00:00 0 
7fe189037000-7fe189cab000 rw-p 00000000 00:00 0 
7fe189ece000-7fe18a557000 rw-p 00000000 00:00 0 
7fe18a557000-7fe18a647000 r-xp 00000000 00:18 28583386                   /share/applications/boost/boost-1.54.0/lib/libboost_regex.so.1.54.0
7fe18a647000-7fe18a847000 ---p 000f0000 00:18 28583386                   /share/applications/boost/boost-1.54.0/lib/libboost_regex.so.1.54.0
7fe18a847000-7fe18a84d000 rw-p 000f0000 00:18 28583386                   /share/applications/boost/boost-1.54.0/lib/libboost_regex.so.1.54.0
7fe18a84d000-7fe18a84f000 rw-p 00000000 00:00 0 
7fe18a84f000-7fe18a864000 r-xp 00000000 00:18 28583384                   /share/applications/boost/boost-1.54.0/lib/libboost_filesystem.so.1.54.0
7fe18a864000-7fe18aa64000 ---p 00015000 00:18 28583384                   /share/applications/boost/boost-1.54.0/lib/libboost_filesystem.so.1.54.0
7fe18aa64000-7fe18aa65000 rw-p 00015000 00:18 28583384                   /share/applications/boost/boost-1.54.0/lib/libboost_filesystem.so.1.54.0
7fe18aa65000-7fe18aa68000 r-xp 00000000 00:18 28583376                   /share/applications/boost/boost-1.54.0/lib/libboost_system.so.1.54.0
7fe18aa68000-7fe18ac67000 ---p 00003000 00:18 28583376                   /share/applications/boost/boost-1.54.0/lib/libboost_system.so.1.54.0
7fe18ac67000-7fe18ac68000 rw-p 00002000 00:18 28583376                   /share/applications/boost/boost-1.54.0/lib/libboost_system.so.1.54.0
7fe18ac68000-7fe18ac69000 rw-p 00000000 00:00 0 
7fe18ac69000-7fe18acd0000 r-xp 00000000 00:18 21335825                   /share/applications/boost/boost-1.54.0/lib/libboost_program_options.so.1.54.0
7fe18acd0000-7fe18aed0000 ---p 00067000 00:18 21335825                   /share/applications/boost/boost-1.54.0/lib/libboost_program_options.so.1.54.0
7fe18aed0000-7fe18aed4000 rw-p 00067000 00:18 21335825                   /share/applications/boost/boost-1.54.0/lib/libboost_program_options.so.1.54.0
7fe18aed4000-7fe18af32000 r-xp 00000000 00:18 28583388                   /share/applications/boost/boost-1.54.0/lib/libboost_graph.so.1.54.0
7fe18af32000-7fe18b131000 ---p 0005e000 00:18 28583388                   /share/applications/boost/boost-1.54.0/lib/libboost_graph.so.1.54.0
7fe18b131000-7fe18b135000 rw-p 0005d000 00:18 28583388                   /share/applications/boost/boost-1.54.0/lib/libboost_graph.so.1.54.0
7fe18b135000-7fe18b136000 rw-p 00000000 00:00 0 
7fe18b13e000-7fe18b14f000 rw-p 00000000 00:00 0 
7fff1dcfb000-7fff1dd11000 rw-p 00000000 00:00 0                          [stack]
7fff1ddff000-7fff1de00000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted (core dumped)

The gam-merge.log.out then contains this:

[main] Loading blocks
[main] Loaded blocks = 162920
[main] Loading BAMs data
[bam] Master PE-alignments file master-libraries.txt successfully opened:
      master_library1_reads_sorted_bam.bam
         inserts size = 379.89 +/- 94.4939      coverage = 34.601
      master_library2_reads_sorted_bam.bam
         inserts size = 485.491 +/- 127.992     coverage = 28.9235
      master_library3_reads_sorted_bam.bam
         inserts size = 480.753 +/- 126.356     coverage = 18.2901
      master_library4_reads_sorted_bam.bam
         inserts size = 5240.66 +/- 421.617     coverage = 18.5868
[bam] Slave PE-alignments file slave-libraries.txt successfully opened:
      slave_library1_sorted_bam.bam
         inserts size = 375.027 +/- 91.4645     coverage = 82.2051
      slave_library2_sorted_bam.bam
         inserts size = 471.059 +/- 126.969     coverage = 1.57334
      slave_library3_sorted_bam.bam
         inserts size = 467.116 +/- 125.064     coverage = 0.983943
      slave_library4_sorted_bam.bam
         inserts size = 5114.84 +/- 394.092     coverage = 58.4013
[main] Loading contigs data

So it seems to crash during reading the contig data, but I have no idea why. I also used gam-ngs for other assemblies before without encountering this error. After an afternoon of debugging and trying to solve the issue by myself I'm pretty clueless of what might be the issue. Does anyone have an idea?

insectnate commented 9 years ago

I am also getting this error when I attempt to merge two sets of contigs. The example data runs fine and I have run another pair of contigs through the pipeline successfully. I tried reversing the master slave relationship of the sets of contigs but still get the error shone below. * glibc detected * gam-merge: malloc(): memory corruption: 0x000000000d4ae600 \ glibc detected *_gam-merge: malloc(): memory corruption: 0x000000000d4ae600 *_ Any advise is greatly appreciated. Thanks, Nathan

vice87 commented 9 years ago

This issue should have been fixed in the last release.

insectnate commented 9 years ago

I updated to the latest release but I still get the error in my gam-merge.log.err

* glibc detected * gam-merge: malloc(): memory corruption: 0x000000000d100930 * *\ glibc detected _gam-merge: malloc(): memory corruption: 0x000000000d100930 _

vice87 commented 9 years ago

Could you provide me exactly the sequence of commands you run (both gam-create and gam-merge) and the content of gam-merge output files (i.e., gam-merge.log.err and gam-merge.log.out)?

insectnate commented 9 years ago

Hi Ricardo, Thanks for the help. The gam-create.log.err is empty. The other three are attached.

I used your pipline shell script as a template.

Nathan

On Thu, Nov 6, 2014 at 11:02 AM, Riccardo Vicedomini < notifications@github.com> wrote:

Could you provide me exactly the sequence of commands you run (both gam-create and gam-merge) and the content of gam-merge output files (i.e., gam-merge.log.err and gam-merge.log.out)?

— Reply to this email directly or view it on GitHub https://github.com/vice87/gam-ngs/issues/15#issuecomment-62013032.

jjolanta commented 9 years ago

I've run the new version on the data that I did have problems before. Works beautiful! Ubuntu 14.04 64bit, Boost 1.54.

Jolanta Jaromczyk Data Management Specialist Advanced Genetic Technologies Center Dept of Plant Pathology, University of Kentucky


From: Riccardo Vicedomini [notifications@github.com] Sent: Thursday, November 06, 2014 11:58 AM To: vice87/gam-ngs Cc: Jaromczyk, Jolanta Subject: Re: [gam-ngs] Memory corruption error in gam-merge (#15)

Reopened #15https://github.com/vice87/gam-ngs/issues/15.

— Reply to this email directly or view it on GitHubhttps://github.com/vice87/gam-ngs/issues/15#event-189428967.

vice87 commented 9 years ago

@insectnate I cannot find the log files. Did you forget to attach them? :)

insectnate commented 9 years ago

I did to the email reply but it did not appear here. It seems github won't except file types other than PNG, GIF, or JPG. Is there another email address I can send them to?

gedankenstuecke commented 9 years ago

I also just wanted to leave a quick feedback. The new version works for me on the data that previously showed the problem. Thanks a lot for the fix!