Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffindex_modify segfaults during tests #7

Open
tillea opened this issue Dec 19, 2018 · 3 comments
Open

ffindex_modify segfaults during tests #7

tillea opened this issue Dec 19, 2018 · 3 comments

Comments

@tillea
Copy link

tillea commented Dec 19, 2018

Hi,
I just learned in Issue 4 that I might have grabbed the wrong codebase for Debian when I pointed it to this Git repository. However, you might be interested to know that ffindex_modify segfaults in our test suite which you can see in the Debian bug report.
Hope this helps, Andreas.

@tillea
Copy link
Author

tillea commented Jan 9, 2019

Hi,
I have tracked down the issue in a gdb session:

ffindex_build -s ./test.data ./test.ffindex test/data test/data2
ffindex_get  ./test.data ./test.ffindex a b foo | tee ./test.out
a
bb
fooo
fooo
gdb --args ffindex_modify -u ./test.ffindex b
GNU gdb (Debian 8.2-1) 8.2
...
(gdb) break src/ffindex.c:553
Breakpoint 1 (src/ffindex.c:553) pending.
(gdb) run
Starting program: ffindex_modify -u ./test.ffindex b

Breakpoint 1, action (node=0x555555559801, which=postorder, depth=1, misc=0x555555559260) at /build/ffindex-0.9.9.7.soedinglab+git20171201.74550c8/src/ffindex.c:553
553                 entry = *(ffindex_entry_t **) node;
(gdb) print entry
$1 = (ffindex_entry_t *) 0x7
(gdb) print entry->offset
Cannot access memory at address 0x7
(gdb) next
554                 if(fprintf(index_file, "%s\t%zd\t%zd\n", entry->name, entry->offset, entry->length) < 0)
(gdb) next

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7f7bc6d in action (node=0x555555559801, which=postorder, depth=1, misc=0x555555559260) at /build/ffindex-0.9.9.7.soedinglab+git20171201.74550c8/src/ffindex.c:554
554                 if(fprintf(index_file, "%s\t%zd\t%zd\n", entry->name, entry->offset, entry->length) < 0)

So the SIGSEGV occures in the attempt to access any member of the struct entry (I have some more detailed debugging code which proves this statement). Another thing to consider is that this SIGSEGV occures only for gcc 8.2. When using Debian stable featuring gcc 6.3 the problem does not occure and the test runs fine.
Hope this helps.

@tillea
Copy link
Author

tillea commented Jan 10, 2019

Hi again,
there is now more input in the Debian bug log with analysis using AdressSanitizer and valgrind. Hope this helps.

@ahcm
Copy link

ahcm commented Jan 11, 2019

I added the compatibility changes to ffindex and made a new release:
https://github.com/ahcm/ffindex/releases/tag/0.9.9.8

I also forked the hh-suite code and only changed the ffindex submodule that is used:
https://github.com/ahcm/hh-suite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants