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

Invalid index #2

Closed
cgp1024 opened this issue Apr 11, 2014 · 1 comment
Closed

Invalid index #2

cgp1024 opened this issue Apr 11, 2014 · 1 comment
Labels

Comments

@cgp1024
Copy link

cgp1024 commented Apr 11, 2014

Program terminated with signal SIGSEGV, Segmentation fault.
194 entry = entriesByDataHash[stackHash];
(gdb) bt
#0 0xb778225d in ReferenceStack () at StackStorage.c:194
#1 0xb778179d in malloc (size=size@entry=352) at Preload.c:218
#2 0xb75e985c in __fopen_internal (filename=filename@entry=0xb77561a7 "/proc/filesystems", mode=mode@entry=0xb7756018 "r", is32=is32@entry=0) at iofopen.c:73
#3 0xb75ebe5b in _IO_fopen64 (filename=0xb77561a7 "/proc/filesystems", mode=0xb7756018 "r") at iofopen64.c:39
#4 0xb774a9b2 in selinuxfs_exists () from /lib/i386-linux-gnu/libselinux.so.1
#5 0xb77428c3 in ?? () from /lib/i386-linux-gnu/libselinux.so.1
#6 0xb7799d77 in call_init (l=, argc=argc@entry=2, argv=argv@entry=0xbffd84d4, env=env@entry=0xbffd84e0) at dl-init.c:78
#7 0xb7799e64 in call_init (env=0xbffd84e0, argv=0xbffd84d4, argc=2, l=) at dl-init.c:36
#8 _dl_init (main_map=0xb77ac938, argc=2, argv=0xbffd84d4, env=0xbffd84e0) at dl-init.c:126
#9 0xb778c10f in _dl_start_user () from /lib/ld-linux.so.2

(gdb) p stackHash
$1 = 4294919899

in a different run, in HashFn:
result = -2552111681634388
STORAGE_SIZE = 1299721
result % STORAGE_SIZE = -539301
(unsigned long)(result % STORAGE_SIZE) = 4294427995

Looks like, for negative values of result in HashFn, values larger than STORAGE_SIZE are possible when the signed values are cast to unsigned.

@cgp1024 cgp1024 mentioned this issue Apr 11, 2014
@glagolig glagolig added the bug label Apr 11, 2014
@glagolig
Copy link
Owner

Fixed by the change in StackStorage.c

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

No branches or pull requests

2 participants