Repository navigation
Unit_hipGraphDestroyNode_DestroyDependencyNode segfault (iGPU, OpenCL) #654
Copy link
Copy link
Closed
Labels
category:correctnessIncorrect results, crashes and behavioral bugsIncorrect results, crashes and behavioral bugsopenclIssues affecting only the OpenCL backendIssues affecting only the OpenCL backend
Milestone
Description
Thread 1 "hipGraphDestroy" received signal SIGSEGV, Segmentation fault.
0x0000555557227010 in ?? ()
(gdb) bt
#0 0x0000555557227010 in ?? ()
#1 0x00007ffff7d3e195 in CHIPGraph::CHIPGraph (this=0x5555572a37b8, OriginalGraph=...) at /home/pjaaskel/src/chipStar/src/CHIPGraph.cc:72
#2 0x00007ffff7d9bf80 in CHIPGraphExec::CHIPGraphExec (this=0x5555572a37b0, Graph=0x5555564de460)
at /home/pjaaskel/src/chipStar/src/CHIPGraph.hh:682
#3 0x00007ffff7d6060f in hipGraphInstantiate (pGraphExec=0x7fffffffce90, graph=0x5555564de460, pErrorNode=0x0, pLogBuffer=0x0,
bufferSize=0) at /home/pjaaskel/src/chipStar/src/CHIPBindings.cc:481
#4 0x00005555555a03a3 in ____C_A_T_C_H____T_E_S_T____43 ()
at /home/pjaaskel/src/chipStar/HIP/tests/catch/unit/graph/hipGraphDestroyNode.cc:128
#5 0x00005555555c0573 in Catch::TestInvokerAsFunction::invoke (this=0x55555570d9c0)
at /home/pjaaskel/src/chipStar/HIP/tests/catch/external/Catch2/catch.hpp:14261
#6 0x00005555555bab84 in Catch::TestCase::invoke (this=0x5555564de9a0)
at /home/pjaaskel/src/chipStar/HIP/tests/catch/external/Catch2/catch.hpp:14100
#7 0x00005555555baaba in Catch::RunContext::invokeActiveTestCase (this=0x7fffffffd6d0)
at /home/pjaaskel/src/chipStar/HIP/tests/catch/external/Catch2/catch.hpp:12959
#8 0x00005555555b975e in Catch::RunContext::runCurrentTest (this=0x7fffffffd6d0, Python Exception <class 'gdb.error'>: There is no member named _M_p.
redirectedCout=, Python Exception <class 'gdb.error'>: There is no member named _M_p.
redirectedCerr=)
at /home/pjaaskel/src/chipStar/HIP/tests/catch/external/Catch2/catch.hpp:12932
#9 0x00005555555b8be5 in Catch::RunContext::runTest (this=0x7fffffffd6d0, testCase=...)
at /home/pjaaskel/src/chipStar/HIP/tests/catch/external/Catch2/catch.hpp:12693
#10 0x00005555555bd283 in Catch::(anonymous namespace)::TestGroup::execute (this=0x7fffffffd6c0)
at /home/pjaaskel/src/chipStar/HIP/tests/catch/external/Catch2/catch.hpp:13287
#11 0x00005555555bc8ab in Catch::Session::runInternal (this=0x7fffffffd9e0)
at /home/pjaaskel/src/chipStar/HIP/tests/catch/external/Catch2/catch.hpp:13493
#12 0x00005555555bc697 in Catch::Session::run (this=0x7fffffffd9e0)
at /home/pjaaskel/src/chipStar/HIP/tests/catch/external/Catch2/catch.hpp:13449
#13 0x00005555555ed23a in Catch::Session::run<char> (this=0x7fffffffd9e0, argc=2, argv=0x7fffffffdc98)
at /home/pjaaskel/src/chipStar/HIP/tests/catch/external/Catch2/catch.hpp:13171
#14 0x00005555555d23ef in main (argc=2, argv=0x7fffffffdc98) at /home/pjaaskel/src/chipStar/HIP/tests/catch/external/Catch2/catch.hpp:17448
Metadata
Metadata
Assignees
Labels
category:correctnessIncorrect results, crashes and behavioral bugsIncorrect results, crashes and behavioral bugsopenclIssues affecting only the OpenCL backendIssues affecting only the OpenCL backend
Activity
pvelesko commentedon Oct 18, 2023
Known to fail on all platforms - seems like bitrot and will not be relevant once Michal's graphs PRs are merged.
pvelesko commentedon Oct 14, 2026
Reproduced again on current main (c8e69d1) on Aurora PVC with the OpenCL backend:
Unit_hipGraphDestroyNode_DestroyDependencyNode_GraphsTest1segfaults 10/10 when run alone, and it also crashes on Level Zero in a fullcheck.pyrun. The test only stopped showing up because it was excluded.Cause:
hipGraphDestroyNode(src/CHIPBindings.cc:1465) onlydeletes the node. It never callsCHIPGraph::removeNode(src/CHIPGraph.cc:343), and the destructor (src/CHIPGraph.hh:64) does not unlink neighbours. The freed node stays inNodes_and in the kernel node'sDependencies_. The test then callshipGraphInstantiate(CHIPBindings.cc:1547), whose graph copy constructor calls the virtualOriginalNode->clone()on every entry ofNodes_(src/CHIPGraph.cc:80), so it calls into freed memory.gdb backtrace (OpenCL):
At the
clone()call the freed node's vptr readsmain_arena + 96(the glibc free-list pointer) instead of theCHIPGraphNodeMemcpyvtable. On Level Zero the freed chunk happens to keep its old vptr, so a single run can pass by luck.CUDA defines the counterpart (CUDA Runtime API, Graph Management,
cudaGraphDestroyNode): "Removes node from its graph. This operation also severs any dependencies of other nodes on node and vice versa." So both the node removal and the edge removal are required.Draft #1864 calls
removeNodefromhipGraphDestroyNodeand also erases the node from the other nodes' dependency lists. Calling the existingremoveNodealone would not be enough, since it only erasesNodes_. Related but separate: #1852 (graph destroy leak) and #1868 (clone map). This is a chipStar host-code bug, not LLVM, IGC or a runtime. Reopening.This comment was generated using AI
pvelesko commentedon Oct 24, 2026
Also hit on the AMD rusticl lane (OpenCL, radeonsi) on a fresh build: https://github.com/CHIP-SPV/chipStar/actions/runs/40082797768/job/120839657224, the only failure out of 1430.
This issue was generated using AI
pvelesko commentedon Oct 26, 2026
Seen again on the AMD rusticl lane:
Unit_hipGraphDestroyNode_DestroyDependencyNode_GraphsTest1hit SEGFAULT in https://github.com/CHIP-SPV/chipStar/actions/runs/40408611968/job/121872734534 on #2129, which only changes a test script undertests/compiler/promoteInt. The same lane passed on another branch in https://github.com/CHIP-SPV/chipStar/actions/runs/40407849045, so it is intermittent.This comment was generated using AI
pvelesko commentedon Oct 28, 2026
Also reproduces on macOS (Apple M4) with the native Vulkan backend on the Mesa KosmicKrisp driver, chipStar main 5afe718:
GraphsTest1 Unit_hipGraphDestroyNode_DestroyDependencyNodeexits with SIGSEGV (rc 139) when run alone. The same test passes on the Linux native Vulkan lane (https://github.com/CHIP-SPV/chipStar/actions/runs/40682259076/job/122796067856), so whether it crashes depends on heap layout.A likely cause in
src/CHIPBindings.cc:hipGraphDestroyNodeonly doesdeleteon the node. It never callsCHIPGraph::removeNode, and it does not remove the node from theDependencies_/Dependendants_lists of its neighbours (~CHIPGraphNodeonly clears its own lists). The graph'sNodes_and the kernel node's dependency list keep a dangling pointer, andhipGraphInstantiatethen copies the graph (CHIPGraph::CHIPGraph(const CHIPGraph &), the frame in the backtrace above) and dereferences it.This issue was generated using AI
known_failures: list the macOS KosmicKrisp lane's failures with their…
known_failures: list the macOS KosmicKrisp lane's failures with their…
tests: add reproducer for hipGraphDestroyNode leaving the node in its…
runtime: hipGraphDestroyNode removes the node from its graph and its …
known_failures: drop Unit_hipGraphDestroyNode_DestroyDependencyNode_G…
tests: add reproducer for hipGraphDestroyNode leaving the node in its…
runtime: hipGraphDestroyNode removes the node from its graph and its …
known_failures: drop Unit_hipGraphDestroyNode_DestroyDependencyNode_G…
tests: add reproducer for hipGraphDestroyNode leaving the node in its…
known_failures: drop Unit_hipGraphDestroyNode_DestroyDependencyNode_G…