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

src/flisp/equalhash.c reading uninitialized data #57369

Open
alexharris1976 opened this issue Feb 12, 2025 · 2 comments
Open

src/flisp/equalhash.c reading uninitialized data #57369

alexharris1976 opened this issue Feb 12, 2025 · 2 comments

Comments

@alexharris1976
Copy link

alexharris1976 commented Feb 12, 2025

This happens with SANITIZE_ADDRESS build of flisp on Aarch64 Linux:

==56350==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0xaaaaaab9ca6c in equalhash_lookup_bp_r /home/alg/julia/src/flisp/equalhash.c:22:1
    #1 0xaaaaaab5dcfc in get_type /home/alg/julia/src/flisp/types.c:11:17
    #2 0xaaaaaab73a0c in cvalues_init /home/alg/julia/src/flisp/cvalues.c:883:5
    #3 0xaaaaaab73a0c in lisp_init /home/alg/julia/src/flisp/flisp.c:2404:5
    #4 0xaaaaaab73a0c in fl_init /home/alg/julia/src/flisp/flisp.c:2433:5
    #5 0xaaaaaaba7198 in main /home/alg/julia/src/flisp/flmain.c:34:5
    #6 0xfffff7cd2290 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #7 0xfffff7cd2374 in __libc_start_main csu/../csu/libc-start.c:360:3
    #8 0xaaaaaaab73ac in _start (/home/alg/julia/src/flisp/flisp+0x173ac) (BuildId: b810d08aaa933c974ef7e91bcef250ea18b13445)

equalhash.c is failing with:
   if (tab[index] == ((void *)1)) {

Note that src/support/htable.c htable_new function does not clear memory.

You will probably argue that this likely doesn't matter.

@topolarity
Copy link
Member

Note that src/support/htable.c htable_new function does not clear memory.

It looks to me like it does:

for (i = 0; i < size; i++)
h->table[i] = HT_NOTFOUND;

@vtjnash
Copy link
Member

vtjnash commented Feb 12, 2025

I do seem to see many memory bugs like that in relocate_htable, but I don't see that being used in this code path. Maybe there is a aarch64-specific bug in MSan?

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

3 participants