You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#273 added proper initialization and finalization of the GLOG library to silence "GLOG not initialized" warnings. However, explicitly shutting down GLOG causes problems with the Hermes VFD.
The Problem
In Hermes::Finalize we call ShutdownGoogleLogging. In the VFD, Hermes::Finalize is called from H5FD__hermes_term, which is a function registered with atexit(3). It appears that atexit(3)-registered functions run after static global objects are destroyed. So, GLOG's static objects are destroyed, then we get to Hermes::Finalize and ShutdownGoogleLogging, where it tries to access those static objects and segfaults.
The Solution
Use IsGoogleLoggingInitialized to see whether or not GLOG needs to be shut down.
The Problem with That
IsGoogleLoggingInitialized is only available in GLOG v.0.5.0.
The Solution
Require GLOG v0.5.0.
The Problem with That
OR-Tools is hardcoded to required GLOG v0.4.0. In newer (> 8.1) versions of OR-Tools they re-implemented their own version of GLOG, so we could update OR-Tools and use GLOG v0.5.0 in Hermes. However, something about the OR-Tools GLOG re-implementation makes it impossible to use in a library that depends on GLOG (i.e., Hermes). Apparently they're waiting for Abseil developers to update to update their flags API (since GFLAGS is now deprecated?).
The Solution
Don't properly init GLOG. Don't properly shutdown GLOG. Live with the warnings. Once this issue is fixed we can update to a newer OR-Tools and GLOG v0.5.0. Alternatively we can replace OR-Tools and avoid all these headaches. See #321.
The text was updated successfully, but these errors were encountered:
#273 added proper initialization and finalization of the GLOG library to silence "GLOG not initialized" warnings. However, explicitly shutting down GLOG causes problems with the Hermes VFD.
The Problem
In
Hermes::Finalize
we callShutdownGoogleLogging
. In the VFD,Hermes::Finalize
is called fromH5FD__hermes_term
, which is a function registered withatexit(3)
. It appears thatatexit(3)
-registered functions run after static global objects are destroyed. So, GLOG's static objects are destroyed, then we get toHermes::Finalize
andShutdownGoogleLogging
, where it tries to access those static objects and segfaults.The Solution
Use
IsGoogleLoggingInitialized
to see whether or not GLOG needs to be shut down.The Problem with That
IsGoogleLoggingInitialized
is only available in GLOGv.0.5.0
.The Solution
Require GLOG
v0.5.0
.The Problem with That
OR-Tools is hardcoded to required GLOG
v0.4.0
. In newer (> 8.1) versions of OR-Tools they re-implemented their own version of GLOG, so we could update OR-Tools and use GLOGv0.5.0
in Hermes. However, something about the OR-Tools GLOG re-implementation makes it impossible to use in a library that depends on GLOG (i.e., Hermes). Apparently they're waiting for Abseil developers to update to update their flags API (since GFLAGS is now deprecated?).The Solution
Don't properly init GLOG. Don't properly shutdown GLOG. Live with the warnings. Once this issue is fixed we can update to a newer OR-Tools and GLOG
v0.5.0
. Alternatively we can replace OR-Tools and avoid all these headaches. See #321.The text was updated successfully, but these errors were encountered: