pthread_jit_write_protect_np(0) crashes if com.apple.security.cs.allow-jit isn't enabled on Mac (aarch64) (with a zero-variant JDK)
Tanin Na Nakorn
tanin47 at gmail.com
Mon Oct 6 17:30:18 UTC 2025
Hello all,
I was building a Java app on Mac (aarch64) and trying to find a way to
avoid com.apple.security.cs.allow-jit using the zero-variant JDK 21, which
doesn't use JIT.
I've found that pthread_jit_write_protect_np(0) (invoked in threads.cpp,
line 430, through os::current_thread_enable_wx(WXWrite)) crashes if
com.apple.security.cs.allow-jit isn't enabled. It seems this method is
called regardless of the variant.
I have a few questions around this:
1. Does this mean a sandboxed Java app on Mac will always require
com.apple.security.cs.allow-jit? Is there a way around this? For example,
is there a way to avoid using pthread_jit_write_protect_np(0) in the zero
variant?
2. It seems like the term JIT has different meanings for Java and Apple
where, for Java, it means not to use compiler1 and compiler 2. But, for
Mac, it means something else e.g. never use pthread_jit_write_protect_np(0)
and generate code.
I'm still new to all this, so I might misunderstand something. Would love
some insights around this area.
Thank you so much!
Tanin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-dev/attachments/20251006/3341ecdd/attachment-0001.htm>
More information about the hotspot-dev
mailing list