tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [incubator-tvm] samwyi opened a new issue #5632: [RUNTIME][VULKAN] Seg fault in WorkspacePool's destructor
Date Wed, 20 May 2020 06:24:12 GMT

samwyi opened a new issue #5632:

   **Problem:** When VulkanThreadEntry is destructed, its member "streams_" is destructed
before  "pool" (members are destructed in reverse order of their appearance in class definition).
 pool's destructor calls FreeDataSpace(), which calls StreamSync(), which references "streams_",
which is already destructed. This caused seg fault.
   Run apps/benchmark/ using Vulkan target.
   **Proposed Solution**:
   Since pool's destructor references stream_, but not vice versa, stream_ should be destructed
after pool. We can wrap pool with a unique_ptr, so we can destruct it inside ~VulkanThreadEntry(),
which is called before VulkanThreadEntry::stream_'s destructor. Also, we destruct pool before
streams_.clear(), so we can reuse the existing stream instead of creating a new one.
   **More background:**
   This is a regression introduced by the fix for
In the fix, FreeDataSpace() calls StreamSync() to make sure the buffer being freed is not
longer in use. 

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:

View raw message