Bug 1077135 - Ensure logging initialization for early log messages in the linker. r=nfroyd
authorMike Hommey <mh+mozilla@glandium.org>
Sat, 04 Oct 2014 10:31:49 +0900
changeset 232014 e31af72872bf7fea74cf4e88b4895173effeafbe
parent 232013 bd8f5d90d58e1607444eb79106c9002254e02394
child 232015 d2005a8af9501712f7b5b06f13b9a1ab53dc3eb1
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnfroyd
bugs1077135
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1077135 - Ensure logging initialization for early log messages in the linker. r=nfroyd
mozglue/linker/ElfLoader.cpp
--- a/mozglue/linker/ElfLoader.cpp
+++ b/mozglue/linker/ElfLoader.cpp
@@ -965,16 +965,22 @@ struct TmpData {
   volatile int crash_int;
   volatile uint64_t crash_timestamp;
 };
 
 SEGVHandler::SEGVHandler()
 : initialized(false), registeredHandler(false), signalHandlingBroken(true)
 , signalHandlingSlow(true)
 {
+  /* Ensure logging is initialized before the DEBUG_LOG in the test_handler.
+   * As this constructor runs before the ElfLoader constructor (by effect
+   * of ElfLoader inheriting from this class), this also initializes on behalf
+   * of ElfLoader and DebuggerHelper. */
+  Logging::Init();
+
   /* Initialize oldStack.ss_flags to an invalid value when used to set
    * an alternative stack, meaning we haven't got information about the
    * original alternative stack and thus don't mean to restore it in
    * the destructor. */
   oldStack.ss_flags = SS_ONSTACK;
 
   /* Get the current segfault signal handler. */
   struct sigaction old_action;