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

Interpose pthread_create calls #4

Closed
Jake-Shadle opened this issue Mar 15, 2022 · 5 comments · Fixed by #8
Closed

Interpose pthread_create calls #4

Jake-Shadle opened this issue Mar 15, 2022 · 5 comments · Fixed by #8
Labels
enhancement New feature or request

Comments

@Jake-Shadle
Copy link
Member

Firefox does a rather complicated interposition of pthread_create to ensure that the alternate signal stack is always used for every thread, but...I'm not actually 100% sure this is needed.

@Jake-Shadle Jake-Shadle added the enhancement New feature or request label Mar 15, 2022
@gabrielesvelto
Copy link
Contributor

On our side it's needed mainly to catch stack overflows and to guarantee that we can catch other type of crashes even when we're close to the stack limit. Our graphics code has often deep stacks, so even though the code might not overflow the stack directly the exception handler might.

@Jake-Shadle
Copy link
Member Author

Hmm, I suppose my stack overflow tests must be incorrect then since they are catching those cases from main and non-main threads just fine so far, so they must not be complicated enough, or perhaps this is because the alternate stack from the standard library giving a false sense of security.

@gabrielesvelto
Copy link
Contributor

Are you using Rust for the tests? IIRC the Rust runtime adds an alternate signal stack to every thread that's created unless you provide yours.

@gabrielesvelto
Copy link
Contributor

Yeah, it's here.

@Jake-Shadle Jake-Shadle changed the title Investigate if pthread_create interposition is actually needed Intercept pthread_create calls Mar 16, 2022
@Jake-Shadle
Copy link
Member Author

Yes, now that I've directly invoked pthread_create it doesn't work, so fixing now. 🙂

@Jake-Shadle Jake-Shadle changed the title Intercept pthread_create calls Interpose pthread_create calls Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants