Closed Bug 910521 Opened 11 years ago Closed 9 years ago

Intermittent test_printpreview_bug396024.xul | application crashed [@ nsPrincipal::GetAppId(unsigned int*)] after "Assertion failure: false, at ../../../caps/src/nsPrincipal.cpp:446"

Categories

(Core :: Permission Manager, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: RyanVM, Unassigned)

References

Details

(Keywords: assertion, crash, intermittent-failure)

https://tbpl.mozilla.org/php/getParsedLog.php?id=27131207&tree=Mozilla-Inbound

Ubuntu VM 12.04 mozilla-inbound debug test mochitest-other on 2013-08-28 12:09:49 PDT for push 25a5b706d2dc
slave: tst-linux32-ec2-072

12:25:06     INFO -  12999 INFO TEST-START | chrome://mochitests/content/chrome/layout/base/tests/chrome/test_printpreview_bug396024.xul
12:25:06     INFO -  ++DOMWINDOW == 93 (0x8b55070) [serial = 2709] [outer = 0xa4abb90]
12:25:06     INFO -  ++DOCSHELL 0xb7bcb48 == 12 [id = 516]
12:25:06     INFO -  ++DOMWINDOW == 94 (0x91c8498) [serial = 2710] [outer = (nil)]
12:25:06     INFO -  ++DOMWINDOW == 95 (0xc1b1808) [serial = 2711] [outer = 0x91c8498]
12:25:06     INFO -  ++DOCSHELL 0xb4cbe08 == 13 [id = 517]
12:25:06     INFO -  ++DOMWINDOW == 96 (0xc007e80) [serial = 2712] [outer = (nil)]
12:25:06     INFO -  ++DOCSHELL 0xcc99aa0 == 14 [id = 518]
12:25:06     INFO -  ++DOMWINDOW == 97 (0xb324208) [serial = 2713] [outer = (nil)]
12:25:06     INFO -  [Parent 2390] WARNING: OpenGL-accelerated layers are not supported on this system: file ../../../widget/xpwidgets/nsBaseWidget.cpp, line 889
12:25:06     INFO -  ++DOMWINDOW == 98 (0xc139a08) [serial = 2714] [outer = 0xc007e80]
12:25:06     INFO -  ++DOMWINDOW == 99 (0xbb80dc0) [serial = 2715] [outer = 0xb324208]
12:25:06     INFO -  [Parent 2390] WARNING: Using docshell.printPreview is the preferred way for print previewing!: 'IsInitializedForPrintPreview()', file ../../../layout/base/nsDocumentViewer.cpp, line 3708
12:25:06     INFO -  ++DOMWINDOW == 100 (0xc83eb80) [serial = 2716] [outer = 0xb324208]
12:25:06     INFO -  13000 INFO TEST-PASS | chrome://mochitests/content/chrome/layout/base/tests/chrome/test_printpreview_bug396024.xul | Should be doing print preview
12:25:06     INFO -  13001 INFO TEST-PASS | chrome://mochitests/content/chrome/layout/base/tests/chrome/test_printpreview_bug396024.xul | Should not be doing print preview anymore1
12:25:06     INFO -  [Parent 2390] WARNING: Using docshell.printPreview is the preferred way for print previewing!: 'IsInitializedForPrintPreview()', file ../../../layout/base/nsDocumentViewer.cpp, line 3708
12:25:06     INFO -  ++DOMWINDOW == 101 (0xb791330) [serial = 2717] [outer = 0xb324208]
12:25:06     INFO -  ++DOMWINDOW == 102 (0xa463540) [serial = 2718] [outer = 0xc007e80]
12:25:07     INFO -  13002 INFO TEST-PASS | chrome://mochitests/content/chrome/layout/base/tests/chrome/test_printpreview_bug396024.xul | Should be doing print preview
12:25:07     INFO -  ++DOCSHELL 0xb67bb58 == 15 [id = 519]
12:25:07     INFO -  ++DOMWINDOW == 103 (0xba5c6c8) [serial = 2719] [outer = (nil)]
12:25:07     INFO -  ++DOMWINDOW == 104 (0xb84d100) [serial = 2720] [outer = 0xba5c6c8]
12:25:07     INFO -  13003 INFO TEST-PASS | chrome://mochitests/content/chrome/layout/base/tests/chrome/test_printpreview_bug396024.xul | Should not be doing print preview anymore2
12:25:07     INFO -  ++DOMWINDOW == 105 (0xbee7e18) [serial = 2721] [outer = 0xba5c6c8]
12:25:07     INFO -  --DOCSHELL 0xb4cbe08 == 14 [id = 517]
12:25:07     INFO -  --DOCSHELL 0xbed2098 == 13 [id = 510]
12:25:08     INFO -  --DOMWINDOW == 104 (0x9055d18) [serial = 2628] [outer = (nil)] [url = chrome://mochitests/content/chrome/layout/base/tests/chrome/no_clip_iframe_subdoc.html]
12:25:08     INFO -  --DOMWINDOW == 103 (0xbb25620) [serial = 2626] [outer = (nil)] [url = about:blank]
12:25:08     INFO -  --DOMWINDOW == 102 (0xb65e8a8) [serial = 2604] [outer = (nil)] [url = about:blank]
12:25:08     INFO -  --DOMWINDOW == 101 (0xa5f6ba8) [serial = 2614] [outer = (nil)] [url = about:blank]
12:25:08     INFO -  --DOMWINDOW == 100 (0xc87e8e0) [serial = 2624] [outer = (nil)] [url = chrome://mochitests/content/chrome/layout/base/tests/chrome/test_no_clip_iframe.xul]
12:25:08     INFO -  --DOMWINDOW == 99 (0xc5edd10) [serial = 2602] [outer = (nil)] [url = chrome://mochitests/content/chrome/layout/base/tests/chrome/test_leaf_layers_partition_browser_window.xul]
12:25:08     INFO -  --DOMWINDOW == 98 (0xc56b238) [serial = 2650] [outer = 0xbe79258] [url = about:blank]
12:25:08     INFO -  [Parent 2390] WARNING: Using docshell.printPreview is the preferred way for print previewing!: 'IsInitializedForPrintPreview()', file ../../../layout/base/nsDocumentViewer.cpp, line 3708
12:25:08     INFO -  ++DOMWINDOW == 99 (0xbdd88b8) [serial = 2722] [outer = 0xba5c6c8]
12:25:08     INFO -  Assertion failure: false, at ../../../caps/src/nsPrincipal.cpp:446
12:25:08     INFO -  WARNING: shutting down early because of crash!: file ../../../../dom/plugins/ipc/PluginModuleChild.cpp, line 703
12:25:08     INFO -  WARNING: plugin process _exit()ing: file ../../../../dom/plugins/ipc/PluginModuleChild.cpp, line 668
12:25:08  WARNING -  TEST-UNEXPECTED-FAIL | chrome://mochitests/content/chrome/layout/base/tests/chrome/test_printpreview_bug396024.xul | Exited with code 11 during test run
12:25:08     INFO -  INFO | automation.py | Application ran for: 0:12:36.026771
12:25:08     INFO -  INFO | zombiecheck | Reading PID log: /tmp/tmpxz3KrYpidlog
12:25:08     INFO -  ==> process 2390 launched child process 2437
12:25:08     INFO -  ==> process 2390 launched child process 2442
12:25:08     INFO -  ==> process 2390 launched child process 2465
12:25:08     INFO -  ==> process 2390 launched child process 2475
12:25:08     INFO -  ==> process 2390 launched child process 2479
12:25:08     INFO -  ==> process 2390 launched child process 2483
12:25:08     INFO -  ==> process 2390 launched child process 2488
12:25:08     INFO -  INFO | zombiecheck | Checking for orphan process with PID: 2437
12:25:08     INFO -  INFO | zombiecheck | Checking for orphan process with PID: 2442
12:25:08     INFO -  INFO | zombiecheck | Checking for orphan process with PID: 2465
12:25:08     INFO -  INFO | zombiecheck | Checking for orphan process with PID: 2475
12:25:08     INFO -  INFO | zombiecheck | Checking for orphan process with PID: 2479
12:25:08     INFO -  INFO | zombiecheck | Checking for orphan process with PID: 2483
12:25:08     INFO -  INFO | zombiecheck | Checking for orphan process with PID: 2488
12:25:20  WARNING -  PROCESS-CRASH | chrome://mochitests/content/chrome/layout/base/tests/chrome/test_printpreview_bug396024.xul | application crashed [@ nsPrincipal::GetAppId(unsigned int*)]
12:25:20     INFO -  Crash dump filename: /tmp/tmptz7Pc0/minidumps/247f4da4-1840-5c90-6400d74e-045ed2c7.dmp
12:25:20     INFO -  Operating system: Linux
12:25:20     INFO -                    0.0.0 Linux 3.2.0-23-generic-pae #36-Ubuntu SMP Tue Apr 10 22:19:09 UTC 2012 i686
12:25:20     INFO -  CPU: x86
12:25:20     INFO -       GenuineIntel family 6 model 26 stepping 5
12:25:20     INFO -       1 CPU
12:25:20     INFO -  Crash reason:  SIGSEGV
12:25:20     INFO -  Crash address: 0x0
12:25:20     INFO -  Thread 0 (crashed)
12:25:20     INFO -   0  libxul.so!nsPrincipal::GetAppId(unsigned int*) [nsPrincipal.cpp:25a5b706d2dc : 446 + 0x19]
12:25:20     INFO -      eip = 0xb3a89706   esp = 0xbf8efe00   ebp = 0xbf8efe18   ebx = 0xb6b47000
12:25:20     INFO -      esi = 0x0c28e378   edi = 0x00000000   eax = 0x00000000   ecx = 0xb75a38ac
12:25:20     INFO -      edx = 0x00000000   efl = 0x00010286
12:25:20     INFO -      Found by: given as instruction pointer in context
12:25:20     INFO -   1  libxul.so!nsPermissionManager::CommonTestPermission(nsIPrincipal*, char const*, unsigned int*, bool, bool) [nsPermissionManager.cpp:25a5b706d2dc : 1104 + 0xe]
12:25:20     INFO -      eip = 0xb3ed8f63   esp = 0xbf8efe20   ebp = 0xbf8eff08   ebx = 0xb6b47000
12:25:20     INFO -      esi = 0x0c28e378   edi = 0x00000000
12:25:20     INFO -      Found by: call frame info
12:25:20     INFO -   2  libxul.so!nsPermissionManager::TestPermissionFromPrincipal(nsIPrincipal*, char const*, unsigned int*) [nsPermissionManager.cpp:25a5b706d2dc : 1021 + 0x12]
12:25:20     INFO -      eip = 0xb3ed9104   esp = 0xbf8eff10   ebp = 0xbf8eff48   ebx = 0xb6b47000
12:25:20     INFO -      esi = 0x0c28e378   edi = 0xbf8eff8c
12:25:20     INFO -      Found by: call frame info
12:25:20     INFO -   3  libxul.so!TestSitePerm [nsContentUtils.cpp:25a5b706d2dc : 2878 + 0x14]
12:25:20     INFO -      eip = 0xb355f227   esp = 0xbf8eff50   ebp = 0xbf8effa8   ebx = 0xb6b47000
12:25:20     INFO -      esi = 0x0c28e378   edi = 0xb53e77d8
12:25:20     INFO -      Found by: call frame info
12:25:20     INFO -   4  libxul.so!nsContentUtils::AllowXULXBLForPrincipal(nsIPrincipal*) [nsContentUtils.cpp:25a5b706d2dc : 5969 + 0xe]
12:25:20     INFO -      eip = 0xb3562982   esp = 0xbf8effb0   ebp = 0xbf8efff8   ebx = 0xb6b47000
12:25:20     INFO -      esi = 0x0c28e378   edi = 0xbf8effdc
12:25:20     INFO -      Found by: call frame info
12:25:20     INFO -   5  libxul.so!nsGlobalWindow::SetNewDocument(nsIDocument*, nsISupports*, bool) [nsGlobalWindow.cpp:25a5b706d2dc : 2075 + 0xd]
12:25:20     INFO -      eip = 0xb38d1902   esp = 0xbf8f0000   ebp = 0xbf8f00f8   ebx = 0xb6b47000
12:25:20     INFO -      esi = 0x0861bbb8   edi = 0x0ba5c660
12:25:20     INFO -      Found by: call frame info
12:25:20     INFO -   6  libxul.so!nsDocumentViewer::SetDocumentInternal(nsIDocument*, bool) [nsDocumentViewer.cpp:25a5b706d2dc : 1701 + 0x19]
12:25:20     INFO -      eip = 0xb32f076e   esp = 0xbf8f0100   ebp = 0xbf8f0168   ebx = 0xb6b47000
12:25:20     INFO -      esi = 0x0cd2e9a8   edi = 0xbf8f0134
12:25:20     INFO -      Found by: call frame info
Summary: Intermittent test_printpreview_bug396024.xul | Exited with code 11 during test run | application crashed [@ nsPrincipal::GetAppId(unsigned int*)] after "Assertion failure: false, at ../../../caps/src/nsPrincipal.cpp:446" → Intermittent test_printpreview_bug396024.xul | application crashed [@ nsPrincipal::GetAppId(unsigned int*)] after "Assertion failure: false, at ../../../caps/src/nsPrincipal.cpp:446"
Bobby?
Flags: needinfo?(bobbyholley+bmo)
So, this is that old "you can't ask a principal for its app ID if it's not in an app" issue.

Mounir, where do we go wrong in this callstack, exactly? It would be nice if it were better documented. Should nsPermissionManager::CommonTestPermission be called only for installed apps?
Flags: needinfo?(bobbyholley+bmo) → needinfo?(mounir)
(In reply to Bobby Holley (:bholley) from comment #34)
> So, this is that old "you can't ask a principal for its app ID if it's not
> in an app" issue.
> 
> Mounir, where do we go wrong in this callstack, exactly? It would be nice if
> it were better documented. Should nsPermissionManager::CommonTestPermission
> be called only for installed apps?

No. Apps will have an appId different from UNKNOWN_APP_ID and NO_APP_ID. In other words, > 0 (IIRC).

The assert is when the appId is UNKNOWN_APP_ID which is a way to say that we have no idea in which context this principal has been created. The ideal solution to fix this is to find out where this principal came from and set an appId that means something when it is created (NO_APP_ID being Firefox's appId). A less ideal solution would be to remove the assert and replace it with something less strong.
Flags: needinfo?(mounir)
Blocks: 856470
This is really a PITA. This same (?) issue bit us in bug 881996, and I had to figure out a workaround.

Who can own fixing this?
Flags: needinfo?(mounir)
Despite my protestations that he's too busy, Fabrice said to needinfo him.
Flags: needinfo?(fabrice)
Flags: needinfo?(mounir)
Fabrice - Ping. It's been a month since you were marked needinfo. Do you have some time to look at this bug?
Flags: needinfo?(fabrice)
^
Flags: needinfo?(fabrice)
Not anytime soon unfortunately :(
Flags: needinfo?(fabrice)
Andrew, any other ideas of who can take this bug?
Flags: needinfo?(overholt)
There haven't been TBPL posts about this in a while.  Is this still happening?
Flags: needinfo?(ryanvm)
Doesn't appear that way. Not sure what might have changed around 9-15 to make this go away. Dolske, are you still having issues with this anywhere?
Flags: needinfo?(ryanvm) → needinfo?(dolske)
It's not happening on TBPL because I managed to work around it in bug 839961, and because bug 856470 can't even land until this is fixed.
Flags: needinfo?(dolske)
Can you tell me how to reproduce this, Justin?

I tried reverting your workaround in bug 839961 [1] but the test still passes (I'm on Linux) with:

$ ./mach mochitest-chrome layout/base/tests/chrome/test_printpreview_bug396024.xul

[1]
https://bug839961.bugzilla.mozilla.org/attachment.cgi?id=763783
Flags: needinfo?(overholt) → needinfo?(dolske)
Either reverting the patch in bug 839961 or applying the patch in bug bug 881996 should reproduce it. I don't remember what platforms it affected or if it was only Try.
Flags: needinfo?(dolske)
Inactive; closing (see bug 1180138).
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.