Closed porterchild closed 4 years ago
Can you not just use Xcode's Target -> Edit Scheme -> Diagnostics -> AddressSanitizer when on S4TF toolchains?
Have you tried using ThreadSanitizer to check for data races?
I'm not sure anyone is familiar with issues regarding autodiff and Dispatch, so a reproducer would be useful for us to help with debugging.
I've tried with Target -> Edit Scheme -> Diagnostics -> ThreadSanitizer in Xcode, though I'm not certain that is actually working on the S4TF toolchain. Is there a special way to use the sanitizers with custom toolchains?
I believe Target -> Edit Scheme -> Diagnostics -> ThreadSanitizer
in Xcode just works with custom toolchains, nothing special needed. Verified here:
Do AddressSanitizer and ThreadSanitizer pass for your code with the runtime autodiff error?
Ok good to know, thanks! Yeah they both pass, insofar as the crash happens before either of them report anything.
Reproducer provided in https://bugs.swift.org/browse/TF-1311
I'm struggling to find a minimal reproducer for a runtime error on the backwards pass of some differentiable code. It's a large bit of code, hence the struggle to find a small reproducer.
The interesting information that I have is this: when the backwards pass is run in a normal scope, it runs fine, but when it is run within a DispatchQueue.async{} block, there is a runtime EXC_BAD_ACCESS error.
I'm wondering if anyone has a hypothesis that might help my hunting. Thanks!