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

Segfault in get_enum_basic_type #364

Open
clesmian opened this issue Aug 8, 2023 · 1 comment
Open

Segfault in get_enum_basic_type #364

clesmian opened this issue Aug 8, 2023 · 1 comment

Comments

@clesmian
Copy link

clesmian commented Aug 8, 2023

When executing c2m on poc.txt, a segfault occurs

POC

struct{
        long f0:f0;
        int;
};

ASAN Output

AddressSanitizer:DEADLYSIGNAL
=================================================================
==2244418==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x561ae261f12c bp 0x6040000136e4 sp 0x7fa6437fa390 T1)
==2244418==The signal is caused by a READ memory access.
==2244418==Hint: address points to the zero page.
    #0 0x561ae261f12b in get_enum_basic_type c2mir/c2mir.c:5760
    #1 0x561ae261f12b in set_type_layout c2mir/c2mir.c:6071
    #2 0x561ae26af374 in check c2mir/c2mir.c:9674
    #3 0x561ae26b8fa0 in check c2mir/c2mir.c:9215
    #4 0x561ae26b1b1f in check c2mir/c2mir.c:8286
    #5 0x561ae26cbead in check_decl_spec c2mir/c2mir.c:6645
    #6 0x561ae26ae527 in check c2mir/c2mir.c:9156
    #7 0x561ae26b1b1f in check c2mir/c2mir.c:8286
    #8 0x561ae26b1099 in check c2mir/c2mir.c:9431
    #9 0x561ae26f4314 in do_context c2mir/c2mir.c:9697
    #10 0x561ae26f4314 in c2mir_compile c2mir/c2mir.c:13481
    #11 0x561ae26f7d6a in compile c2mir/c2mir-driver.c:498
    #12 0x7fa646e68608 in start_thread /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477
    #13 0x7fa646d8d132 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x11f132)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV c2mir/c2mir.c:5760 in get_enum_basic_type
Thread T1 created by T0 here:
    #0 0x7fa647012815 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cc:208
    #1 0x561ae260c6f8 in init_compilers c2mir/c2mir-driver.c:540
    #2 0x561ae260c6f8 in main c2mir/c2mir-driver.c:656

==2244418==ABORTING

Found while fuzzing d51b45f, verified with cf3c9c1

@vnmakarov
Copy link
Owner

I fixed this one by 666a9fd

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