genomeCoverageBed error/bug?

303 views
Skip to first unread message

Jamie Walters

unread,
Mar 23, 2012, 2:54:29 AM3/23/12
to bedtools-discuss
Okay, I've got an error here that I cannot understand. running
v2.16.1

I sorted my bamfile with samtools sort.

I think I've got my .genome file straight (worked OK with
complementBed).

$ head Hmel_genome_sorted.bed
scf7180000006000 83500
scf7180000006004 223569
scf7180000006013 163478
scf7180000006014 174540
scf7180000006016 353155
scf7180000006018 238359
scf7180000006022 177333


but I repeatedly get the same type of error with different bam
files...

Is this a bug, or am I doing something wrong?

Thanks!

jamie

++++++++++++++++++++++++

$genomeCoverageBed -ibam sorted.test.bam -g Hmel_genome_sorted.bed >
out

*** glibc detected *** bedtools: free(): invalid next size (fast):
0x0000000000a31ea0 ***
======= Backtrace: =========
/lib/libc.so.6(+0x775b6)[0x7f88c75ad5b6]
/lib/libc.so.6(cfree+0x73)[0x7f88c75b3e83]
bedtools[0x460218]
bedtools[0x4601fc]
bedtools[0x45c46e]
bedtools[0x461b5e]
bedtools[0x4368ab]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7f88c7554c4d]
bedtools[0x406d89]
======= Memory map: ========
00400000-00546000 r-xp 00000000 08:03
12716876 /disk1/jw663/src/BEDTools-
Version-2.16.1/bin/bedtools
00746000-00748000 r--p 00146000 08:03
12716876 /disk1/jw663/src/BEDTools-
Version-2.16.1/bin/bedtools
00748000-00749000 rw-p 00148000 08:03
12716876 /disk1/jw663/src/BEDTools-
Version-2.16.1/bin/bedtools
00749000-0074a000 rw-p 00000000 00:00 0
00868000-00a4f000 rw-p 00000000 00:00
0 [heap]
7f88c0000000-7f88c0021000 rw-p 00000000 00:00 0
7f88c0021000-7f88c4000000 ---p 00000000 00:00 0
7f88c7536000-7f88c76b0000 r-xp 00000000 08:21
786785 /lib/libc-2.11.1.so
7f88c76b0000-7f88c78af000 ---p 0017a000 08:21
786785 /lib/libc-2.11.1.so
7f88c78af000-7f88c78b3000 r--p 00179000 08:21
786785 /lib/libc-2.11.1.so
7f88c78b3000-7f88c78b4000 rw-p 0017d000 08:21
786785 /lib/libc-2.11.1.so
7f88c78b4000-7f88c78b9000 rw-p 00000000 00:00 0
7f88c78b9000-7f88c78cf000 r-xp 00000000 08:21
786487 /lib/libgcc_s.so.1
7f88c78cf000-7f88c7ace000 ---p 00016000 08:21
786487 /lib/libgcc_s.so.1
7f88c7ace000-7f88c7acf000 r--p 00015000 08:21
786487 /lib/libgcc_s.so.1
7f88c7acf000-7f88c7ad0000 rw-p 00016000 08:21
786487 /lib/libgcc_s.so.1
7f88c7ad0000-7f88c7b52000 r-xp 00000000 08:21
786792 /lib/libm-2.11.1.so
7f88c7b52000-7f88c7d51000 ---p 00082000 08:21
786792 /lib/libm-2.11.1.so
7f88c7d51000-7f88c7d52000 r--p 00081000 08:21
786792 /lib/libm-2.11.1.so
7f88c7d52000-7f88c7d53000 rw-p 00082000 08:21
786792 /lib/libm-2.11.1.so
7f88c7d53000-7f88c7e49000 r-xp 00000000 08:21
60425741 /usr/lib/libstdc++.so.6.0.13
7f88c7e49000-7f88c8049000 ---p 000f6000 08:21
60425741 /usr/lib/libstdc++.so.6.0.13
7f88c8049000-7f88c8050000 r--p 000f6000 08:21
60425741 /usr/lib/libstdc++.so.6.0.13
7f88c8050000-7f88c8052000 rw-p 000fd000 08:21
60425741 /usr/lib/libstdc++.so.6.0.13
7f88c8052000-7f88c8067000 rw-p 00000000 00:00 0
7f88c8067000-7f88c807d000 r-xp 00000000 08:21
786668 /lib/libz.so.1.2.3.3
7f88c807d000-7f88c827c000 ---p 00016000 08:21
786668 /lib/libz.so.1.2.3.3
7f88c827c000-7f88c827d000 r--p 00015000 08:21
786668 /lib/libz.so.1.2.3.3
7f88c827d000-7f88c827e000 rw-p 00016000 08:21
786668 /lib/libz.so.1.2.3.3
7f88c827e000-7f88c829e000 r-xp 00000000 08:21
786505 /lib/ld-2.11.1.so
7f88c847d000-7f88c8481000 rw-p 00000000 00:00 0
7f88c8499000-7f88c849a000 rw-p 00000000 00:00 0
7f88c849b000-7f88c849d000 rw-p 00000000 00:00 0
7f88c849d000-7f88c849e000 r--p 0001f000 08:21
786505 /lib/ld-2.11.1.so
7f88c849e000-7f88c849f000 rw-p 00020000 08:21
786505 /lib/ld-2.11.1.so
7f88c849f000-7f88c84a0000 rw-p 00000000 00:00 0
7fff8d5f2000-7fff8d607000 rw-p 00000000 00:00
0 [stack]
7fff8d7df000-7fff8d7e0000 r-xp 00000000 00:00
0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00
0 [vsyscall]
Aborted

Aaron Quinlan

unread,
Mar 27, 2012, 11:08:57 AM3/27/12
to bedtools...@googlegroups.com
Hi Jamie,

Sorry for the delayed response. There have been some issues with moderating posts since the release of the newer Google Groups framework. GenomeCoverageBed no longer requires the use of a genome file (-g) when using BAM as input (as the necessary chomosome size info is already in the BAM header).

Could you try remove the -g option?

Best,
Aaron

Jamie Walters

unread,
Mar 29, 2012, 1:38:57 AM3/29/12
to bedtools-discuss
Aaron

I've tried again without the -g and still get a similar error.
However, all the errors are produced by a pipeline that starts with
Stampy alignments and then goes through dedupping & indel realignment
(GATK). This time I also called GCB on bam files that were from RNA
seq (both RSEM & Tophat). Neither of those gave errors.

Earlier today I also discovered I was getting an error with GATK
Unified genotyper about mis-formed reads ending in a deletion. So now
I suspect perhaps Stampy is producing some sort of formatting errors
that are causing such issues..?? I will try realigning a subset of
reads with different tools to see if I can confirm this.

Jamie

Aaron Quinlan

unread,
Jun 13, 2012, 10:44:51 AM6/13/12
to bedtools...@googlegroups.com
Hi,

I think this will require inspection of the file.  Could you send me (privately) the smallest file possible that produces the error?

Best,
Aaron

On Jun 10, 2012, at 12:57 AM, farhat...@gmail.com wrote:

I am getting a similar error with genomeCoverageBed. It runs fine for a while then crashes with the below message. It was calculating the coverage of a sorted bam file produced using bwasw.


--------
** glibc detected *** /home/farhat/tmp/software/BEDTools-Version-2.16.2/bin/bedtools: double free or corruption (out): 0x0000000001512a40 ***
======= Backtrace: =========
/lib/libc.so.6(+0x775b6)[0x7f3ad0c7b5b6]
/lib/libc.so.6(cfree+0x73)[0x7f3ad0c81e83]
/home/farhat/tmp/software/BEDTools-Version-2.16.2/bin/bedtools[0x45dfe3]
/home/farhat/tmp/software/BEDTools-Version-2.16.2/bin/bedtools[0x45e60c]
/home/farhat/tmp/software/BEDTools-Version-2.16.2/bin/bedtools[0x45f603]
/home/farhat/tmp/software/BEDTools-Version-2.16.2/bin/bedtools[0x461aed]
/home/farhat/tmp/software/BEDTools-Version-2.16.2/bin/bedtools[0x4368ab]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7f3ad0c22c4d]
/home/farhat/tmp/software/BEDTools-Version-2.16.2/bin/bedtools[0x406d89]
======= Memory map: ========
00400000-00546000 r-xp 00000000 08:61 196108897                          /mnt/disk1/home/farhat/tmp/software/BEDTools-Version-2.16.2/bin/bedtools
00746000-00748000 r--p 00146000 08:61 196108897                          /mnt/disk1/home/farhat/tmp/software/BEDTools-Version-2.16.2/bin/bedtools
.
.
.

Aaron Quinlan

unread,
May 1, 2013, 9:31:56 AM5/1/13
to bedtools...@googlegroups.com
This looks like you have exceeded the memory available on your machine.  How much memory is available on the box on which genomeCoverageBed is running?


On Apr 30, 2013, at 2:20 PM, John G <johng...@gmail.com> wrote:

I haven't been able to find much info about resolution to this issue and was wondering if there were any updates.  I am running the most recent version of bedtools.  I have about 40 bams that are the product of an alignment to the same reference for all sequences.  When I run genomeCoverageBed, it works fine for the majority of bams.  However, for a handful, it reproducibly fails with the following error:

*** glibc detected *** genomeCoverageBed: double free or corruption (out): 0x00000000018d70e0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7f7473078b96]
genomeCoverageBed[0x408473]
genomeCoverageBed[0x409e2c]
genomeCoverageBed[0x40afdc]
genomeCoverageBed[0x405c1d]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f747301b76d]
genomeCoverageBed[0x4049d9]
======= Memory map: ========
00400000-0044b000 r-xp 00000000 103:02 1581643                           /usr/local/src/arq5x-bedtools-322729c/bin/genomeCoverageBed
0064b000-0064c000 r--p 0004b000 103:02 1581643                           /usr/local/src/arq5x-bedtools-322729c/bin/genomeCoverageBed
0064c000-0064d000 rw-p 0004c000 103:02 1581643                           /usr/local/src/arq5x-bedtools-322729c/bin/genomeCoverageBed
01575000-027da000 rw-p 00000000 00:00 0                                  [heap]
7f7472dce000-7f7472f00000 rw-p 00000000 00:00 0
7f7472ffa000-7f74731af000 r-xp 00000000 103:02 3670125                   /lib/x86_64-linux-gnu/libc-2.15.so
7f74731af000-7f74733ae000 ---p 001b5000 103:02 3670125                   /lib/x86_64-linux-gnu/libc-2.15.so
7f74733ae000-7f74733b2000 r--p 001b4000 103:02 3670125                   /lib/x86_64-linux-gnu/libc-2.15.so
7f74733b2000-7f74733b4000 rw-p 001b8000 103:02 3670125                   /lib/x86_64-linux-gnu/libc-2.15.so
7f74733b4000-7f74733b9000 rw-p 00000000 00:00 0
7f74733b9000-7f74733ce000 r-xp 00000000 103:02 3673824                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f74733ce000-7f74735cd000 ---p 00015000 103:02 3673824                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f74735cd000-7f74735ce000 r--p 00014000 103:02 3673824                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f74735ce000-7f74735cf000 rw-p 00015000 103:02 3673824                   /lib/x86_64-linux-gnu/libgcc_s.so.1
7f74735cf000-7f74736ca000 r-xp 00000000 103:02 3670133                   /lib/x86_64-linux-gnu/libm-2.15.so
7f74736ca000-7f74738c9000 ---p 000fb000 103:02 3670133                   /lib/x86_64-linux-gnu/libm-2.15.so
7f74738c9000-7f74738ca000 r--p 000fa000 103:02 3670133                   /lib/x86_64-linux-gnu/libm-2.15.so
7f74738ca000-7f74738cb000 rw-p 000fb000 103:02 3670133                   /lib/x86_64-linux-gnu/libm-2.15.so
7f74738cb000-7f74739ad000 r-xp 00000000 103:02 794168                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7f74739ad000-7f7473bac000 ---p 000e2000 103:02 794168                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7f7473bac000-7f7473bb4000 r--p 000e1000 103:02 794168                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7f7473bb4000-7f7473bb6000 rw-p 000e9000 103:02 794168                    /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7f7473bb6000-7f7473bcb000 rw-p 00000000 00:00 0
7f7473bcb000-7f7473be1000 r-xp 00000000 103:02 3673877                   /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f7473be1000-7f7473de0000 ---p 00016000 103:02 3673877                   /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f7473de0000-7f7473de1000 r--p 00015000 103:02 3673877                   /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f7473de1000-7f7473de2000 rw-p 00016000 103:02 3673877                   /lib/x86_64-linux-gnu/libz.so.1.2.3.4
7f7473de2000-7f7473e04000 r-xp 00000000 103:02 3670139                   /lib/x86_64-linux-gnu/ld-2.15.so
7f7473eeb000-7f7473ff0000 rw-p 00000000 00:00 0
7f7474002000-7f7474004000 rw-p 00000000 00:00 0
7f7474004000-7f7474005000 r--p 00022000 103:02 3670139                   /lib/x86_64-linux-gnu/ld-2.15.so
7f7474005000-7f7474007000 rw-p 00023000 103:02 3670139                   /lib/x86_64-linux-gnu/ld-2.15.so
7fffb62cc000-7fffb62ed000 rw-p 00000000 00:00 0                          [stack]
7fffb6377000-7fffb6378000 r-xp 00000000 00:00 0                          [vdso]

ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted (core dumped)
--
You received this message because you are subscribed to the Google Groups "bedtools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bedtools-discu...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

John

unread,
May 1, 2013, 9:45:45 AM5/1/13
to bedtools...@googlegroups.com, bedtools...@googlegroups.com
I ran it on a 150 gb machine as well as a 1tb machine.  I am fairly confident it is not lack of memory, but it does seem like a strange error.  These are bacterial plasmid alignments, not very high copy, so it does not consume much. I will look at exact usage in the log file when I am logged on to verify this.

FYI, I also get the same error with a previous version.

Any other thoughts as to things I could check?

Thanks,
John
You received this message because you are subscribed to a topic in the Google Groups "bedtools-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bedtools-discuss/NhZyo1eJj_s/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to bedtools-discu...@googlegroups.com.

Aaron Quinlan

unread,
May 1, 2013, 9:47:38 AM5/1/13
to bedtools...@googlegroups.com
Would it be possible to share (privately) one of the offending BAMs so that I can diagnose this?

John

unread,
May 1, 2013, 9:50:15 AM5/1/13
to bedtools...@googlegroups.com
Sure.  I will send it along once I get to the office.  Thanks for taking a look!  It will probably come from my work email, which is jgil...@tgen.org.

John

roye....@gmail.com

unread,
Dec 18, 2014, 10:50:41 AM12/18/14
to bedtools...@googlegroups.com
Aaron, was this issue eventually resolved?  I seem to have gotten something similar, and oddly it was also with alignment to bacterial plasmids:

On an Ubuntu server with 128 GB RAM, 

samtools view -b <my.bam> | bedtools2-2.20.1/bin/bedtools genomecov -d -ibam stdin | awk '$3!=0' > <covered_bases.txt>

*** glibc detected *** bedtools2-2.20.1/bin/bedtools: double free or corruption (out): 0x0000000007c12460 ***

======= Backtrace: =========

/lib/x86_64-linux-gnu/libc.so.6(+0x7e626)[0x7f81e4e40626]

bedtools2-2.20.1/bin/bedtools[0x48f907]

bedtools2-2.20.1/bin/bedtools[0x48fddd]

bedtools2-2.20.1/bin/bedtools[0x49116a]

bedtools2-2.20.1/bin/bedtools[0x4942b9]

bedtools2-2.20.1/bin/bedtools[0x4082a5]

/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f81e4de376d]

bedtools2-2.20.1/bin/bedtools[0x40cf79]

======= Memory map: ========

00400000-005b0000 r-xp 00000000 00:21 33115680                           /specific/a/nas-eran-01/groups/eran_halperin/rozovr/bedtools2-2.20.1/bin/bedtools

007b0000-007b4000 r--p 001b0000 00:21 33115680                           /specific/a/nas-eran-01/groups/eran_halperin/rozovr/bedtools2-2.20.1/bin/bedtools

007b4000-007b5000 rw-p 001b4000 00:21 33115680                           /specific/a/nas-eran-01/groups/eran_halperin/rozovr/bedtools2-2.20.1/bin/bedtools

007b5000-07cdc000 rw-p 00000000 00:00 0                                  [heap]

7f81df36c000-7f81e0b6d000 rw-p 00000000 00:00 0 

7f81e4dc2000-7f81e4f75000 r-xp 00000000 00:0e 42655649                   /lib/x86_64-linux-gnu/libc-2.15.so

7f81e4f75000-7f81e5174000 ---p 001b3000 00:0e 42655649                   /lib/x86_64-linux-gnu/libc-2.15.so

7f81e5174000-7f81e5178000 r--p 001b2000 00:0e 42655649                   /lib/x86_64-linux-gnu/libc-2.15.so

7f81e5178000-7f81e517a000 rw-p 001b6000 00:0e 42655649                   /lib/x86_64-linux-gnu/libc-2.15.so

7f81e517a000-7f81e517f000 rw-p 00000000 00:00 0 

7f81e517f000-7f81e5194000 r-xp 00000000 00:16 32499184                   /usr/local/stow/gcc-4.8.0/lib/gcc-4.8.0/lib64/libgcc_s.so.1

7f81e5194000-7f81e5394000 ---p 00015000 00:16 32499184                   /usr/local/stow/gcc-4.8.0/lib/gcc-4.8.0/lib64/libgcc_s.so.1

7f81e5394000-7f81e5395000 rw-p 00015000 00:16 32499184                   /usr/local/stow/gcc-4.8.0/lib/gcc-4.8.0/lib64/libgcc_s.so.1

7f81e5395000-7f81e548e000 r-xp 00000000 00:0e 42655648                   /lib/x86_64-linux-gnu/libm-2.15.so

7f81e548e000-7f81e568d000 ---p 000f9000 00:0e 42655648                   /lib/x86_64-linux-gnu/libm-2.15.so

7f81e568d000-7f81e568e000 r--p 000f8000 00:0e 42655648                   /lib/x86_64-linux-gnu/libm-2.15.so

7f81e568e000-7f81e568f000 rw-p 000f9000 00:0e 42655648                   /lib/x86_64-linux-gnu/libm-2.15.so

7f81e568f000-7f81e5773000 r-xp 00000000 00:16 10043044                   /usr/local/stow/gcc-4.8.0/lib/gcc-4.8.0/lib64/libstdc++.so.6.0.18

7f81e5773000-7f81e5973000 ---p 000e4000 00:16 10043044                   /usr/local/stow/gcc-4.8.0/lib/gcc-4.8.0/lib64/libstdc++.so.6.0.18

7f81e5973000-7f81e597b000 r--p 000e4000 00:16 10043044                   /usr/local/stow/gcc-4.8.0/lib/gcc-4.8.0/lib64/libstdc++.so.6.0.18

7f81e597b000-7f81e597d000 rw-p 000ec000 00:16 10043044                   /usr/local/stow/gcc-4.8.0/lib/gcc-4.8.0/lib64/libstdc++.so.6.0.18

7f81e597d000-7f81e5992000 rw-p 00000000 00:00 0 

7f81e5992000-7f81e59a8000 r-xp 00000000 00:0e 34628217                   /lib/x86_64-linux-gnu/libz.so.1.2.3.4

7f81e59a8000-7f81e5ba7000 ---p 00016000 00:0e 34628217                   /lib/x86_64-linux-gnu/libz.so.1.2.3.4

7f81e5ba7000-7f81e5ba8000 r--p 00015000 00:0e 34628217                   /lib/x86_64-linux-gnu/libz.so.1.2.3.4

7f81e5ba8000-7f81e5ba9000 rw-p 00016000 00:0e 34628217                   /lib/x86_64-linux-gnu/libz.so.1.2.3.4

7f81e5ba9000-7f81e5bcb000 r-xp 00000000 00:0e 42655651                   /lib/x86_64-linux-gnu/ld-2.15.so

7f81e5d79000-7f81e5d7f000 rw-p 00000000 00:00 0 

7f81e5dc6000-7f81e5dcb000 rw-p 00000000 00:00 0 

7f81e5dcb000-7f81e5dcc000 r--p 00022000 00:0e 42655651                   /lib/x86_64-linux-gnu/ld-2.15.so

7f81e5dcc000-7f81e5dce000 rw-p 00023000 00:0e 42655651                   /lib/x86_64-linux-gnu/ld-2.15.so

7fff51876000-7fff51897000 rw-p 00000000 00:00 0                          [stack]

7fff519b1000-7fff519b2000 r-xp 00000000 00:00 0                          [vdso]

ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

Abort 


Aaron Quinlan

unread,
Dec 18, 2014, 1:00:02 PM12/18/14
to bedtools...@googlegroups.com
To be completely honest, I can’t remember if this was ever resolved and I don’t have an email record beyond what is on Google Groups.

- Aaron





For more options, visit https://groups.google.com/d/optout.

John Gillece

unread,
Dec 18, 2014, 2:02:14 PM12/18/14
to bedtools...@googlegroups.com
As far as I know, it was not resolved as I didn't hear back.


To unsubscribe from this group and all its topics, send an email to bedtools-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

roye rozov

unread,
Dec 18, 2014, 2:02:14 PM12/18/14
to bedtools...@googlegroups.com
Alright, in spite of the crash it looks like enough of the file was processed for my needs.  Thanks for following up.


To unsubscribe from this group and all its topics, send an email to bedtools-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages