Closed
Bug 1102388
Opened 10 years ago
Closed 9 years ago
DMD does not work in a content process
Categories
(Core :: DMD, defect)
Core
DMD
Tracking
()
RESOLVED
FIXED
mozilla40
People
(Reporter: mccr8, Assigned: jld)
References
Details
Attachments
(2 files)
960 bytes,
patch
|
Details | Diff | Splinter Review | |
2.61 KB,
patch
|
mccr8
:
review+
|
Details | Diff | Splinter Review |
I mentioned this in IRC, but I figured I should have a bug on file, too. It looks like in the DMDFuncs::Singleton ctor that ReplaceMalloc::GetDMDFuncs() is returning null, so any later attempts to call into DMD don't do anything. This is a non-optimized debug Clang build on Linux, with --enable-dmd. I'm running DMD with |./mach mochitest-plain --e10s --dmd|. (I'm marking this as MemShrink because it is impeding a leak investigation, though presumably I could back out bug 1097507 locally for now.)
Reporter | ||
Comment 1•10 years ago
|
||
In ReplaceMallocBridge::Get(), sSingleton->mVersion appears to be... 0? I don't know how that is even possible.
Reporter | ||
Comment 2•10 years ago
|
||
In the child process, it looks like the ctor for ReplaceMallocBridge is being called after ReplaceMallocBridge::Get(), which I suppose explains why mVersion is 0.
Comment 3•10 years ago
|
||
Knowing if this happens in a vanilla |mach run --dmd| invocation would be useful.
Updated•9 years ago
|
Whiteboard: [MemShrink]
Reporter | ||
Comment 4•9 years ago
|
||
This is a minimal example that demonstrates the problem. It runs in the XPConnect ctor just because that always runs, but isn't super early.
Reporter | ||
Comment 5•9 years ago
|
||
with a non-e10s mochitest run it works: DMD='--mode=live' ./mach mochitest-plain --dmd runtests.py | Application pid: 8163 DMD[8163] $DMD = '--mode=live' (process:8163): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed ### XPCOM_MEM_BLOAT_LOG defined -- logging bloat/leaks to /tmp/tmpasRHBk.mozrunner/runtests_leaks.log [8163] WARNING: Re-registering a CID?: file /home/amccreight/mc/xpcom/components/nsComponentManager.cpp, line 531 [8163] WARNING: DMDFuncs exist: file /home/amccreight/mc/js/xpconnect/src/nsXPConnect.cpp, line 77 with an e10s mochitest run it does not work in the child process: DMD='--mode=live' ./mach mochitest-plain --dmd --e10s DMD[8311] $DMD = '--mode=live' ... [8311] WARNING: DMDFuncs exist: file /home/amccreight/mc/js/xpconnect/src/nsXPConnect.cpp, line 77 ... DMD[8363] $DMD = '--mode=live' ... [Child 8363] WARNING: DMDFuncs do not exist: file /home/amccreight/mc/js/xpconnect/src/nsXPConnect.cpp, line 79 With a regular run with e10s enabled it again does not work in the child process: ./mach run --dmd --mode live -P debug DMD[8435] $DMD = '--mode=live' ... [8435] WARNING: DMDFuncs exist: file /home/amccreight/mc/js/xpconnect/src/nsXPConnect.cpp, line 77 ... DMD[8490] $DMD = '--mode=live' ... [Child 8490] WARNING: DMDFuncs do not exist: file /home/amccreight/mc/js/xpconnect/src/nsXPConnect.cpp, line 79
Reporter | ||
Comment 6•9 years ago
|
||
Do you see different behavior than me?
Flags: needinfo?(n.nethercote)
Reporter | ||
Updated•9 years ago
|
tracking-e10s:
--- → ?
Comment 7•9 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #6) > Do you see different behavior than me? I do. I have DMDFuncs set in all those cases. That's with a non-debug DMD build on Linux.
Flags: needinfo?(n.nethercote)
Comment 8•9 years ago
|
||
> I do. I have DMDFuncs set in all those cases. That's with a non-debug DMD
> build on Linux.
And likewise with a debug build.
Reporter | ||
Comment 9•9 years ago
|
||
Very weird. Are you using gcc? I'm using clang. Maybe that's the difference?
Updated•9 years ago
|
Comment 10•9 years ago
|
||
Both my builds were with clang.
Assignee | ||
Comment 11•9 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #1) > In ReplaceMallocBridge::Get(), sSingleton->mVersion appears to be... 0? I > don't know how that is even possible. Idea: DMDFuncs::sSingleton's ctor (in libxul) is being called before sDMDBridge's ctor (in libdmd). So, the path that takes the address of sDMDBridge, passes it down through {replace_,}get_bridge to ReplaceMallocBridge::Get, and reads its mVersion field… runs before the constructor that initializes the mVersion field.
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → jld
Assignee | ||
Comment 12•9 years ago
|
||
See patch commit message for more info. Tested by using about:memory in DMD-enabled e10s mode and observing the non-empty child process DMD file. Also, https://treeherder.mozilla.org/#/jobs?repo=try&revision=08fcd20f11a4 (ASan and V failures seem to be expected given --enable-dmd).
Attachment #8595144 -
Flags: review?(continuation)
Reporter | ||
Comment 13•9 years ago
|
||
Comment on attachment 8595144 [details] [diff] [review] Patch: avoid ctor order dependency with dynamic allocation. Review of attachment 8595144 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for investigating and fixing this!
Attachment #8595144 -
Flags: review?(continuation) → review+
Comment 15•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/f2fac0a0d4e2
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/f2fac0a0d4e2
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Comment 17•9 years ago
|
||
Nice catch, jld!
You need to log in
before you can comment on or make changes to this bug.
Description
•