Last Comment Bug 738956 - test-page-mod.testHistory is triggering a compartment mismatch assertion in debug builds after the most recent inbound -> central merge
: test-page-mod.testHistory is triggering a compartment mismatch assertion in d...
Status: VERIFIED FIXED
[triage:followup]
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: unspecified
: All All
: P1 major (vote)
: mozilla14
Assigned To: Bobby Holley (:bholley) (busy with Stylo)
:
Mentors:
Depends on:
Blocks: 667388
  Show dependency treegraph
 
Reported: 2012-03-24 11:13 PDT by Wes Kocher (:KWierso)
Modified: 2012-03-28 16:59 PDT (History)
10 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Stack (21.37 KB, text/plain)
2012-03-25 13:36 PDT, :Ms2ger
no flags Details
Wrap values in nsStructuredCloneContainer::InitFromVariant before passing them to JS_WriteStructuredClone. v1 (2.36 KB, patch)
2012-03-25 19:52 PDT, Bobby Holley (:bholley) (busy with Stylo)
khuey: review+
justin.lebar+bug: feedback+
Details | Diff | Splinter Review

Description Wes Kocher (:KWierso) 2012-03-24 11:13:18 PDT
info: executing 'test-page-mod.testHistory'
++DOCSHELL 0xd5d5270 == 28 [id = 437]
++DOMWINDOW == 143 (0xec99ba8) [serial = 1054] [outer = (nil)]
++DOMWINDOW == 144 (0xe8b9308) [serial = 1055] [outer = 0xec99b60]
WARNING: NS_ENSURE_TRUE(mMutable) failed: file ../../../../netwerk/base/src/nsSimpleURI.cpp, line 293
++DOMWINDOW == 145 (0xee1a438) [serial = 1056] [outer = 0xec99b60]
*** Compartment mismatch 0xa65b920 vs. 0xe7bd5a0
Assertion failure: compartment mismatched, at ../../../js/src/jscntxtinlines.h:156
Traceback (most recent call last):
  File "bin/cfx", line 33, in <module>
    cuddlefish.run()
  File "/home/cltbld/talos-slave/test/build/addon-sdk-3ce8a0112619/python-lib/cuddlefish/__init__.py", line 517, in run
    test_all(env_root, defaults=options.__dict__)
  File "/home/cltbld/talos-slave/test/build/addon-sdk-3ce8a0112619/python-lib/cuddlefish/__init__.py", line 345, in test_all
    test_all_packages(env_root, defaults)
  File "/home/cltbld/talos-slave/test/build/addon-sdk-3ce8a0112619/python-lib/cuddlefish/__init__.py", line 408, in test_all_packages
    env_root=env_root)
  File "/home/cltbld/talos-slave/test/build/addon-sdk-3ce8a0112619/python-lib/cuddlefish/__init__.py", line 785, in run
    mobile_app_name=options.mobile_app_name)
  File "/home/cltbld/talos-slave/test/build/addon-sdk-3ce8a0112619/python-lib/cuddlefish/runner.py", line 663, in run_app
    OUTPUT_TIMEOUT)
Exception: Test output exceeded timeout (60s).
program finished with exit code 1


All of the debug builds finished so far from this merge have been asserting a compartment mismatch while running the testHistory SDK test: https://tbpl.mozilla.org/?noignore=1&jobname=jetpack&rev=20a01901480f
Comment 1 Wes Kocher (:KWierso) 2012-03-24 11:18:08 PDT
Jetpack tests don't seem to run on Inbound, so I can't see what individual push caused this.

If I had to guess, I'd say bug 667388 or bug 733984 since they deal with wrappers. But since this test is dealing with history, maybe the SQLite upgrade in bug 737807 is doing something differently?
Comment 2 :Ms2ger 2012-03-25 11:32:58 PDT
Where does this test live? I can't seem to find it in <https://github.com/mozilla/addon-sdk/tree/master/packages/api-utils/tests>
Comment 3 Wes Kocher (:KWierso) 2012-03-25 12:20:42 PDT
(In reply to Ms2ger from comment #2)
> Where does this test live? I can't seem to find it in
> <https://github.com/mozilla/addon-sdk/tree/master/packages/api-utils/tests>

https://github.com/mozilla/addon-sdk/blob/master/packages/addon-kit/tests/test-page-mod.js#L298
Comment 4 :Ms2ger 2012-03-25 13:36:18 PDT
Created attachment 609154 [details]
Stack

https://hg.mozilla.org/mozilla-central/pushloghtml?changeset=4c2c3a714ebe

Given that we assert under JSStructuredCloneWriter::startWrite, this looks like a regression from <https://hg.mozilla.org/mozilla-central/rev/1fb77c1bb742> (bug 667388). Bobby?
Comment 5 :Ms2ger 2012-03-25 13:41:29 PDT
For reference, STR:

git clone git://github.com/mozilla/addon-sdk.git
cd addon-sdk
source bin/activate
cfx -b /obj/dist/bin/firefox --filter test-page-mod --no-run testpkgs

This prints something like

Testing addon-kit...
Using binary at '/obj/dist/bin/firefox'.
Using profile at '/tmp/tmpnZt9ZQ.mozrunner'.
To launch the application, enter the following command:
/obj/dist/bin/firefox -profile /tmp/tmpnZt9ZQ.mozrunner -no-remote

(note: pick the one that mentions 'addon-kit'). Run

gdb --args /obj/dist/bin/firefox -profile /tmp/tmpnZt9ZQ.mozrunner -no-remote
Comment 6 Bobby Holley (:bholley) (busy with Stylo) 2012-03-25 18:50:57 PDT
investigating.
Comment 7 Bobby Holley (:bholley) (busy with Stylo) 2012-03-25 19:52:01 PDT
Created attachment 609195 [details] [diff] [review]
Wrap values in nsStructuredCloneContainer::InitFromVariant before passing them to JS_WriteStructuredClone. v1

Looks like I added the relevant assertSameCompartment, but the bug itself has been around for a while. Flagging jlebar for review, since it looks like he wrote the file.
Comment 8 Justin Lebar (not reading bugmail) 2012-03-26 09:14:51 PDT
> Looks like I added the relevant assertSameCompartment, but the bug itself
> has been around for a while. Flagging jlebar for review, since it looks like
> he wrote the file.

I have no idea if this is right.  Can mrbkap review?
Comment 9 Bobby Holley (:bholley) (busy with Stylo) 2012-03-26 11:09:57 PDT
Comment on attachment 609195 [details] [diff] [review]
Wrap values in nsStructuredCloneContainer::InitFromVariant before passing them to JS_WriteStructuredClone. v1

Kyle is sitting next to me, and will take this review.
Comment 10 Bobby Holley (:bholley) (busy with Stylo) 2012-03-26 22:20:55 PDT
Kyle, IIRC we decided this was ok given the circumstances (and various followups). Can you r+?
Comment 11 Kyle Huey [:khuey] (khuey@mozilla.com) 2012-03-27 11:38:54 PDT
Comment on attachment 609195 [details] [diff] [review]
Wrap values in nsStructuredCloneContainer::InitFromVariant before passing them to JS_WriteStructuredClone. v1

Review of attachment 609195 [details] [diff] [review]:
-----------------------------------------------------------------

Assuming we need to enter the compartment, we need to do this.
Comment 12 Bobby Holley (:bholley) (busy with Stylo) 2012-03-27 11:45:45 PDT
Pushed to m-i:

http://hg.mozilla.org/integration/mozilla-inbound/rev/90f6c3fe8638
Comment 13 Ed Morley [:emorley] 2012-03-28 14:20:35 PDT
https://hg.mozilla.org/mozilla-central/rev/90f6c3fe8638
Comment 14 Wes Kocher (:KWierso) 2012-03-28 16:59:44 PDT
And the Jetpack tests on all debug builds appear to be green, now. Thanks for the quick fix!

Note You need to log in before you can comment on or make changes to this bug.