Closed Bug 753389 Opened 13 years ago Closed 10 months ago

Massive buffer allocated during ecma_5/RegExp/regress-617935.js

Categories

(Core :: JavaScript Engine, defect)

defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: glandium, Unassigned)

Details

(Whiteboard: [js:p2])

During ecma_5/RegExp/regress-617935.js, the following line from ReplaceRegExpCallback triggers a realloc requesting 1GB: if (!rdata.sb.reserve(rdata.sb.length() + growth)) On 32 bits systems, depending on previous activity, it can be hard to find that much available contiguous address space. As a matter of fact, I've had the problem with a 512MB (re)allocation, but that's partly due to a bad behavior from jemalloc 3 on linux. Anyways, this is the kind of thing that explains random oranges such as bug 736591, which was fixed by making the test smaller, but it might still hit OOM, just not as hard as before: I'm only seeing an actual failure on Windows with jemalloc 3, but i do see realloc failures if I turn allocation failures into hard failures with jemalloc 3 on other platforms. I'll check again with our current jemalloc.
Another one from js1_5/extensions/regress-336409-2.js has a realloc requesting 1GB as well with our current jemalloc on linux 32-bits, and leads to bug 722374. It comes from the following line from obj_toSource: if (!buf.append(vchars, vlength))
Do you think it would be a good idea to make these tests smaller again in order to reduce random oranges?
Whiteboard: [js:p2:fx15]
I'm not sure what should be done. What I'm sure, though, is that if I make realloc failure abort, I get failures in these tests with our current jemalloc, not only jemalloc3. Which suggests the reallocs do fail, and that somehow the test still passes.
I'll add that we should make efforts to avoid any data structure wanting to allocate large amounts of contiguous memory, especially if there are realistic scenarios under which that would happen on the web (arguably, these tests aren't realistic)
Whiteboard: [js:p2:fx15] → [js:p2]
Assignee: general → nobody
Severity: normal → S3
Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.