Skip to content
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

Foxhound: fixing memory leaks and crashes #208

Merged
merged 1 commit into from
Mar 15, 2024
Merged

Conversation

tmbrbr
Copy link
Contributor

@tmbrbr tmbrbr commented Mar 15, 2024

The fix to clean up all the StringTaint from Nursery strings wasn't quite thorough enough and left some dangling pointers lying around. This fix makes sure we catch all the Nursery allocated Strings by moving String registration to Allocator-inl.h

This fix revealed the root cause of the segmentation faults which were occuring on client-heavy webapps (UI5 I'm looking at you). There were a couple of occasions where strings were being created (but not rooted) and then additional strings constructed for TaintOperation arguments (e.g. JSONParser.cpp and RegExp.cpp). As the TaintOperations were trying to allocate memory, this could cause a GC which would clean up the original strings.

This fix makes sure that the TaintOperations are created before the new Strings or that they are properly rooted.

The fix to clean up all the StringTaint from Nursery strings
wasn't quite thorough enough and left some dangling pointers
lying around. This fix makes sure we catch all the Nursery
allocated Strings by moving String registration to Allocator-inl.h

This fix revealed the root cause of the segmentation faults which
were occuring on client-heavy webapps (UI5 I'm looking at you).
There were a couple of occasions where strings were being created
(but not rooted) and then additional strings constructed for
TaintOperation arguments (e.g. JSONParser.cpp and RegExp.cpp).
As the TaintOperations were trying to allocate memory, this
could cause a GC which would clean up the original strings.

This fix makes sure that the TaintOperations are created before
the new Strings or that they are properly rooted.
@tmbrbr tmbrbr added bug Something isn't working javascript Pull requests that update Javascript code labels Mar 15, 2024
@tmbrbr tmbrbr requested review from leeN and vladidx March 15, 2024 13:16
@tmbrbr tmbrbr self-assigned this Mar 15, 2024
Copy link
Collaborator

@leeN leeN left a comment

Choose a reason for hiding this comment

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

Looks good to me :)

@tmbrbr tmbrbr merged commit b4da372 into SAP:main Mar 15, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants