Skip to content

runtime: use tgkill instead of tkill to keep Android happy #24924

@zx2c4

Description

@zx2c4

Go uses tkill in the panic routine. From the tkill man page:

   tkill() is an obsolete predecessor to
   tgkill().   It allows only the target
   thread ID to be specified, which  may
   result in the wrong thread being sig‐
   naled if a thread terminates and  its
   thread  ID  is recycled.  Avoid using
   this system call.

Android sets a seccomp filter that disallows tkill but allows tgkill. Therefore the solution is to switch Go to using tgkill. According to the man page, there are other good reasons for switching to tgkill too.

This is similar to #23750 but is yet-another mole.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions