Skip to content

Commit

Permalink
[Core] Do not call absl::InitializeSymbolizer on windows (ray-project…
Browse files Browse the repository at this point in the history
…#44181)

Calling absl::InitializeSymbolizer twice will crash on windows. Other libraries, like pytorchaudio, call it on import. So ray should not call it. The function is "nice to have", it gives a better traceback on crashes.

Signed-off-by: Matti Picus <[email protected]>
  • Loading branch information
mattip authored Mar 28, 2024
1 parent 9d0bf7c commit 31d2025
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ray/util/logging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,13 @@ void RayLog::InstallFailureSignalHandler(const char *argv0, bool call_previous_h
if (is_failure_signal_handler_installed_) {
return;
}
#ifndef _WIN32
// InitializeSymbolizer cannot be called twice on windows, (causes a
// crash)and is called in other libraries like pytorchaudio. It does not seem
// there is a API to determine if it has already been called, and is only
// needed to provide better stack traces on crashes. So do not call it here.
absl::InitializeSymbolizer(argv0);
#endif
absl::FailureSignalHandlerOptions options;
options.call_previous_handler = call_previous_handler;
options.writerfn = WriteFailureMessage;
Expand Down

0 comments on commit 31d2025

Please sign in to comment.