Closed Bug 804897 Opened 8 years ago Closed 8 years ago

SourceCompressor should use updateMallocCounter with compartment

Categories

(Core :: JavaScript Engine, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 804857

People

(Reporter: ginnchen+exoracle, Assigned: ginnchen+exoracle)

References

Details

Attachments

(1 file)

data.compressed is using cx->malloc_(nbytes), which updateMallocCounter to compartment.

On compression complete, it calls
saveTok->cx->runtime->updateMallocCounter(NULL, delta);

Because of the NULL ptr, it adds counts to outside compartment.
After several compressions, the count outside compartment overflows, onTooMuchMalloc() is called and triggers GC.
Attached patch patchSplinter Review
Assignee: general → ginn.chen
Status: NEW → ASSIGNED
Attachment #674582 - Flags: review?(n.nethercote)
Comment on attachment 674582 [details] [diff] [review]
patch

Review of attachment 674582 [details] [diff] [review]:
-----------------------------------------------------------------

Seems ok to me, but I'm going to wimp out this one-line review and ask billm to do it, because he understands this stuff better than I do.
Attachment #674582 - Flags: review?(n.nethercote) → review?(wmccloskey)
I should note the patches to bug 804857 will "fix" this by allocating everything on the runtime.
Confirmed this problem will be gone with the patches of bug 804857.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Attachment #674582 - Flags: review?(wmccloskey)
Resolution: FIXED → DUPLICATE
Duplicate of bug: 804857
(In reply to Bill McCloskey (:billm) from comment #6)
> Isn't this still a problem?

The problem of overflow and trigger GC is gone.

If you think the malloc should be count on compartment, this bug should be reopened.
You need to log in before you can comment on or make changes to this bug.