asm.js interrupt callback failing on try server with tsan enabled

RESOLVED WORKSFORME

Status

()

Core
JavaScript Engine: JIT
P3
normal
RESOLVED WORKSFORME
a year ago
2 months ago

People

(Reporter: sfink, Unassigned)

Tracking

({triage-deferred})

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

a year ago
I've been trying to get tsan working on try. I'm running into a problem where the shell watchdog timer is unable to stop script execution, eventually causing the test runner to kill the process instead.

On my local machine, it appears to work fine.

Example test case: jit-tests/tests/asm.js/testTimeout1.js

CancelExecution gets invoked. If I switch it to do an infinite loop in regular JS instead of asmjs, it works. I am running with no environment variables set.

If I run with asmjs but force ProcessHasSignalHandlers() to return false, it works.

Otherwise, InterruptRunningJitCode gets invoked but cx->startHandlingJitInterrupt() fails.
(Reporter)

Comment 1

a year ago
When looking at it with strace, it appears that SIGVTALRM is sent properly, the recipient thread gets it, but just does a sigreturn without doing anything.

When searching on the web, it appears that tsan hooks sigaction, but tries to pass it through appropriately. I don't really follow everything that's going on, but I'm guessing something goes wrong there.

Is it still valid to disable signal handlers? If I made ProcessHasSignalHandlers return false #ifdef MOZ_TSAN, would it break stuff?

It does seem a little unfortunate, since tsan might be useful in finding bugs in signal-handler-using code.

For now, I'll probably list out all of these timeout tests and skip them.
(In reply to Steve Fink [:sfink] [:s:] from comment #1)
> Is it still valid to disable signal handlers? If I made
> ProcessHasSignalHandlers return false #ifdef MOZ_TSAN, would it break stuff?

It would entirely disable asm.js/wasm, so I think we should try to keep this: http://searchfox.org/mozilla-central/source/js/src/wasm/WasmJS.cpp#65-66

That being said, I don't have any ideas why this doesn't properly work.
(Reporter)

Comment 3

a year ago
(In reply to Benjamin Bouvier [:bbouvier] from comment #2)
> (In reply to Steve Fink [:sfink] [:s:] from comment #1)
> > Is it still valid to disable signal handlers? If I made
> > ProcessHasSignalHandlers return false #ifdef MOZ_TSAN, would it break stuff?
> 
> It would entirely disable asm.js/wasm, so I think we should try to keep
> this:
> http://searchfox.org/mozilla-central/source/js/src/wasm/WasmJS.cpp#65-66

Oh, darn. I was hoping that since Windows returns false sometimes, that some sort of fallback mechanism was still used.

> That being said, I don't have any ideas why this doesn't properly work.

I'm still guessing it's something about the way TSAN hooks into signal handling, but I don't know what's different about my development desktop where it works.

For now, I think I'll figure out the least-effort way to disable wasm for the tsan job.
Keywords: triage-deferred
Priority: -- → P3
This works fine now. Maybe because we stopped using signal handlers to interrupt running asm.js/wasm/Ion code :)
Status: NEW → RESOLVED
Last Resolved: 2 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.