Skip to content

Commit

Permalink
Write heartbeat thread output to the safe crash log
Browse files Browse the repository at this point in the history
In `jl_safe_printf()`, we're already writing to the safe crash log
if we're in signal handler context (in addition to writing to
`stderr`). Now we do the same if we're in the heartbeat thread.
  • Loading branch information
kpamnany committed May 24, 2024
1 parent 14d3b3d commit d7fa831
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jl_uv.c
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ JL_DLLEXPORT void jl_safe_printf(const char *fmt, ...)
// order is important here: we want to ensure that the threading infra
// has been initialized before we start trying to print to the
// safe crash log file
if (jl_sig_fd != 0 && jl_inside_signal_handler()) {
if (jl_sig_fd != 0 && (jl_inside_signal_handler() || jl_inside_heartbeat_thread()) {
print_error_msg_as_json(buf);
}
if (write(STDERR_FILENO, buf, strlen(buf)) < 0) {
Expand Down

0 comments on commit d7fa831

Please sign in to comment.