{"record":{"id":"24adec14aa7c53d9","repo":"oracle/graal","slug":"registration-is-not-a-singleton","errorCode":null,"errorMessage":"Registration  is not a singleton","messagePattern":"Registration  is not 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":288,"sourceCode":"\n        private void defineMethod(int index, CompilationProxy.SymbolicMethod method) throws IOException {\n            if (index != methodTable.size()) {\n                throw new IOException(\"Invalid replay symbolic method definition index \" + index);\n            }\n            methodTable.add(method);\n        }\n\n        private CompilerInterfaceDeclarations.Registration registrationAt(int index) throws IOException {\n            if (index < 0 || index >= registrations.length) {\n                throw new IOException(\"Invalid replay registration index \" + index);\n            }\n            return registrations[index];\n        }\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;","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/BinaryReplayCodec.java#L270-L306","documentation":"IOException thrown by BinaryReplayCodec.ReadState.singletonProxy when the stream requests a singleton proxy for a registration whose Registration is not marked singleton. The decoder distinguishes singleton types (one shared proxy) from instance types (per-id proxies); a non-singleton registration at a singleton reference site means the stream's shape disagrees with the current declarations — corruption or version mismatch.","triggerScenarios":"A SINGLETON_PROXY record indexes a registration whose singleton() flag is false in the running build — e.g. the producing build treated the type as a singleton while the consumer does not, or bytes were shuffled.","commonSituations":"Cross-build replay after compiler-interface annotations changed (singleton added/removed); corrupted replay artifacts.","solutions":["Regenerate the replay file with the same compiler build used for replay.","Verify the file's integrity and retry.","Treat replay data as build-local: never share across revisions."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    replayCodec.decode(input);\n} catch (IOException e) {\n    if (e.getMessage().contains(\"is not a singleton\")) {\n        // singleton markings differ between builds: regenerate replay data\n    }\n    throw e;\n}","preventionTips":["Re-record replay files whenever compiler-interface singleton annotations change.","Validate replay provenance (build id) before decoding."],"tags":["graalvm","replay","io","serialization","versioning"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}