Closed Bug 946883 Opened 11 years ago Closed 11 years ago

Some timeout related jit-tests fail on OS X with NSPR emulation

Categories

(Core :: JavaScript Engine, defect)

All
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: jandem, Assigned: jandem)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

I looked into the shell-watchdog.js failure. We're failing this assert in JitRuntime::handleAccessViolation: JS_ASSERT(!rt->currentThreadOwnsOperationCallbackLock()); The callstack looks like this: js::jit::JitRuntime::handleAccessViolation HandleMachException AsmJSMachExceptionHandlerThread currentThreadOwnsOperationCallbackLock ends up calling PR_GetCurrentThread(). I think this fails because AsmJSMachExceptionHandlerThread is not an NSPR thread (we use pthread_create directly) and PR_GetCurrentThread() returns null. NSPR itself calls pt_AttachThread() in this case I think so it always return something non-null. billm, luke: any thoughts on how to fix this? We could turn it into an NSPR thread maybe? Not sure how hard that is.
Does changing the pthread_create in AsmJSMachExcpetionHandler::install to PR_CreateThread fix the assertion?
If need be, we PosixNSPR could do what NSPR does and create an nspr::Thread in PR_GetCurrentThread() if the TLS is unset. It would be a pain to ensure that gets deleted, but it's not too big a deal. Luke's suggestion would be easier if it works, though.
jit-tests are green with this patch, both with NSPR and PosixNSPR. When I filed this bug, I thought thread_set_exception_ports wanted a pthread_t of the new thread, but I misread and it doesn't so this was pretty straight-forward.
Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
Attachment #8343655 - Flags: review?(luke)
Comment on attachment 8343655 [details] [diff] [review] Use NSPR thread for AsmJSMachExceptionHandler Thanks!
Attachment #8343655 - Flags: review?(luke) → review+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Depends on: 947683
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: