You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: two more missing JobQueue checkpoints found via full-suite CI repro
CI has been hanging on (ubuntu-22.04, 3.8)/(3.10) with no further output
after test_dicts.py. Reproduced locally by running the actual full suite
(not a hand-picked subset) and bisecting with a faulthandler watchdog:
1. pythonmonkey never registers a JS::ModuleLoadHook, so `await
pm.eval("import(...)")` hangs forever -- js::HostLoadImportedModule
discards the "no hook" failure via TryStartDynamicModuleImport's `(void)`
cast instead of ever settling the promise. Fixed by registering a hook
that immediately fails every load and properly finishes the promise.
2. JobQueue.cc's callDispatchFunc (the off-thread dispatch path used by
WebAssembly.instantiate) never called js::RunJobs(cx) after running the
dispatchable, so any promise it resolved was never drained -- the same
missing-checkpoint bug as fix#7/#11, a 5th instance of it.
Both confirmed via isolated repros (hung every time before, resolve cleanly
after, 3/3 runs) and a full `pytest tests/python` run: 676 passed in 59.8s,
zero hangs, zero crashes, where before it would hang or crash partway
through depending on unrelated heap timing.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: SPIDERMONKEY_VERSION_BUMP.md
+124Lines changed: 124 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -698,6 +698,130 @@ and a few manual checks look right" turned out not to mean "actually works"
698
698
this rewrite (the Debugger-API paths flagged in "Not yet done" below), not
699
699
just the two paths that have now each independently failed once.
700
700
701
+
### 12. `src/modules/pythonmonkey/pythonmonkey.cc` — no `ModuleLoadHook` registered, `import(...)` hung forever (found running the *actual* full test suite for the first time, not a hand-picked subset)
702
+
703
+
**How this was found**: the user reported CI hangs on `(ubuntu-22.04, 3.8)`
704
+
and `(ubuntu-22.04, 3.10)` with no further output after `test_dicts.py`.
705
+
Reproducing locally with `pytest tests/python/test_event_loop.py::test_promises`
706
+
alone did not hang (fast pass), but running the *actual full suite*
707
+
(`pytest tests/python`, matching CI's own invocation) reproduced it -- and, on
708
+
this machine, sometimes as a hang and sometimes as a genuine Windows access
709
+
violation later in the same run (see fix #13; two independent bugs were
710
+
stacked behind each other, and the first one being a hang meant the second
711
+
one was never reached before). Bisected `test_promises` line-by-line with a
712
+
`faulthandler.dump_traceback_later` watchdog down to one exact statement:
713
+
714
+
```python
715
+
with pytest.raises(pm.SpiderMonkeyError,
716
+
match="\nError: Dynamic module import is disabled or not supported in this context"):
717
+
await pm.eval("import('some_module')")
718
+
```
719
+
720
+
**Root cause**: pythonmonkey never calls `JS::SetModuleLoadHook`. Reading
721
+
`js::HostLoadImportedModule` (`js/src/vm/Modules.cpp`) directly: when
722
+
`cx->runtime()->moduleLoadHook` is null, it calls `JS_ReportErrorASCII(cx,
723
+
"Module load hook not set")` and returns `false` immediately -- it does
724
+
**not** fall through to `FinishLoadingImportedModuleFailedWithPendingException`
725
+
the way it does when a hook *is* registered but itself returns `false`. Its
726
+
caller, `TryStartDynamicModuleImport`, discards that return value
727
+
(`(void)HostLoadImportedModule(...)`) and unconditionally returns `true`, so
728
+
`StartDynamicModuleImport`'s own fallback (`RejectPromiseWithPendingError`) is
729
+
never reached either. Net effect: the promise returned by `import(...)` is
730
+
created and returned to script, but nothing ever resolves or rejects it --
0 commit comments