- Notifications
You must be signed in to change notification settings - Fork687
Fixed the issue where gc was triggered during the attribute search pr…#5242
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ocess and a hashmap was recreated.JerryScript-DCO-1.0-Signed-off-by: tangbin 2387440390@qq.com
zherczeg commentedJul 22, 2025
Could you give a bit more information? What triggers a property change during gc? Is there a better way to avoid it? |
happy-boy-maker commentedJul 23, 2025
zherczeg commentedJul 23, 2025
It seems the problem is entering the hashmap creation. GC normally just check all properties, and does not search anything. It looks like it is a weak map specific thing. The problem should be stopped there. |
happy-boy-maker commentedJul 23, 2025
zherczeg commentedJul 23, 2025
I suspect unref weak is only used by gc, since deleting from weakset is not possible. We need to avoid the allocation there in some way. |


This patchfixes#5084
During the property search process, a gc was triggered. During the gc process, ecma_property_hashmap_create (obj_p) was triggered again on the original object, which led to the final problem. In my personal understanding, the properties of the object should not be modified during the gc process. So, problems can be avoided by adding variables to the context to monitor the status of the gc.
JerryScript-DCO-1.0-Signed-off-by: tangbin2387440390@qq.com