Open Bug 1019192 Opened 10 years ago Updated 2 years ago

Assertion count mismatch (ASSERTION: style context has old rule node, etc.) during layout/reftests/font-face/download-3-notref.html on Android 4.0 Debug

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Android
defect

Tracking

()

People

(Reporter: gbrown, Unassigned)

References

Details

(Whiteboard: [leave open])

Android 4.0 *Debug* tests currently only run on the Cedar tree. We are trying to get these tests to pass so that they can be run on trunk trees.

On Cedar, on Android 4.0 Debug, layout/reftests/font-face/download-3-notref.html consistently fails with an assertion count mismatch:

https://tbpl.mozilla.org/php/getParsedLog.php?id=40755469&tree=Cedar&full=1

13:33:31     INFO -  REFTEST TEST-START | http://10.26.130.19:30289/tests/layout/reftests/font-face/download-3-notref.html
13:33:31     INFO -  REFTEST TEST-LOAD | http://10.26.130.19:30289/tests/layout/reftests/font-face/download-3-notref.html | 974 / 1330 (73%)
13:33:31     INFO -  REFTEST INFO | START http://10.26.130.19:30289/tests/layout/reftests/font-face/download-3-notref.html
13:33:31     INFO -  REFTEST INFO | [CONTENT] OnDocumentLoad triggering AfterOnLoadScripts
13:33:31     INFO -  REFTEST INFO | Initializing canvas snapshot
13:33:31     INFO -  REFTEST INFO | DoDrawWindow 0,0,800,1000
13:33:31     INFO -  REFTEST INFO | [CONTENT] RecordResult fired
13:33:31     INFO -  REFTEST INFO | RecordResult fired
13:33:31     INFO -  REFTEST TEST-LOAD | http://10.26.130.19:30289/tests/layout/reftests/font-face/download-3.html | 974 / 1330 (73%)
13:33:31     INFO -  REFTEST INFO | START http://10.26.130.19:30289/tests/layout/reftests/font-face/download-3.html
13:33:31     INFO -  REFTEST INFO | [CONTENT] OnDocumentLoad triggering AfterOnLoadScripts
13:33:31     INFO -  REFTEST INFO | Initializing canvas snapshot
13:33:31     INFO -  REFTEST INFO | DoDrawWindow 0,0,800,1000
13:33:31     INFO -  REFTEST INFO | [CONTENT] RecordResult fired
13:33:31     INFO -  REFTEST INFO | RecordResult fired
13:33:31     INFO -  REFTEST TEST-PASS | http://10.26.130.19:30289/tests/layout/reftests/font-face/download-3-notref.html | image comparison (!=)
13:33:31     INFO -  REFTEST INFO | Loading a blank page
13:33:31     INFO -  REFTEST TEST-UNEXPECTED-FAIL | http://10.26.130.19:30289/tests/layout/reftests/font-face/download-3-notref.html | assertion count 2 is more than expected 0 assertions
13:33:31     INFO -  REFTEST TEST-END | http://10.26.130.19:30289/tests/layout/reftests/font-face/download-3-notref.html

Logcat shows the assertion:

http://mozilla-releng-blobs.s3.amazonaws.com/blobs/cedar/sha512/d9f4c339054d6f1505f4d9339307714e904b954b8c26e32d09153f0468a158132ed0db54ff0e50fa457ff3887daf168195c9290ea3059ce2543e9b06aa85357a

05-30 13:33:24.742 I/Gecko   ( 2115): --DOMWINDOW == 67 (0x671bc200) [pid = 2115] [serial = 2578] [outer = 0x0] [url = http://10.26.130.19:30289/tests/layout/reftests/floats/float-outside-block-push.html]
05-30 13:33:24.789 D/dalvikvm( 1897): GC_CONCURRENT freed 369K, 14% free 6732K/7751K, paused 1ms+2ms
05-30 13:33:25.335 I/Gecko   ( 2115): ++DOMWINDOW == 68 (0x671b9190) [pid = 2115] [serial = 2625] [outer = 0x671c4370]
05-30 13:33:25.421 I/Gecko   ( 2115): ++DOMWINDOW == 69 (0x671b9760) [pid = 2115] [serial = 2626] [outer = 0x671c4370]
05-30 13:33:25.500 I/Gecko   ( 2115): ++DOMWINDOW == 70 (0x671b9950) [pid = 2115] [serial = 2627] [outer = 0x671c4370]
05-30 13:33:25.546 D/dalvikvm( 2115): GC_CONCURRENT freed 550K, 8% free 8424K/9095K, paused 2ms+3ms
05-30 13:33:26.085 I/Gecko   ( 2115): ++DOMWINDOW == 71 (0x671b9d30) [pid = 2115] [serial = 2628] [outer = 0x671c4370]
05-30 13:33:26.132 I/Gecko   ( 2115): [2115] ###!!! ASSERTION: style context has old rule node: 'n == mRuleTree', file /builds/slave/ced-and-d-00000000000000000000/build/layout/style/nsStyleSet.cpp, line 238
05-30 13:33:26.132 I/Gecko   ( 2115): [2115] ###!!! ASSERTION: old rule tree still referenced: 'Not Reached', file /builds/slave/ced-and-d-00000000000000000000/build/layout/style/nsStyleSet.cpp, line 1758

...although the relationship between these assertions and the font-face/download-3 test is not immediately apparent to me.

See https://tbpl.mozilla.org/?tree=Cedar&showall=1&jobname=android.*debug for more logs.
It looks like download-3-notref.html was written by :bz, while :dbaron added both of the nsStyleSet assertions. Do either of you know what's going wrong here?

If we want to allow these assertions in this test, I'm happy to take care of that.
Flags: needinfo?(dbaron)
I don't know what's going on offhand, but given the assertion sounds pretty bad...
If you're trying to get the test suite up and running, you should just annotate it as known to assert 2 times in that configuration.  (Use 2, not 0-2, and specify the configuration correctly, so if the bug is fixed we'll remove the annotation.)

That said, I'd really like to be able to debug this; those assertions are pretty bad.  Do you have any idea why this would happen only on Android 4.0 debug?  (Could they be residual from a different test somehow?)
Component: General → CSS Parsing and Computation
Flags: needinfo?(dbaron)
Product: Firefox for Android → Core
Summary: Assertion count mismatch during layout/reftests/font-face/download-3-notref.html on Android 4.0 Debug → Assertion count mismatch (ASSERTION: style context has old rule node, etc.) during layout/reftests/font-face/download-3-notref.html on Android 4.0 Debug
Assignee: nobody → gbrown
(In reply to David Baron [:dbaron] (UTC-7) (needinfo? for questions) from comment #3)
> That said, I'd really like to be able to debug this; those assertions are
> pretty bad.  Do you have any idea why this would happen only on Android 4.0
> debug?  (Could they be residual from a different test somehow?)

I don't have much insight. 

Android 4.0 Debug is the only Android Debug configuration we regularly test. I tried running this reftest locally on an Android 2.3 device and hit the assertion. So I suspect this is some Android pecularity, but not specific to a particular Android version.

I tried running this test (download-3-notref) as the first test in the job and still hit the assertion -- it is not residual from another test.

I had trouble running local reftests in the debugger -- I'm not sure what the problem was. Instead, I inserted MOZ_CRASH's at the assertion to get stack traces:

PROCESS-CRASH | http://192.168.0.82:8888/tests/layout/reftests/font-face/download-3-notref.html | application crashed [@ nsStyleSet::EndReconstruct()]
Crash dump filename: /tmp/tmptA6y59/7a8d651d-6982-811d-38446dc7-08879206.dmp
Operating system: Android
                  0.0.0 Linux 2.6.29-ge3d684d #1 Mon Dec 16 22:26:51 UTC 2013 armv7l generic/sdk/generic:2.3.7/GINGERBREAD/eng.ubuntu.20140123.014351:eng/test-keys
CPU: arm
     0 CPUs

Crash reason:  SIGSEGV
Crash address: 0x0

Thread 10 (crashed)
 0  libxul.so!nsStyleSet::EndReconstruct() [nsStyleSet.cpp:8331bffe6d8c : 238 + 0x1a]
     r4 = 0x54de6c80    r5 = 0x00000000    r6 = 0x54de6ce0    r7 = 0x55272010
     r8 = 0x4ed2e8a1    r9 = 0x4ed29748   r10 = 0x000000ed    fp = 0x4ed2e8b0
     sp = 0x471ff6d8    lr = 0x4de155d7    pc = 0x4de29378
    Found by: given as instruction pointer in context
 1  libxul.so!mozilla::RestyleManager::DoRebuildAllStyleData(mozilla::RestyleTracker&, nsChangeHint) [RestyleManager.cpp:8331bffe6d8c : 1435 + 0x5]
     r4 = 0x46fc33e0    r5 = 0x0000003f    r6 = 0x46fc3408    r7 = 0x0000003f
     r8 = 0x00000000    r9 = 0x00000000   r10 = 0x00000001    fp = 0x46f396bc
     sp = 0x471ff710    pc = 0x4de72f53
    Found by: call frame info
 2  libxul.so!mozilla::RestyleManager::RebuildAllStyleData(nsChangeHint) [RestyleManager.cpp:8331bffe6d8c : 1391 + 0xd]
     r4 = 0x46fc33e0    r5 = 0x471ff7b8    r6 = 0x55a94280    r7 = 0x0000003f
     r8 = 0x00000000    r9 = 0x00000000   r10 = 0x00000001    fp = 0x46f396bc
     sp = 0x471ff7b0    pc = 0x4de7351b
    Found by: call frame info
 3  libxul.so!CharSetChangingRunnable::Run [nsPresContext.cpp:8331bffe6d8c : 108 + 0xd]
     r4 = 0x552297c0    r5 = 0x471ff7f8    r6 = 0x471ff804    r7 = 0x00000000
     r8 = 0x00000000    r9 = 0x471ff83f   r10 = 0x00000001    fp = 0x46f396bc
     sp = 0x471ff7e0    pc = 0x4dea7e01
    Found by: call frame info
 4  libxul.so!nsThread::ProcessNextEvent(bool, bool*) [nsThread.cpp:8331bffe6d8c : 766 + 0xb]
     r4 = 0x46f39680    r5 = 0x471ff7f8    r6 = 0x471ff804    r7 = 0x00000000
     r8 = 0x00000000    r9 = 0x471ff83f   r10 = 0x00000001    fp = 0x46f396bc
     sp = 0x471ff7e8    pc = 0x4cfc6a69
    Found by: call frame info
 5  libxul.so!NS_ProcessNextEvent(nsIThread*, bool) [nsThreadUtils.cpp:8331bffe6d8c : 263 + 0xd]
     r4 = 0x46f39680    r5 = 0x00000000    r6 = 0x46f01fe8    r7 = 0x00000001
     r8 = 0x4f418f6c    r9 = 0x46f01fe0   r10 = 0x471ff8ec    fp = 0x00000000
     sp = 0x471ff838    pc = 0x4cf7c9a3
    Found by: call frame info
 6  libxul.so!mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) [MessagePump.cpp:8331bffe6d8c : 95 + 0x7]
     r4 = 0x46f01fd0    r5 = 0x46f5f0c0    r6 = 0x46f01fe8    r7 = 0x00000001
     r8 = 0x4f418f6c    r9 = 0x46f01fe0   r10 = 0x471ff8ec    fp = 0x00000000
     sp = 0x471ff850    pc = 0x4d19d6df
    Found by: call frame info
 7  libxul.so!MessageLoop::RunInternal() [message_loop.cc:8331bffe6d8c : 229 + 0x7]
     r4 = 0x46f5f0c0    r5 = 0x46f29f20    r6 = 0x46f39680    r7 = 0x471ff8f0
     r8 = 0x471ffac5    r9 = 0x471ff900   r10 = 0x471ff8ec    fp = 0x00000000
     sp = 0x471ff880    pc = 0x4d1814f3
    Found by: call frame info
 8  libxul.so!MessageLoop::Run() [message_loop.cc:8331bffe6d8c : 222 + 0x5]
     r4 = 0x46f5f0c0    r5 = 0x46f29f20    r6 = 0x46f39680    r7 = 0x471ff8f0
     r8 = 0x471ffac5    r9 = 0x471ff900   r10 = 0x471ff8ec    fp = 0x00000000
     sp = 0x471ff898    pc = 0x4d181531
    Found by: call frame info
 9  libxul.so!nsBaseAppShell::Run() [nsBaseAppShell.cpp:8331bffe6d8c : 164 + 0x7]
     r4 = 0x00000000    r5 = 0x46f29f20    r6 = 0x46f39680    r7 = 0x471ff8f0
     r8 = 0x471ffac5    r9 = 0x471ff900   r10 = 0x471ff8ec    fp = 0x00000000
     sp = 0x471ff8b0    pc = 0x4d88bd7d
    Found by: call frame info
10  libxul.so!nsAppStartup::Run() [nsAppStartup.cpp:8331bffe6d8c : 278 + 0x9]
     r4 = 0x5200bc40    r5 = 0x471ff9d4    r6 = 0x00000000    r7 = 0x471ff8f0
     r8 = 0x471ffac5    r9 = 0x471ff900   r10 = 0x471ff8ec    fp = 0x00000000
     sp = 0x471ff8c8    pc = 0x4e1b6897
    Found by: call frame info
11  libxul.so!XREMain::XRE_mainRun() [nsAppRunner.cpp:8331bffe6d8c : 4011 + 0xb]
     r4 = 0x471ff908    r5 = 0x471ff9d4    r6 = 0x00000000    r7 = 0x471ff8f0
     r8 = 0x471ffac5    r9 = 0x471ff900   r10 = 0x471ff8ec    fp = 0x00000000
     sp = 0x471ff8d8    pc = 0x4e161489
    Found by: call frame info
12  libxul.so!XREMain::XRE_main(int, char**, nsXREAppData const*) [nsAppRunner.cpp:8331bffe6d8c : 4082 + 0x5]
     r4 = 0x471ff9d4    r5 = 0x00000000    r6 = 0x471ff9b3    r7 = 0x46f30380
     r8 = 0x0000000e    r9 = 0x469b4f80   r10 = 0x00245dc8    fp = 0xaca9f368
     sp = 0x471ff9a8    pc = 0x4e1616e1
    Found by: call frame info



PROCESS-CRASH | http://192.168.0.82:8888/tests/layout/reftests/font-face/download-3-notref.html | application crashed [@ nsStyleSet::GCRuleTrees()]
Crash dump filename: /tmp/tmpZKCoJg/438c7f51-49a6-4871-0eb9c48b-39219b7a.dmp
Operating system: Android
                  0.0.0 Linux 2.6.29-ge3d684d #1 Mon Dec 16 22:26:51 UTC 2013 armv7l generic/sdk/generic:2.3.7/GINGERBREAD/eng.ubuntu.20140123.014351:eng/test-keys
CPU: arm
     0 CPUs

Crash reason:  SIGSEGV
Crash address: 0x0

Thread 10 (crashed)
 0  libxul.so!nsStyleSet::GCRuleTrees() [nsStyleSet.cpp:8331bffe6d8c : 1779 + 0x28]
     r4 = 0x000006f3    r5 = 0x4ed2a748    r6 = 0x00000000    r7 = 0x0000003f
     r8 = 0x00000000    r9 = 0x00000000   r10 = 0x00000001    fp = 0x46f396bc
     sp = 0x471ff6f8    lr = 0x4de165d7    pc = 0x4de2a23e
    Found by: given as instruction pointer in context
 1  libxul.so!mozilla::RestyleManager::DoRebuildAllStyleData(mozilla::RestyleTracker&, nsChangeHint) [RestyleManager.cpp:8331bffe6d8c : 1435 + 0x5]
     r4 = 0x46fc33e0    r5 = 0x0000003f    r6 = 0x46fc3408    r7 = 0x0000003f
     r8 = 0x00000000    r9 = 0x00000000   r10 = 0x00000001    fp = 0x46f396bc
     sp = 0x471ff710    pc = 0x4de73f0b
    Found by: call frame info
 2  libxul.so!mozilla::RestyleManager::RebuildAllStyleData(nsChangeHint) [RestyleManager.cpp:8331bffe6d8c : 1391 + 0xd]
     r4 = 0x46fc33e0    r5 = 0x471ff7b8    r6 = 0x55a94460    r7 = 0x0000003f
     r8 = 0x00000000    r9 = 0x00000000   r10 = 0x00000001    fp = 0x46f396bc
     sp = 0x471ff7b0    pc = 0x4de744d3
    Found by: call frame info
 3  libxul.so!CharSetChangingRunnable::Run [nsPresContext.cpp:8331bffe6d8c : 108 + 0xd]
     r4 = 0x55229800    r5 = 0x471ff7f8    r6 = 0x471ff804    r7 = 0x00000000
     r8 = 0x00000000    r9 = 0x471ff83f   r10 = 0x00000001    fp = 0x46f396bc
     sp = 0x471ff7e0    pc = 0x4dea8db9
    Found by: call frame info
 4  libxul.so!nsThread::ProcessNextEvent(bool, bool*) [nsThread.cpp:8331bffe6d8c : 766 + 0xb]
     r4 = 0x46f39680    r5 = 0x471ff7f8    r6 = 0x471ff804    r7 = 0x00000000
     r8 = 0x00000000    r9 = 0x471ff83f   r10 = 0x00000001    fp = 0x46f396bc
     sp = 0x471ff7e8    pc = 0x4cfc7a69
    Found by: call frame info
 5  libxul.so!NS_ProcessNextEvent(nsIThread*, bool) [nsThreadUtils.cpp:8331bffe6d8c : 263 + 0xd]
     r4 = 0x46f39680    r5 = 0x00000000    r6 = 0x46f01fe8    r7 = 0x00000001
     r8 = 0x4f419f6c    r9 = 0x46f01fe0   r10 = 0x471ff8ec    fp = 0x00000000
     sp = 0x471ff838    pc = 0x4cf7d9a3
    Found by: call frame info
 6  libxul.so!mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) [MessagePump.cpp:8331bffe6d8c : 95 + 0x7]
     r4 = 0x46f01fd0    r5 = 0x46f5f0c0    r6 = 0x46f01fe8    r7 = 0x00000001
     r8 = 0x4f419f6c    r9 = 0x46f01fe0   r10 = 0x471ff8ec    fp = 0x00000000
     sp = 0x471ff850    pc = 0x4d19e6df
    Found by: call frame info
 7  libxul.so!MessageLoop::RunInternal() [message_loop.cc:8331bffe6d8c : 229 + 0x7]
     r4 = 0x46f5f0c0    r5 = 0x46f29f20    r6 = 0x46f39680    r7 = 0x471ff8f0
     r8 = 0x471ffac5    r9 = 0x471ff900   r10 = 0x471ff8ec    fp = 0x00000000
     sp = 0x471ff880    pc = 0x4d1824f3
    Found by: call frame info
 8  libxul.so!MessageLoop::Run() [message_loop.cc:8331bffe6d8c : 222 + 0x5]
     r4 = 0x46f5f0c0    r5 = 0x46f29f20    r6 = 0x46f39680    r7 = 0x471ff8f0
     r8 = 0x471ffac5    r9 = 0x471ff900   r10 = 0x471ff8ec    fp = 0x00000000
     sp = 0x471ff898    pc = 0x4d182531
    Found by: call frame info
 9  libxul.so!nsBaseAppShell::Run() [nsBaseAppShell.cpp:8331bffe6d8c : 164 + 0x7]
     r4 = 0x00000000    r5 = 0x46f29f20    r6 = 0x46f39680    r7 = 0x471ff8f0
     r8 = 0x471ffac5    r9 = 0x471ff900   r10 = 0x471ff8ec    fp = 0x00000000
     sp = 0x471ff8b0    pc = 0x4d88cd7d
    Found by: call frame info
10  libxul.so!nsAppStartup::Run() [nsAppStartup.cpp:8331bffe6d8c : 278 + 0x9]
     r4 = 0x5200bc40    r5 = 0x471ff9d4    r6 = 0x00000000    r7 = 0x471ff8f0
     r8 = 0x471ffac5    r9 = 0x471ff900   r10 = 0x471ff8ec    fp = 0x00000000
     sp = 0x471ff8c8    pc = 0x4e1b784f
    Found by: call frame info
11  libxul.so!XREMain::XRE_mainRun() [nsAppRunner.cpp:8331bffe6d8c : 4011 + 0xb]
     r4 = 0x471ff908    r5 = 0x471ff9d4    r6 = 0x00000000    r7 = 0x471ff8f0
     r8 = 0x471ffac5    r9 = 0x471ff900   r10 = 0x471ff8ec    fp = 0x00000000
     sp = 0x471ff8d8    pc = 0x4e162441
    Found by: call frame info


Are those helpful? I'm happy to do printf-style debugging if someone will point me in the right direction.
The presence of CharSetChangingRunnable::Run in the stack is interesting.  That there's a charset change happening could be Android-specific, and triggering one on other platforms might show the assertion, perhaps?
Annotated to expect 2 assertions on Android, for now: https://hg.mozilla.org/integration/mozilla-inbound/rev/949639a7ffe8
Whiteboard: [leave open]
(In reply to David Baron [:dbaron] (UTC-7) (needinfo? for questions) from comment #5)
> The presence of CharSetChangingRunnable::Run in the stack is interesting. 
> That there's a charset change happening could be Android-specific, and
> triggering one on other platforms might show the assertion, perhaps?

I checked on Linux and Windows and found that CharSetChangingRunnables run during this test on all platforms; they all seem to run the same way, but only Android finds the old rule node in nsStyleSet::EndReconstruct().
Assignee: gbrown → nobody
FWIW, while working on different bug I noticed that the fix there caused the assertion count
for download-3-notref.html to go from 2 to 4.  At the same time, the test that follows
immediately after it, download-3-ref.html, got 4 occurrences of a new assertion:

ASSERTION: destroying style context from old rule tree too late: 'styleSet->GetRuleTree() == mRuleNode->RuleTree() || styleSet->IsInRuleTreeReconstruct()', layout/style/nsStyleContext.cpp, line 91

I have a feeling the assertions might be related somehow.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.