Skip to content

Non-reentrant functions used after thread suspend #96

Closed
@noahsmartin

Description

@noahsmartin

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:

static func getCallStack(_ threadId: thread_t) -> [StackFrame]? {

The 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions