Open
Bug 1478749
Opened 8 years ago
Updated 2 years ago
JS::ubi::Concrete<nsINode> edge names allocated via NS_strdup should not be freed with JS_free
Categories
(Core :: JavaScript Engine, enhancement, P3)
Core
JavaScript Engine
Tracking
()
NEW
People
(Reporter: KrisWright, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
2.27 KB,
patch
|
Details | Diff | Splinter Review |
JS::ubi::Concrete<nsINode> is a UbiNode memory reporting specialization for DOM structure, which measures the size of its associated nsINode pointer and yields outgoing edges to its parent children. For the time being, all of the edge names allocated in JS::ubi::Concrete<nsINode>::edges are allocated via NS_strdup[1] and then freed using JS_free. While this works for the time being, it could pose a problem in the future. We want to expose a function from JS (such as js::DuplicateString[2]) that enables us to allocate these edge names in JS.
1. See Bug 1474383
2. https://searchfox.org/mozilla-central/rev/943a6cf31a96eb439db8f241ab4df25c14003bb8/js/src/util/Text.cpp#95
Updated•8 years ago
|
Priority: -- → P3
Comment 1•8 years ago
|
||
Kristen, are you interested in patching this? We'd take a patch for it. Ping me on IRC if you'd like to look into it.
| Reporter | ||
Comment 2•8 years ago
|
||
Added js::ubi::CreateEdgeName(const char16_t*, char16_t*) to expose js::DuplicateString to JS::ubi::Concrete<nsINode>::edges
| Reporter | ||
Updated•8 years ago
|
Assignee: nobody → kwright
Status: NEW → ASSIGNED
| Reporter | ||
Comment 3•8 years ago
|
||
Comment on attachment 9025398 [details] [diff] [review]
Exposes js::DuplicateString to NodeUbiReporting.cpp through the UbiNode namespace
Jim, would you mind doing a review for this?
Attachment #9025398 -
Flags: review?(jimb)
Updated•4 years ago
|
Severity: normal → S3
Comment 4•2 years ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Assignee: kwright → nobody
Status: ASSIGNED → NEW
You need to log in
before you can comment on or make changes to this bug.
Description
•