RFR: 8358680: AOT cache creation fails: no strings should have been added

Ioi Lam iklam at openjdk.org
Mon Jun 16 06:20:27 UTC 2025


On Mon, 16 Jun 2025 06:08:30 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> > Can something else add string to table between you get number and safe point? How you avoid that? I assume you can't get number at safepoint because you need to allocate object array not at safepoint. Right?
> 
> Not that I am aware of. In testing, I added `precond(THREAD->is_Java_thread()` into `StringTable::intern()` and it never failed. So I assume that this function can only be called by real Java threads or compiler threads.

Here are all the subclasses of JavaThread:


class AttachListenerThread : public JavaThread {
class CompilerThread : public JavaThread {
class DeoptimizeObjectsALotThread : public JavaThread {
class JvmtiAgentThread : public JavaThread {
class MonitorDeflationThread : public JavaThread {
class NotificationThread : public JavaThread {
class ServiceThread : public JavaThread {
class StringDedupThread : public JavaThread {
class TrainingReplayThread : public JavaThread {


StringDedupThread is disabled when dumping heap objects. And the other threads probably will either be inactive, or won't be doing anything that would result in string interning.

I guess someone could use jcmd to connect to the JVM at the wrong time and that might upset the archive assembly process. But that would create far worse problems than the bug that we are trying to fix here.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25816#issuecomment-2975238342


More information about the hotspot-dev mailing list