{"record":{"id":"12140df33f5fcfb0","repo":"oracle/graal","slug":"registration-is-a-singleton","errorCode":null,"errorMessage":"Registration  is a singleton","messagePattern":"Registration  is a singleton","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java","lineNumber":301,"sourceCode":"        }\n\n        private Object singletonProxy(int registrationIndex) throws IOException {\n            CompilerInterfaceDeclarations.Registration registration = registrationAt(registrationIndex);\n            if (!registration.singleton()) {\n                throw new IOException(\"Registration \" + registration.clazz().getName() + \" is not a singleton\");\n            }\n            Object proxy = singletonProxies[registrationIndex];\n            if (proxy == null) {\n                proxy = proxyFactory.createProxy(registration);\n                singletonProxies[registrationIndex] = proxy;\n            }\n            return proxy;\n        }\n\n        private Object instanceProxy(int registrationIndex, int id) throws IOException {\n            CompilerInterfaceDeclarations.Registration registration = registrationAt(registrationIndex);\n            if (registration.singleton()) {\n                throw new IOException(\"Registration \" + registration.clazz().getName() + \" is a singleton\");\n            }\n            EconomicMap<Integer, Object> proxies = instanceProxies[registrationIndex];\n            if (proxies == null) {\n                proxies = EconomicMap.create();\n                instanceProxies[registrationIndex] = proxies;\n            }\n            Object proxy = proxies.get(id);\n            if (proxy == null) {\n                proxy = proxyFactory.createProxy(registration);\n                proxies.put(id, proxy);\n            }\n            return proxy;\n        }\n\n        private Architecture registerArchitecture() {\n            return (architecture != null) ? architecture : hostTarget.arch;\n        }\n","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java#L283-L319","documentation":"IOException thrown by BinaryReplayCodec.ReadState.instanceProxy when the stream requests an instance proxy (with an id) for a registration that is marked singleton. Singletons have no per-instance identity, so an id-carrying reference to one is structurally invalid — again indicating a corrupt stream or a codec/declarations mismatch between writer and reader builds.","triggerScenarios":"An INSTANCE_PROXY record indexes a registration whose singleton() flag is true in the running build — the writer build did not mark it singleton (or the bytes are damaged).","commonSituations":"Replaying profiles recorded on a different compiler revision where singleton markings of compiler-interface types changed; bit-level corruption of replay files.","solutions":["Re-record the replay data on the consuming build.","Check the artifact for corruption and re-transfer.","Keep record/replay compiler builds identical."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    replayCodec.decode(input);\n} catch (IOException e) {\n    if (e.getMessage().contains(\"is a singleton\")) {\n        // stream/declarations mismatch: regenerate replay data on this build\n    }\n    throw e;\n}","preventionTips":["Pin record and replay to one compiler build.","Check file integrity and provenance before every replay run."],"tags":["graalvm","replay","io","serialization","versioning"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}