Closed Bug 946883 Opened 7 years ago Closed 7 years ago
Some timeout related jit-tests fail on OS X with NSPR emulation
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: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
You need to log in before you can comment on or make changes to this bug.