question about mecca fiber with address sanitizer

Johan j at j.nl
Mon Dec 14 19:09:16 UTC 2020


On Monday, 14 December 2020 at 07:30:10 UTC, Calvin P wrote:
>
> Base on document: 
> https://github.com/llvm-mirror/compiler-rt/blob/master/include/sanitizer/common_interface_defs.h#L313,  NULL fake stack pointer pass to __sanitizer_start_switch_fiber destroy the current fake stack.
>
> https://github.com/ldc-developers/druntime/blob/ldc/src/core/thread/fiber.d#L1929,  the NULL is pass to __sanitizer_finish_switch_fiber.
>
>
> If I am correct, DRuntime will never destroy the fake stack?

Great that you are working on this!

Perhaps you're right.
On this line
https://github.com/ldc-developers/druntime/blob/a261a84e4c6b208c65ae39da0ae844ae3dd06744/src/core/thread/fiber.d#L1971 , perhaps the first argument should be `(m_state == State.TERM) ? null : &__fake_stack`


I worked on this, but I don't remember all the details any more. 
I recommend making testcases and carefully check what is working 
/ what is not. We can add such tests to our testsuite. See for 
example: 
https://github.com/ldc-developers/ldc/blob/master/tests/sanitizers/asan_fiber.d

cheers,
   Johan








More information about the digitalmars-d-ldc mailing list