Skip to content

Signal Trace mode may send SIGURG to wrong thread #3038

Description

@CodeZHXS

Describe the bug
In TaskTracer::SignalTrace, we use sigqueue to send SIGURG to worker_tid. This may not be correct.

In fact, although the type of worker_tid is pid_t, It is actually the id of the LWP(Light Weight Process). If we use sigqueue, SIGURG will send to current process. Then os will select one of the threads to handle this signal. This is not what we want. We hope that only the worker thread corresponding to the TaskGroup receives this signal.

We can use the rt_tgsigqueueinfo, this syscall can achieve our goal.

Here is the relevant documentation:https://linux.die.net/man/2/rt_sigqueueinfo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions