tlopex commented on issue #18923:
URL: https://github.com/apache/tvm/issues/18923#issuecomment-4146539887

   Hi @thishome, thanks for the additional details.
   
   I checked the RPC and FFI code paths, and the handle lifecycle in the 
standard cross-compilation flow looks correct. I also did not find any relevant 
fixes between 0.23.0 and current `main` that would obviously explain this crash.
   
   To help narrow this down, could you try the following?
   
   1. **Minimal repro**  
      Does this also crash with a very small model, for example a single `add` 
op? If not, that would suggest the issue may be model-specific, e.g. a compiled 
kernel corrupting memory earlier in the execution.
   
   2. **ASAN build on the Thor side**  
      Please try building the C++ RPC server with AddressSanitizer:
      ```bash
      cmake .. -DCMAKE_CXX_FLAGS="-fsanitize=address -fno-omit-frame-pointer"
      make -j$(nproc)
      ```
      ASAN should give a much more precise report for the invalid pointer and 
help tell whether this is a double-free, use-after-free, or heap corruption.
   
   3. **Reproducibility**  
      Is this crash fully reproducible, or does it only happen intermittently?
   
   The segfault happens in `DecRef` on a pointer passed through `FreeHandle`, 
which suggests that the server-side object at that address is already invalid 
by the time it is being released. At this point, ASAN is likely the fastest way 
to identify where that corruption first happens.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to