Closed noahsmartin closed 1 month ago
Would it make sense to merge this one with the C++ one?
I think so - not exactly clear why the Swift one was added @Itaybre might know
This was created for Snapshots, since that project was already in Swift, I used that. Didn't realize it could add issues with the threads
This is fixed by https://github.com/EmergeTools/ETTrace/pull/100
In the Swift version of Tracer, which is not used in production yet, there are some calls to functions that are not async signal safe like
dladdr
as well as heap allocations. The function getCallStack should be reentrant to avoid deadlocks: https://github.com/EmergeTools/ETTrace/blob/f791b54c68f62cbf5fa4b0253d91182c522c2c21/ETTrace/TracerSwift/ThreadHelper.swift#L82The symbolication step should happen after threads are resumed, and we need to be careful not to allocate any memory on the heap while a thread is suspended, probably that portion of code should be in C since allocations can't be guaranteed to be avoided in Swift