Using TimeDuration/TimeStamp from static constructors should assert

RESOLVED FIXED in mozilla10

Status

()

Core
XPCOM
P3
normal
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: bz, Assigned: dbaron)

Tracking

unspecified
mozilla10
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

The classes are possibly not initialized properly at that point.
(Assignee)

Comment 1

6 years ago
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.
(Assignee)

Comment 2

6 years ago
Created attachment 566362 [details] [diff] [review]
add assertions to mac code

untested
Attachment #566362 - Flags: review?(bzbarsky)
Comment on attachment 566362 [details] [diff] [review]
add assertions to mac code

r=me
Attachment #566362 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 4

6 years ago
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
(Assignee)

Updated

6 years ago
Depends on: 693219
(Assignee)

Comment 5

6 years ago
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.
(Assignee)

Updated

6 years ago
Assignee: nobody → dbaron
Priority: -- → P3
Target Milestone: --- → mozilla10
https://hg.mozilla.org/mozilla-central/rev/5435ee09cf7b
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.