Thicket thicket
cambridge
REPOS 4

Projects covers Forester, Merry, xdge and ocaml-crockford.

W39.2026 · 21–27 Sep / Issue

"Switched access from wrong domain!"

tangled · jonmsterling.com/ocaml-forester · did:plc:jjiv56ot7d6sgethto3jr3r5

Got the following crash, which appears to be triggered in any forest where you have to build SVGs from LaTeX. I didn't notice this before because my SVGs were cached.

Fatal error: exception Failure("Internal error: Invalid_argument(\"Switch accessed from wrong domain!\")\nPlease report this at https://tangled.org/jonmsterling.com/ocaml-forester/issues")

This one is very urgent.

Comments

did:plc:jjiv56ot7d6sgethto3jr3r5

A git bisect reveals that the bug is introduced in 2410eb1bffebb5bd434f7d6c8bf484e1135d909c / “Abstract more stuff behind Job.mli”.


did:plc:jjiv56ot7d6sgethto3jr3r5

@kento.tngl.sh It seems like the problem may be a mis-use of submit_fork. In particular, switches are local to a domain (afaict) and it's a no-no to use a switch created in one domain from a different domain.


did:plc:4gj3ihsdh6fn3aqq5bdnw5w3

@jonmsterling.com Can you confirm this is now fixed? I added a test that fails before the latest changes.


did:plc:jjiv56ot7d6sgethto3jr3r5

Thanks! It appears to be kind of "fixed", but the behaviour is that I run forester build and then it waits without feedback for a very long time (presumably it is building the SVGs), and then once that is done it builds the trees themselves with appropriate live feedback.

It would be nice if we could restore the progress information so that the user can tell what is happening.


did:plc:4gj3ihsdh6fn3aqq5bdnw5w3

The progress should now be shown


did:plc:jjiv56ot7d6sgethto3jr3r5

It's working great now, thanks!


did:plc:jjiv56ot7d6sgethto3jr3r5

Thanks so much for fixing this so quickly. I wonder if there are any architectural lessons here that we might extract? Or are we sure that there's no other cross-domain uses of switches in the codebase?