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

Make glibc stdio streams in main binary shared #450

Open
ayrtonm opened this issue Oct 17, 2024 · 0 comments
Open

Make glibc stdio streams in main binary shared #450

ayrtonm opened this issue Oct 17, 2024 · 0 comments

Comments

@ayrtonm
Copy link
Contributor

ayrtonm commented Oct 17, 2024

When building tests that use the signal handler for CHECK_VIOLATION we call setbuf(stdout, NULL) to be able to make sense of printf output more easily when the signal handler is invoked. The problem is that the stdio streams defined by glibc show up in the main binary's .bss so this triggers a segfault when any other compartment tries to flush them (e.g. CI failures in #448).

$ nm tests/minimal/minimal | rg @GLIBC
...
0000000000083020 B stderr@GLIBC_2.2.5
0000000000083000 B stdout@GLIBC_2.2.5
                 U strchr@GLIBC_2.2.5
...

All other versioned glibc symbols show up undefined like strchr and nothing seems out of the ordinary in the stream definitions in glibc. I think the fix will be to move the streams to from the main binary's .bss to its .ia2_shared_data but I'm not sure how to best do that given that I'm missing something about how versioned symbols work.

ayrtonm added a commit that referenced this issue Oct 17, 2024
ayrtonm added a commit that referenced this issue Oct 17, 2024
ayrtonm added a commit that referenced this issue Oct 22, 2024
ayrtonm added a commit that referenced this issue Oct 22, 2024
ayrtonm added a commit that referenced this issue Oct 22, 2024
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

1 participant