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

Catch doesn't handle sigsegv caused by stack overflow properly #752

Closed
horenmar opened this Issue Nov 26, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@horenmar
Copy link
Member

horenmar commented Nov 26, 2016

Currently, Catch attempts to handle signals by writing out failed test case and attempting orderly shutdown of the binary. However, if it tries to handle sigsegv caused by stack overflow, it fails as there is no space left on the stack to handle the signal.

This can be fixed using sigaltstack and preallocating an alternative stack to use with signal handlers (PR coming soon).

Note that I think the current signal handling in Catch is incorrect in general, as it access shared state in unknown state without any attempt to minimize such accesses and then proceeds to attempt orderly shutdown of binary in completely unknown state (I am currently trying to add Windows SEH handling and this is causing me quite a lot of pain), but that would take longer to rework properly.

@horenmar

This comment has been minimized.

Copy link
Member

horenmar commented Nov 29, 2016

The stack overflow part of this is fixed in PR #753

@philsquared

This comment has been minimized.

Copy link
Collaborator

philsquared commented Nov 29, 2016

Thanks - I'll try and get to these later in the week.

@horenmar

This comment has been minimized.

Copy link
Member

horenmar commented Dec 16, 2016

I added Windows exception handling using the current code paths in PR #764.

The same caveat emptor still applies: Trying orderly shutdown on binary that generated a general signal might break horribly and there are no guarantees.

@horenmar

This comment has been minimized.

Copy link
Member

horenmar commented Jan 14, 2017

This is resolved in dev-signals branch.

@horenmar horenmar closed this Jan 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment