Last Comment Bug 693821 - Using TimeDuration/TimeStamp from static constructors should assert
: Using TimeDuration/TimeStamp from static constructors should assert
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: unspecified
: x86 Mac OS X
: P3 normal (vote)
: mozilla10
Assigned To: David Baron :dbaron: ⌚️UTC+2 (mostly busy through August 4; review requests must explain patch)
:
Mentors:
Depends on: 693219
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-11 14:32 PDT by Boris Zbarsky [:bz]
Modified: 2011-10-13 07:19 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
add assertions to mac code (2.27 KB, patch)
2011-10-11 14:53 PDT, David Baron :dbaron: ⌚️UTC+2 (mostly busy through August 4; review requests must explain patch)
bzbarsky: review+
Details | Diff | Splinter Review

Description Boris Zbarsky [:bz] 2011-10-11 14:32:31 PDT
The classes are possibly not initialized properly at that point.
Comment 1 David Baron :dbaron: ⌚️UTC+2 (mostly busy through August 4; review requests must explain patch) 2011-10-11 14:51:30 PDT
Do we want each implementation to assert what it requires, or do we want the same assertions across platforms?  The first (for the Mac one) is pretty straightforward.
Comment 2 David Baron :dbaron: ⌚️UTC+2 (mostly busy through August 4; review requests must explain patch) 2011-10-11 14:53:41 PDT
Created attachment 566362 [details] [diff] [review]
add assertions to mac code

untested
Comment 3 Boris Zbarsky [:bz] 2011-10-11 18:31:56 PDT
Comment on attachment 566362 [details] [diff] [review]
add assertions to mac code

r=me
Comment 4 David Baron :dbaron: ⌚️UTC+2 (mostly busy through August 4; review requests must explain patch) 2011-10-11 21:04:46 PDT
Prior to the patch in bug 693219 this patch yields, on a mac debug tinderbox builder:

###!!! ABORT: calling TimeDuration too early: 'gInitialized', file /builds/slave/try-osx64-dbg/build/xpcom/ds/TimeStamp_darwin.cpp, line 133
WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /builds/slave/try-osx64-dbg/build/xpcom/base/nsTraceRefcntImpl.cpp, line 172
WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /builds/slave/try-osx64-dbg/build/xpcom/base/nsTraceRefcntImpl.cpp, line 172
WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /builds/slave/try-osx64-dbg/build/xpcom/base/nsTraceRefcntImpl.cpp, line 172
WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /builds/slave/try-osx64-dbg/build/xpcom/base/nsTraceRefcntImpl.cpp, line 172
WARNING: XPCOM objects created/destroyed from static ctor/dtor: file /builds/slave/try-osx64-dbg/build/xpcom/base/nsTraceRefcntImpl.cpp, line 172
mozilla::TimeDuration::FromMilliseconds(double)+0x00000040 [/builds/slave/try-osx64-dbg/build/obj-firefox/dist/bin/XUL +0x0001C550]
__static_initialization_and_destruction_0(int, int)+0x00000036 [/builds/slave/try-osx64-dbg/build/obj-firefox/dist/bin/XUL +0x00004C9E]
global constructors keyed to _ZN13nsPresContext19PrefChangedCallbackE
Comment 5 David Baron :dbaron: ⌚️UTC+2 (mostly busy through August 4; review requests must explain patch) 2011-10-12 10:55:29 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/5435ee09cf7b

I think that fixes this bug for now, since it will at least prevent bad things from happening again.  If it ends up doing it at the stage of somebody-landing-their-patch too often, we should revisit and make the platforms consistent in how they assert.
Comment 6 Marco Bonardo [::mak] (Away 6-20 Aug) 2011-10-13 07:19:11 PDT
https://hg.mozilla.org/mozilla-central/rev/5435ee09cf7b

Note You need to log in before you can comment on or make changes to this bug.