szpiech / selscan

Haplotype based scans for selection
GNU General Public License v3.0
111 stars 33 forks source link

*** buffer overflow detected ***: ./selscan terminated #2

Closed szpiech closed 10 years ago

szpiech commented 10 years ago

I am currently investigating a bug in the Linux version that results in a buffer overflow error. It is currently unknown what conditions cause it.

*** buffer overflow detected ***: ./selscan terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7ff0e0b98f47]
/lib/x86_64-linux-gnu/libc.so.6(+0x109e40)[0x7ff0e0b97e40]
/lib/x86_64-linux-gnu/libc.so.6(+0x1092a9)[0x7ff0e0b972a9]
/lib/x86_64-linux-gnu/libc.so.6(_IO_default_xsputn+0xdd)[0x7ff0e0b0a13d]
/lib/x86_64-linux-gnu/libc.so.6(_IO_vfprintf+0x1d42)[0x7ff0e0ad8702]
/lib/x86_64-linux-gnu/libc.so.6(__vsprintf_chk+0x94)[0x7ff0e0b97344]
/lib/x86_64-linux-gnu/libc.so.6(__sprintf_chk+0x7d)[0x7ff0e0b9728d]
./selscan[0x406606]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x7e9a)[0x7ff0e0e55e9a]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7ff0e0b823fd]
======= Memory map: ========
00400000-00423000 r-xp 00000000 08:01 55393                              /home/szpiech/code/selscan/src/selscan
00622000-00623000 r--p 00022000 08:01 55393                              /home/szpiech/code/selscan/src/selscan
00623000-00624000 rw-p 00023000 08:01 55393                              /home/szpiech/code/selscan/src/selscan
013f3000-01529000 rw-p 00000000 00:00 0                                  [heap]
7ff0dc000000-7ff0dc021000 rw-p 00000000 00:00 0 
7ff0dc021000-7ff0e0000000 ---p 00000000 00:00 0 
7ff0e028d000-7ff0e028e000 ---p 00000000 00:00 0 
7ff0e028e000-7ff0e0a8e000 rw-p 00000000 00:00 0                          [stack:2282]
7ff0e0a8e000-7ff0e0c43000 r-xp 00000000 08:01 13133                      /lib/x86_64-linux-gnu/libc-2.15.so
7ff0e0c43000-7ff0e0e43000 ---p 001b5000 08:01 13133                      /lib/x86_64-linux-gnu/libc-2.15.so
7ff0e0e43000-7ff0e0e47000 r--p 001b5000 08:01 13133                      /lib/x86_64-linux-gnu/libc-2.15.so
7ff0e0e47000-7ff0e0e49000 rw-p 001b9000 08:01 13133                      /lib/x86_64-linux-gnu/libc-2.15.so
7ff0e0e49000-7ff0e0e4e000 rw-p 00000000 00:00 0 
7ff0e0e4e000-7ff0e0e66000 r-xp 00000000 08:01 13151                      /lib/x86_64-linux-gnu/libpthread-2.15.so
7ff0e0e66000-7ff0e1065000 ---p 00018000 08:01 13151                      /lib/x86_64-linux-gnu/libpthread-2.15.so
7ff0e1065000-7ff0e1066000 r--p 00017000 08:01 13151                      /lib/x86_64-linux-gnu/libpthread-2.15.so
7ff0e1066000-7ff0e1067000 rw-p 00018000 08:01 13151                      /lib/x86_64-linux-gnu/libpthread-2.15.so
7ff0e1067000-7ff0e106b000 rw-p 00000000 00:00 0 
7ff0e106b000-7ff0e1080000 r-xp 00000000 08:01 5873                       /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff0e1080000-7ff0e127f000 ---p 00015000 08:01 5873                       /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff0e127f000-7ff0e1280000 r--p 00014000 08:01 5873                       /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff0e1280000-7ff0e1281000 rw-p 00015000 08:01 5873                       /lib/x86_64-linux-gnu/libgcc_s.so.1
7ff0e1281000-7ff0e137c000 r-xp 00000000 08:01 13153                      /lib/x86_64-linux-gnu/libm-2.15.so
7ff0e137c000-7ff0e157b000 ---p 000fb000 08:01 13153                      /lib/x86_64-linux-gnu/libm-2.15.so
7ff0e157b000-7ff0e157c000 r--p 000fa000 08:01 13153                      /lib/x86_64-linux-gnu/libm-2.15.so
7ff0e157c000-7ff0e157d000 rw-p 000fb000 08:01 13153                      /lib/x86_64-linux-gnu/libm-2.15.so
7ff0e157d000-7ff0e165f000 r-xp 00000000 08:01 144528                     /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7ff0e165f000-7ff0e185e000 ---p 000e2000 08:01 144528                     /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7ff0e185e000-7ff0e1866000 r--p 000e1000 08:01 144528                     /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7ff0e1866000-7ff0e1868000 rw-p 000e9000 08:01 144528                     /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
7ff0e1868000-7ff0e187d000 rw-p 00000000 00:00 0 
7ff0e187d000-7ff0e189f000 r-xp 00000000 08:01 13154                      /lib/x86_64-linux-gnu/ld-2.15.so
7ff0e1a88000-7ff0e1a8d000 rw-p 00000000 00:00 0 
7ff0e1a9c000-7ff0e1a9f000 rw-p 00000000 00:00 0 
7ff0e1a9f000-7ff0e1aa0000 r--p 00022000 08:01 13154                      /lib/x86_64-linux-gnu/ld-2.15.so
7ff0e1aa0000-7ff0e1aa2000 rw-p 00023000 08:01 13154                      /lib/x86_64-linux-gnu/ld-2.15.so
7fffad9a3000-7fffad9c4000 rw-p 00000000 00:00 0                          [stack]
7fffad9d1000-7fffad9d2000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted (core dumped)
szpiech commented 10 years ago

The likely cause of this bug is a data file with an allele > 1 character long. I am working on a fix to check this condition, but selscan currently only accepts 1/0 input. Missing data will need to be imputed or removed.

szpiech commented 10 years ago

Fixed in 1.0.1