Skip to content

Conversation

@meg-gupta
Copy link
Contributor

When we hit an exception and we have a try finally within a try catch. We will execute finally code by calling BailOnException.
Since we inline into functions with try now, we will end up in inconsistent inlinee callinfo when we call the bailout code from finally.
So add the walker and clear inlinee callinfo.

Also move tryCatchAddr ctor inside a scope, so that it executes before user catch code.

Fixes OS#14336922

@meg-gupta
Copy link
Contributor Author

Reopened against release/1.8. Addressed review comment

@meg-gupta meg-gupta requested review from LouisLaf and rajatd December 20, 2017 19:52
@rajatd
Copy link
Contributor

rajatd commented Dec 20, 2017

How did you address @LouisLaf 's concerns from the previous PR?

@meg-gupta
Copy link
Contributor Author

#4051 (comment) was regarding the use of the isInlineeCleared Boolean that I used to avoid do the stack walk and clear when there is a try catch/try finally nesting. The suggestion was to use a stack to restore previous state correctly. My 2nd commit in the PR addresses this.

I had added isInlineeCleared bit to mark when we have cleared inlinee frames's callinfo count on an exception within a try finally enclosed in some try catch.
I later checked this bit in the enclosing OP_TryCatch to make sure we don't walk the stack to clear info again.
This was unnecessary, because if there was an expection within try finally, then we will bailout and never exercise the code in OP_TryCatch

Copy link
Contributor

@rajatd rajatd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@meg-gupta meg-gupta force-pushed the swandclearinlineinfo branch 3 times, most recently from 89db484 to a42c710 Compare January 3, 2018 21:55
@meg-gupta meg-gupta force-pushed the swandclearinlineinfo branch 3 times, most recently from 3890234 to 18ea70c Compare January 16, 2018 18:46
@meg-gupta
Copy link
Contributor Author

@dotnet-bot test OSX static_osx_osx_debug

meg-gupta added 2 commits January 16, 2018 13:21
When we hit an exception and we have a try finally within a try catch. We will execute finally code by calling BailOnException.
Since we inline into functions with try now, we will end up in inconsistent inlinee callinfo when we call the bailout code from finally.
So add the walker and clear inlinee callinfo.

Remove isInlineeCleared bit

I had added isInlineeCleared bit to mark when we have cleared inlinee frames's callinfo count on an exception within a try finally enclosed in some try catch.
I later checked this bit in the enclosing OP_TryCatch to make sure we don't walk the stack to clear info again.

This is not needed, because if there was an expection within try finally, then we will bailout and never exercise the code in OP_TryCatch
When a stackoverflow happens within a try finally enclosed inside try catch, we have to do a stackwalk till we find the try catch frame, this means walking all the frames that caused the stackoverflow.
This test takes longer than the default timeout value on xplat. Moving it to slow test.
@meg-gupta meg-gupta force-pushed the swandclearinlineinfo branch from 18ea70c to a29fd05 Compare January 16, 2018 21:22
@chakrabot chakrabot merged commit a29fd05 into chakra-core:release/1.8 Jan 16, 2018
chakrabot pushed a commit that referenced this pull request Jan 16, 2018
…TryFinally as well

Merge pull request #4449 from meg-gupta:swandclearinlineinfo

When we hit an exception and we have a try finally within a try catch. We will execute finally code by calling BailOnException.
Since we inline into functions with try now, we will end up in inconsistent inlinee callinfo when we call the bailout code from finally.
So add the walker and clear inlinee callinfo.

Also move tryCatchAddr ctor inside a scope, so that it executes before user catch code.

Fixes OS#14336922
chakrabot pushed a commit that referenced this pull request Jan 17, 2018
…tch of OP_TryFinally as well

Merge pull request #4449 from meg-gupta:swandclearinlineinfo

When we hit an exception and we have a try finally within a try catch. We will execute finally code by calling BailOnException.
Since we inline into functions with try now, we will end up in inconsistent inlinee callinfo when we call the bailout code from finally.
So add the walker and clear inlinee callinfo.

Also move tryCatchAddr ctor inside a scope, so that it executes before user catch code.

Fixes OS#14336922
chakrabot pushed a commit that referenced this pull request Jan 17, 2018
…o from the catch of OP_TryFinally as well

Merge pull request #4449 from meg-gupta:swandclearinlineinfo

When we hit an exception and we have a try finally within a try catch. We will execute finally code by calling BailOnException.
Since we inline into functions with try now, we will end up in inconsistent inlinee callinfo when we call the bailout code from finally.
So add the walker and clear inlinee callinfo.

Also move tryCatchAddr ctor inside a scope, so that it executes before user catch code.

Fixes OS#14336922
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

Successfully merging this pull request may close these issues.

3 participants