Skip to content

Fix ecma-property construction #251

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

Merged
merged 1 commit into from
Jul 1, 2015
Merged

Conversation

ruben-ayrapetyan
Copy link
Contributor

Perform operations that could invoke GC before linking property into an object's property list to avoid start of GC in the middle of property construction.

@ruben-ayrapetyan ruben-ayrapetyan added bug Undesired behaviour normal ecma core Related to core ECMA functionality labels Jun 28, 2015
@ruben-ayrapetyan ruben-ayrapetyan added this to the Core ECMA features milestone Jun 28, 2015
@ruben-ayrapetyan ruben-ayrapetyan force-pushed the Ruben-fix-property-construction branch from 1384496 to c2a59df Compare June 28, 2015 19:50
@egavrin
Copy link
Contributor

egavrin commented Jun 28, 2015

Good to me

@ruben-ayrapetyan ruben-ayrapetyan assigned galpeter and unassigned egavrin Jun 28, 2015
@zherczeg
Copy link
Member

Would it be possible to add a test case? It could help me to understand the issue.

@galpeter galpeter assigned zherczeg and unassigned galpeter Jun 29, 2015
@ruben-ayrapetyan
Copy link
Contributor Author

Would it be possible to add a test case? It could help me to understand the issue.

Issue is caused by performing allocation request that leads to GC while heap is in inconsistent state.

Actually, appearance of the issue depends on dynamic conditions, specifically on whether GC would be started upon a next allocation request. So, external test seems to be not suitable for the case.

So, I think it is better to add 'no-GC' sections and check that no allocation request can be ever performed in the sections, by adding corresponding assertion to mem_pools_alloc and mem_heap_alloc_block.

'no-GC' sections could be added in the pull request, but I prefer to investigate possible cases more deeply before introducing them. I'll raise an issue about this.

@zherczeg
Copy link
Member

zherczeg commented Jul 1, 2015

Other engines have "do GC before each malloc" modes. We should add something similar to Jerry to find such errors.

@zherczeg
Copy link
Member

zherczeg commented Jul 1, 2015

lgtm

…GC before linking property into an object's property list to avoid start of GC in the middle of property construction.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
@egavrin egavrin force-pushed the Ruben-fix-property-construction branch from c2a59df to 438d2c2 Compare July 1, 2015 11:24
@egavrin egavrin merged commit 438d2c2 into master Jul 1, 2015
@egavrin egavrin deleted the Ruben-fix-property-construction branch July 1, 2015 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Undesired behaviour ecma core Related to core ECMA functionality normal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants