Closed
Bug 460990
Opened 17 years ago
Closed 17 years ago
VirtualProtect call in NJ sometimes fails
Categories
(Tamarin Graveyard :: Virtual Machine, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: stejohns, Assigned: stejohns)
Details
Attachments
(1 file)
|
6.20 KB,
patch
|
rreitmai
:
review+
|
Details | Diff | Splinter Review |
Sometimes the VirtualProtect call that NJ uses to mark a chunk of code as executable fails with ERROR_INVALID_ADDRESS. (Worse, we don't bother checking the result... we should at least check-and-assert as we do for the Unix case.)
Reason for failure is unclear, as the pointer value itself looks plausible. As of yet I haven't been able to make it occur in avmshell alone, only in FlashPlayer.
| Assignee | ||
Comment 1•17 years ago
|
||
Why do we use GC memory for Page allocation anyway? seems like going straight to the platform allocator (eg VirtualAlloc) would make more sense for NJ.
Comment 2•17 years ago
|
||
we use GCHeap, which is just an abstraction for raw OS memory. NJ needs a portability layer for this, but agreed, it doesn't have to be GCHeap. In fact Tracemonkey has to emulate the GCHeap layer, so a crisp portability layer makes more sense.
| Assignee | ||
Comment 3•17 years ago
|
||
Adding a portability layer sounds like the right approach to me, but is out of scope for this bug IMHO.
| Assignee | ||
Comment 4•17 years ago
|
||
Code in nMarkExecutable for Nativei386.cpp is wrong: it marks NJ_PAGE_SIZE bytes starting at the code field of the page, but that is actually past the end of the page by a single pointer. Bug occurs if the next page in memory happens to be decommitted (and thus can't be marked as executable). Fix coming up soon.
Comment 5•17 years ago
|
||
We also have a SetPageProtection() in GCHeap might want to duke it out to see which one wins.
| Assignee | ||
Comment 6•17 years ago
|
||
That one is apparently never getting called in this context.
| Assignee | ||
Comment 7•17 years ago
|
||
redid nMarkExecute() to fix the bug. Now it always does exactly one page (rather than a count of pages) and to take explicit flags for write and exec (rather than just exec) to lay the groundwork for fixing https://bugzilla.mozilla.org/show_bug.cgi?id=460993
Also enabled nMarkExecute to work on mac, since AVMPLUS_UNIX isn't defined there, oddly enough.
Assignee: rreitmai → stejohns
Attachment #344217 -
Flags: review?(rreitmai)
Updated•17 years ago
|
Attachment #344217 -
Flags: review?(rreitmai) → review+
| Assignee | ||
Comment 8•17 years ago
|
||
pushed to redux as changeset: 1015:f1dc0ab0ae9e
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Comment 9•16 years ago
|
||
Resolved fixed engineering / work item that has been pushed. Setting status to verified.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•