Closed harald-lang closed 8 years ago
The problem was, that the HSAIL module was destroyed to early. The spec says: "The HSA runtime does not perform a deep copy of the HSAIL module upon addition. Instead, it stores a pointer to the HSAIL module. The ownership of the HSAIL module belongs to the application, which must ensure that module is not released before destroying the HSAIL program."
I have a minimal init-dispatch-shutdown test case (see below). The test runs perfectly unless it runs more than once within the same process. The second run fails with a SegFault in
hsa_ext_program_finalize_impl()
in 8 out of 10 runs. When running under a debugger, 2 out of 10 runs fail.This issue might be related to https://github.com/HSAFoundation/Okra-Interface-to-HSA-Device/issues/3 (which, unfortunately, is open for almost a year now).
System setup:
Below is a GDB backtrace. The test named
HSA.Finalize
always succeeds, whereas theHSA.Finalize2
(which runs the same code) fails as described above: