cgsecurity / testdisk

TestDisk & PhotoRec
https://www.cgsecurity.org/
GNU General Public License v2.0
1.58k stars 195 forks source link

testdisk crashes with a segmentation fault with newer ncurses #46

Closed HJarausch closed 6 years ago

HJarausch commented 6 years ago

Several version of testdisk (include the GIT version) die :grinning:

Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7982cf5 in termattrs_sp () from /lib64/libncursesw.so.6 (gdb) where

0 0x00007ffff7982cf5 in termattrs_sp () from /lib64/libncursesw.so.6

1 0x00007ffff797ffe8 in _nc_setupscreen_sp () from /lib64/libncursesw.so.6

2 0x00007ffff797b56f in newterm_sp () from /lib64/libncursesw.so.6

3 0x00007ffff797ba58 in newterm () from /lib64/libncursesw.so.6

4 0x000055555558b5d9 in get_newterm_aux ()

5 0x000055555558da35 in start_ncurses ()

6 0x000055555555b30b in main ()

I have ncurses-6.1 installed here (Gentoo Linux)

cgsecurity commented 6 years ago

"Announcing ncurses 6.1" at https://www.gnu.org/software/ncurses/ says nothing about a binary interface change... What warnings do you get when src/intrfn.c is compiled ? Can you try another ncurses program and check if it crashes or not ?

themaxi commented 6 years ago

Have same issue on Gentoo: testdisk TestDisk 7.1-WIP, Data Recovery Utility, March 2018 Christophe GRENIER grenier@cgsecurity.org https://www.cgsecurity.org Ошибка сегментирования

(gdb) run Starting program: /usr/bin/testdisk [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". TestDisk 7.1-WIP, Data Recovery Utility, March 2018 Christophe GRENIER grenier@cgsecurity.org https://www.cgsecurity.org

Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7bbd658 in _nc_setupscreen_sp () from /lib64/libncursesw.so.6

cgsecurity commented 6 years ago

No problem with ncurses 6.1 under Fedora 28 (ncurses-6.1-4.20180224.fc28.x86_64). The problem may be Gentoo specific.

themaxi commented 6 years ago

Just fixed it. Installed sys-libs/ncurses with USE-flags "-tinfo".

Jamim commented 6 years ago

@themaxi: Just fixed it. Installed sys-libs/ncurses with USE-flags "-tinfo".

Thank you, @themaxi! Your comment was really helpful and saved me a lot of time!

blshkv commented 5 years ago

Gentoo suggested a patch: https://bugs.gentoo.org/654866

Please review and merge it

cgsecurity commented 5 years ago

Thanks. I have commit this patch and modified it a little bit as it introduced a regression on CentOS 6. https://github.com/cgsecurity/testdisk/commit/f15cffae936c5643a8fe502a2170d0d2aab0fb5f https://github.com/cgsecurity/testdisk/commit/6837474129968d7de13d91e5454bd824c9136e73