Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Fix preventing memory allocation in signal handler#16485

Merged
janvorli merged 1 commit into
dotnet:masterfrom
janvorli:fix-preventing-allocation-in-signal-handlers
Feb 23, 2018
Merged

Fix preventing memory allocation in signal handler#16485
janvorli merged 1 commit into
dotnet:masterfrom
janvorli:fix-preventing-allocation-in-signal-handlers

Conversation

@janvorli
Copy link
Copy Markdown
Member

There was a subtle bug. When the hardware exception handler returns back
to the signal handler, the exception's CONTEXT record may contain
modified registers and so the changes need to be propagated back to the
signal context. But the recent change #16384 was restoring the signal
context from the originally grabbed context instead of the one that's
pointed to by the exception, which is different.

I have also added a little optimization - the contextRecord that was
added is not needed, since the signalContextRecord can be used as the
initial context record for the exception. So we can save the
contextRecord and also copying to the signalContextRecord from it.

@janvorli janvorli added this to the 2.1.0 milestone Feb 22, 2018
@janvorli janvorli self-assigned this Feb 22, 2018
@janvorli
Copy link
Copy Markdown
Member Author

@dotnet-bot test Ubuntu x64 Checked gcstress0xc

@janvorli janvorli force-pushed the fix-preventing-allocation-in-signal-handlers branch from 0ee2850 to 95349b6 Compare February 22, 2018 01:18
There was a subtle bug. When the hardware exception handler returns back
to the signal handler, the exception's CONTEXT record may contain
modified registers and so the changes need to be propagated back to the
signal context. But the recent change dotnet#16384 was restoring the signal
context from the originally grabbed context instead of the one that's
pointed to by the exception, which is different.

I have also added a little optimization - the contextRecord that was
added is not needed, since the signalContextRecord can be used as the
initial context record for the exception. So we can save the
contextRecord and also copying to the signalContextRecord from it.
@janvorli janvorli force-pushed the fix-preventing-allocation-in-signal-handlers branch from 95349b6 to b19bf60 Compare February 22, 2018 01:26
@janvorli
Copy link
Copy Markdown
Member Author

@dotnet-bot test Ubuntu x64 Checked gcstress0xc

@janvorli
Copy link
Copy Markdown
Member Author

@dotnet-bot test Tizen armel Cross Checked Innerloop Build and Test

@janvorli
Copy link
Copy Markdown
Member Author

@dotnet-bot test Windows_NT arm Cross Checked Innerloop Build and Test

@janvorli janvorli requested a review from jkotas February 23, 2018 00:22
@janvorli janvorli merged commit 1270aa5 into dotnet:master Feb 23, 2018
@janvorli janvorli deleted the fix-preventing-allocation-in-signal-handlers branch February 23, 2018 09:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants