Closed Bug 794206 Opened 7 years ago Closed 7 years ago

Enabling the profiler hits JS_ASSERT(installed());


(Core :: Gecko Profiler, defect)

Not set





(Reporter: dhylands, Unassigned)




(1 file, 1 obsolete file)

I tried building from Mozilla-Inbound and when I run b2g with MOZ_PROFILER_STARTUP=1 then I hit the assert at:



#0  js::SPSProfiler::enable (this=0xa5a5b025, enabled=true) at /home/work/mozilla-inbound/js/src/vm/SPSProfiler.cpp:58
#1  0x418715b0 in js::EnableRuntimeProfilingStack (rt=<value optimized out>, enabled=true) at /home/work/mozilla-inbound/js/src/jsfriendapi.cpp:900
#2  0x4133ae28 in ProfileStack::enableJSSampling (aProfileEntries=<value optimized out>, aInterval=<value optimized out>, aFeatures=<value optimized out>, aFeatureCount=1)
    at /home/work/mozilla-inbound/tools/profiler/sps_sampler.h:351
#3  mozilla_sampler_start (aProfileEntries=<value optimized out>, aInterval=<value optimized out>, aFeatures=<value optimized out>, aFeatureCount=1)
    at /home/work/mozilla-inbound/tools/profiler/TableTicker.cpp:1100
#4  0x4133af7a in mozilla_sampler_init () at /home/work/mozilla-inbound/tools/profiler/TableTicker.cpp:1012
#5  0x4082f1c8 in XREMain::XRE_main (this=0xa5a5b025, argc=1, argv=0x3, aAppData=0x1) at /home/work/mozilla-inbound/toolkit/xre/nsAppRunner.cpp:3798
#6  0x4082f52a in XRE_main (argc=1, argv=0xbebaebb4, aAppData=0xb1c0, aFlags=<value optimized out>) at /home/work/mozilla-inbound/toolkit/xre/nsAppRunner.cpp:3923
#7  0x00008af4 in do_main (argc=1, argv=0xbebaebb4) at /home/work/mozilla-inbound/b2g/app/nsBrowserApp.cpp:153
#8  main (argc=1, argv=0xbebaebb4) at /home/work/mozilla-inbound/b2g/app/nsBrowserApp.cpp:229

From what I can gather, SPSProfiler::setProfilingStack or SetRuntimeProfilingStack needs to be called. I couldn't find any calls to either of these functions outside of the ones in js/src/jsapi-tests/testProfileStrings.cpp, or a call to EnableSPSProfilingAssertions (or the JS enableSPSProfilingAssertions)
I should mention that I hit the assert when using a DEBUG build. Everything seems to work fine with a non-DEBUG build, which suggests that the ASSERT may be superfluous.
We shouldn't be calling js::EnableRuntimeProfilingStack this early on startup. We need to wait until the JS engine is ready and has given us a context. See:

I think we just forgot to init mRuntime to null. I'm surprised this hasn't come up in fennec before.
Attached patch patch (obsolete) — Splinter Review
I'm traveling and don't have access to b2g hardware. Can you test this patch for me?
I removed the errant semi-colon from the patch, and it still asserts in the exact same place.
Alright well I think we want this patch anyways so let's land it but keep going with this bug.
Comment on attachment 664855 [details] [diff] [review]

Ignore the extra ';'
Attachment #664855 - Flags: review?(ehsan)
Blocks: 758697
Attachment #664855 - Flags: review?(ehsan) → review+
Carry forward r+
Attachment #664855 - Attachment is obsolete: true
Attachment #666595 - Flags: review+
Whiteboard: [leave open]
I thought I'd mention that I'm not seeing the assert any more.

I think it's possible I applied the patch in a source tree different from the one I was building - Sigh.
Closed: 7 years ago
Resolution: --- → FIXED
Whiteboard: [leave open]
You need to log in before you can comment on or make changes to this bug.