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

ASAN deadly signal #111

Open
tekknolagi opened this issue Feb 7, 2025 · 4 comments
Open

ASAN deadly signal #111

tekknolagi opened this issue Feb 7, 2025 · 4 comments

Comments

@tekknolagi
Copy link

tekknolagi commented Feb 7, 2025

Hi,

When I try to build on GitHub Actions, the project works fine. It can compile the C output of my compiler! Very cool.

When I try to build and bootstrap locally, I run into ASAN issues:

AddressSanitizer:DEADLYSIGNAL
AddressSanitizer:DEADLYSIGNAL
AddressSanitizer:DEADLYSIGNAL
AddressSanitizer:DEADLYSIGNAL
AddressSanitizer:DEADLYSIGNAL
...

I tried to attach with GDB but ran into apparent signal handler recursion issues.

@fuhsnn
Copy link
Owner

fuhsnn commented Feb 8, 2025

Can you share a bit more about your setup (distro and version) and what code triggers that? I'll try to reproduce it.

ASAN shouldn't be required for normal usage, though, that was me being lazy with makefile. Please make do with cc *.c or remove the -fsanitize in makefile before I fix that (want to take the chance to rewrite it for pdpmake compatibility.)

@tekknolagi
Copy link
Author

hickory% uname -r
6.8.0-51-generic
hickory% lsb_release -irc
Distributor ID: Ubuntu
Release:        22.04
Codename:       jammy
hickory% cc --version
cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

Same under Clang though. I'm just running make test-stage2

@tekknolagi
Copy link
Author

Oh actually now I get segfaults under Clang:

make: *** [GNUmakefile:41: stage2/main.o] Segmentation fault (core dumped)
make: *** Waiting for unfinished jobs....
make: *** [GNUmakefile:41: stage2/type.o] Segmentation fault (core dumped)
make: *** [GNUmakefile:41: stage2/codegen.o] Segmentation fault (core dumped)
make: *** [GNUmakefile:41: stage2/alloc.o] Error 1
make: *** [GNUmakefile:41: stage2/preprocess.o] Error 1
make: *** [GNUmakefile:41: stage2/hashmap.o] Error 1

@fuhsnn
Copy link
Owner

fuhsnn commented Feb 9, 2025

Couldn't reproduce with docker'ed Ubuntu 22.04:

FROM ubuntu:22.04
RUN apt-get update && apt-get install -y --no-install-recommends \
 clang libc-dev make file git ca-certificates

WORKDIR /work/
RUN git clone --depth 1 https://github.com/fuhsnn/slimcc && \
 cd /work/slimcc && \
 make CC=clang test-stage2

Can you try GDB again with the following step?

clang -Wno-switch -g *.c -o slimcc
gdb ./slimcc -ex "set confirm off" -ex "set follow-fork-mode child" -ex "r -c main.c"

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