Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use signal-safe functions in signal handler
Reporting errors using `ereport` can call `malloc()`, which is not signal-safe. Using `ereport()` in a signal handler can therefore cause `malloc()` to run nested inside `malloc()` if the termination handler is called in the middle of a `malloc()` call, which will trigger an assertion in `malloc()` that will take down the server. This commit fixes this by using the signal-safe `write_stderr()` inside the signal handlers for the background workers. Fixes #3469
- Loading branch information