Skip to content

Conversation

dilijev
Copy link
Contributor

@dilijev dilijev commented Jul 30, 2016

Reviewed by @Yongqu

@dilijev
Copy link
Contributor Author

dilijev commented Jul 30, 2016

@Yongqu review please?

@@ -375,7 +375,7 @@ namespace Js

ScriptContext::~ScriptContext()
{
Assert(isFinalized || !isInitialized);
Assert(isFinalized);
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't revert. We can get rid of the whole assert.
I was afraid we might miss some scenario where we would delete scriptContext is wrong time. I think we cover all three now and the assert can be removed:
. finalize time when the scriptcontext is held by library
. half way during initialization of scriptcontext when we OOM; in both browser & JSRT scenario
. JSRT only, fail half way during JSRTContext initialization, but after scriptcontext is fully created.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Logically isFinalized || !isInitialized seems like a reasonable assert though. Maybe we should fix the state of those flags along error paths so that we could keep the assert and ensure that we've really handled all of the cases...

Copy link
Contributor

Choose a reason for hiding this comment

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

then we need another state to know that we are half way in JsrtContext initialization code path...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I see. Maybe it's not worth doing that bookkeeping? In which case, deleting this assert seems like the right thing to do I guess.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah I think we should remove the assert at this time.

@dilijev dilijev changed the title BUG 8258993: Revert change to Assert that is causing a lot of hits on failure path. BUG 8258993: Remove Assert that is causing many hits on the OOM path because of inconsistent finalization flags state. Aug 6, 2016
@Yongqu
Copy link
Contributor

Yongqu commented Aug 6, 2016

LGTM

…because of inconsistent finalization flags state.

Reviewed by @Yongqu
@dilijev
Copy link
Contributor Author

dilijev commented Aug 8, 2016

@dotnet-bot test Windows x64_release please

@chakrabot chakrabot merged commit 84f4f75 into chakra-core:master Aug 8, 2016
chakrabot pushed a commit that referenced this pull request Aug 8, 2016
…y hits on the OOM path because of inconsistent finalization flags state.

Merge pull request #1362 from dilijev:finalized

Reviewed by @Yongqu
@dilijev dilijev deleted the finalized branch August 8, 2016 22:58
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.

4 participants