{"record":{"id":"d422b3b5a9a1d580","repo":"Tencent/matrix","slug":"unknown-root-type","errorCode":null,"errorMessage":"Unknown root type:","messagePattern":"Unknown root type:","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"matrix/matrix-android/matrix-resource-canary/matrix-resource-canary-analyzer/src/main/java/com/tencent/matrix/resource/analyzer/utils/ShortestPathFinder.java","lineNumber":337,"sourceCode":"                case SYSTEM_CLASS:\n                case VM_INTERNAL:\n                    // A local variable in native code.\n                case NATIVE_LOCAL:\n                    // A global variable in native code.\n                case NATIVE_STATIC:\n                    // An object that was referenced from an active thread block.\n                case THREAD_BLOCK:\n                    // Everything that called the wait() or notify() methods, or that is synchronized.\n                case BUSY_MONITOR:\n                case NATIVE_MONITOR:\n                case REFERENCE_CLEANUP:\n                    // Input or output parameters in native code.\n                case NATIVE_STACK:\n                case JAVA_STATIC:\n                    enqueue(null, null, rootObj, null, null);\n                    break;\n                default:\n                    throw new UnsupportedOperationException(\"Unknown root type:\" + rootObj.getRootType());\n            }\n        }\n    }\n\n    private boolean checkSeen(ReferenceNode node) {\n        return !visitedSet.add(node.instance);\n    }\n\n    private void visitRootObj(ReferenceNode node) {\n        RootObj rootObj = (RootObj) node.instance;\n        Instance child = rootObj.getReferredInstance();\n\n        if (rootObj.getRootType() == RootType.JAVA_LOCAL) {\n            Instance holder = HahaSpy.allocatingThread(rootObj);\n            // We switch the parent node with the thread instance that holds\n            // the local reference.\n            Exclusion exclusion = null;\n            if (node.exclusion != null) {","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/Tencent/matrix/blob/3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7/matrix/matrix-android/matrix-resource-canary/matrix-resource-canary-analyzer/src/main/java/com/tencent/matrix/resource/analyzer/utils/ShortestPathFinder.java#L319-L355","documentation":"enqueueGcRoots walks all GC roots in the snapshot and enqueues the recognized types (e.g. NATIVE_STACK, JAVA_STATIC). A root whose RootType is outside the supported set hits the default branch and throws UnsupportedOperationException, because the shortest-path search cannot classify that root.","triggerScenarios":"findPath -> enqueueGcRoots encounters a heap-dump GC root whose RootType (from the hprof ROOT_* records) is not one of the enumerated supported cases — e.g. a dump format with new root kinds this analyzer doesn't handle.","commonSituations":"Heap dumps from newer ART/JDK versions introducing new GC root tags; dumps produced by tools writing nonstandard root records; older Matrix analyzer parsing newer OS dumps.","solutions":["Update Matrix to a version whose enqueueGcRoots handles the new root type.","Re-capture the hprof on a supported OS version.","Add the new RootType to the switch and enqueue it like other roots (or intentionally ignore it).","Pre-validate the dump's root types before running analysis and skip unsupported roots."],"exampleFix":"// before\ndefault:\n    throw new UnsupportedOperationException(\"Unknown root type:\" + rootObj.getRootType());\n// after\ndefault:\n    // ignore unknown root types rather than aborting analysis\n    break;","handlingStrategy":"try-catch","validationCode":"// pre-scan roots: reject or filter dump if any unsupported RootType appears","typeGuard":null,"tryCatchPattern":"try { finder.findPath(...); } catch (UnsupportedOperationException e) { log.warn(\"unknown GC root type: \" + e.getMessage()); }","preventionTips":["Update the analyzer when targeting newer Android/ART dumps","Ignore unsupported root types defensively in a patched build","Verify dump provenance (OS version, capture tool)"],"tags":["heap-dump","gc-roots","hprof","android"],"backgroundTag":"unsupported-enum-value","analyzedSha":"3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7","analyzedAt":"2026-09-08T08:01:39.722Z","contentChangedAt":"2026-09-08T08:01:39.722Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}