Skip to content

Detect calls to functions that are not signal-safe in signal handlers #1986

@michael-schwarz

Description

@michael-schwarz

For reviewing #1965, I read some documentation on signal handlers. There is in particular this rule

An async-signal-safe function is one that can be safely called from within a signal handler. Many functions are not async-signal-safe. In particular, nonreentrant functions are generally unsafe to call from a signal handler.

https://man7.org/linux/man-pages/man7/signal-safety.7.html

and a list of such async-signal-safe functions.

We may want to add an analysis that tracks whether the current thread is a signal handler, and warn whenever a library function that is not async-signal-safe is called.

May be a good BSc project.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions