[Apple Silicon] Thread JIT Write Protection

107 views
Skip to first unread message

ClearScript Developers

unread,
Aug 19, 2022, 9:50:18 AM8/19/22
to v8-dev
Greetings!

V8 often calls the embedder to schedule delayed or background work. Our embedder has its own JIT compiler.

It appears that sometimes, on Apple Silicon, V8 calls the embedder with Thread JIT Write Protection in the "write, don't execute" state (see pthread_jit_write_protect_np). The embedder then blows up on any attempt to execute its own JIT-compiled code.

Our question for the V8 team: Should we report this? Would it be considered a V8 bug?

Thanks!

Jakob Kummerow

unread,
Aug 19, 2022, 11:38:51 AM8/19/22
to v8-dev
Feel free to report it. I'd be interested to learn more; embedder calls while being in writable mode seem a bit surprising. I can't promise we'd do anything about it, that depends in particular on how much trouble it would be.


--
--
v8-dev mailing list
v8-...@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/a26be36b-b422-47b7-8fa3-60e7a8f0e348n%40googlegroups.com.

ClearScript Developers

unread,
Aug 21, 2022, 12:25:37 PM8/21/22
to v8-dev
Will do, Jakob, thanks. Since you're interested, we first saw this in 10.3, where it was very rare and treatable via "--no_wasm_async_compilation". In 10.4 and later it's ubiquitous, and "git bisect" has identified the Fast W^X feature as the culprit. That feature was reverted on the 10.3 branch but apparently relanded for 10.4 and beyond.

ClearScript Developers

unread,
Aug 28, 2022, 5:07:40 PM8/28/22
to v8-dev
Reply all
Reply to author
Forward
0 new messages