Closed Bug 821577 Opened 12 years ago Closed 12 years ago

DMD: Hang on Mac at start-up

Categories

(Core :: DMD, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20
Tracking Status
firefox19 --- fixed
firefox20 --- fixed
b2g18 --- fixed

People

(Reporter: n.nethercote, Assigned: n.nethercote)

Details

Attachments

(2 files)

I'm getting DMD hangs just after start-up on Mac. DMD initializes successfully, then very early on I get a hang here: #0 0x00007fff90c7236e in spin_lock$VARIANT$mp () #1 0x00007fff891302c1 in CFBundleGetMainBundle () #2 0x00007fff8917f269 in _CFBundleGetMainBundleIfLooksLikeBundle () #3 0x00007fff90743e73 in GetBugsForOurBundleIDFromCoreservicesd () #4 0x00007fff90743d76 in _CSCheckFix () #5 0x00007fff9074d31f in _Gestalt_SystemVersion () #6 0x00007fff9074cd3a in Gestalt () #7 0x000000010001b259 in OSXVersion () at /Users/njn/moz/mi1/xpcom/base/nsStackWalk.cpp:76 #8 0x000000010001ad19 in OnLionOrLater () at /Users/njn/moz/mi1/xpcom/base/nsStackWalk.cpp:84 #9 0x000000010001aab8 in StackWalkInitCriticalAddress () at /Users/njn/moz/mi1/xpcom/base/nsStackWalk.cpp:148 #10 0x000000010001ae56 in NS_StackWalk (aCallback=0x10000efd0 <mozilla::dmd::StackTrace::StackWalkCallback(void*, void*, void*)>, aSkipFrames=3, aClosure=0x7fff5fbfe0d0, aThread=0, aPlatformData=0x0) at /Users/njn/moz/mi1/xpcom/base/nsStackWalk.cpp:1218 #11 0x000000010000b51d in mozilla::dmd::StackTrace::Get (aT=0x100409060) at /Users/njn/moz/mi1/memory/replace/dmd/DMD.cpp:590 #12 0x000000010000bd95 in AllocCallback (aPtr=0x10040a080, aReqSize=128, aT=0x100409060) at /Users/njn/moz/mi1/memory/replace/dmd/DMD.cpp:886 #13 0x000000010000bc18 in replace_malloc (aSize=128) at /Users/njn/moz/mi1/memory/replace/dmd/DMD.cpp:943 #14 0x00000001000520f0 in malloc_impl (size=128) at /Users/njn/moz/mi1/memory/build/replace_malloc.c:151 #15 0x00000001000519f9 in zone_malloc (zone=0x10007a2d0, size=128) at /Users/njn/moz/mi1/memory/build/replace_malloc.c:325 #16 0x00007fff90c703c8 in malloc_zone_malloc () #17 0x00007fff90c711a4 in malloc () #18 0x00007fff91d7ea57 in updateVtable () #19 0x00007fff91d807a2 in _class_setInitialized () #20 0x00007fff91d8064c in _finishInitializing () #21 0x00007fff91d7f6af in _class_initialize () #22 0x00007fff91d7f517 in prepareForMethodLookup () #23 0x00007fff91d7f2bb in lookUpMethod () #24 0x00007fff91d7cf3c in objc_msgSend () #25 0x00007fff8914e299 in -[__NSPlaceholderArray initWithCapacity:] () #26 0x00007fff8911033f in CFArrayCreateMutable () #27 0x00007fff89121cb7 in _CFBundleCopySortedDirectoryContentsAtPath () #28 0x00007fff8912174a in _CFBundleURLLooksLikeBundleVersion () #29 0x00007fff891447d8 in _CFBundleCreate () #30 0x00007fff891303c2 in _CFBundleGetMainBundleAlreadyLocked () #31 0x00007fff891302c6 in CFBundleGetMainBundle () #32 0x0000000100002b75 in mozilla::BinaryPath::Get (argv0=0x7fff5fbff838 "/Users/njn/moz/mi1/dmdd64/dist/NightlyDebug.app/Contents/MacOS/firefox", aResult=0x7fff5fbff1b0 "") at BinaryPath.h:46 #33 0x0000000100001ea8 in main (argc=4, argv=0x7fff5fbff5f8) at /Users/njn/moz/mi1/browser/app/nsBrowserApp.cpp:208
This does the trick.
Attachment #692136 - Flags: review?(justin.lebar+bug)
Comment on attachment 692136 [details] [diff] [review] DMD: Fix hang at start-up on Mac. I'm fine with this work-around, but it sounds like there might be a bug in StackWalkInitCriticalAddress.
Attachment #692136 - Flags: review?(justin.lebar+bug) → review+
I'm not sure about the bug... the comment says that StackWalkInitCriticalAddress() must be called before any mutexes are created, and DMD creates its own mutex in Init(), so maybe that was the problem.
Comment on attachment 692136 [details] [diff] [review] DMD: Fix hang at start-up on Mac. [Triage Comment] npotb
Attachment #692136 - Flags: approval-mozilla-b2g18+
Attachment #692136 - Flags: approval-mozilla-aurora+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Component: General → DMD
Keywords: verifyme
I tried to reproduce the issue by building Firefox locally whit the ac_add_options --enable-dmd line in mozconfig as suggested in comment 2. A different error did not let me see the current issue. Error log for e082861f545f fix build in attachment. I will try to verify this on Latest Nightly build.
Comment on attachment 715147 [details] Error for e082861f545f fix build > The crash is > > Exception Type: EXC_BAD_ACCESS (SIGSEGV) > Exception Codes: EXC_I386_GPFLT > > Thread 0 Crashed:: Dispatch queue: com.apple.main-thread > 0 libunwind.dylib 0x00007fff9175d610 libunwind::CompactUnwinder_x86_64<libunwind::LocalAddressSpace>::stepWithCompactEncodingRBPFrame(unsigned int, unsigned long long, libunwind::LocalAddressSpace&, libunwind::Registers_x86_64&) + 72 > 1 libunwind.dylib 0x00007fff9175d58f libunwind::CompactUnwinder_x86_64<libunwind::LocalAddressSpace>::stepWithCompactEncoding(unsigned int, unsigned long long, libunwind::LocalAddressSpace&, libunwind::Registers_x86_64&) + 37 > 2 libunwind.dylib 0x00007fff9175d50e libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step() + 58 > 3 libunwind.dylib 0x00007fff917614e0 _Unwind_Backtrace + 65 > 4 libdmd.dylib 0x000000010000ef06 NS_StackWalk + 54 If this is reproducable, we should file a bug.
This is reproducible every time and it's now bug 842566.
mass remove verifyme requests greater than 4 months old
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: