Closed Bug 935672 Opened 9 years ago Closed 9 years ago

Tests crash on retina displays

Categories

(Core :: Graphics, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
1.3 Sprint 5 - 11/22

People

(Reporter: daleharvey, Assigned: daleharvey)

References

Details

(Whiteboard: [systemsfe][qa-])

Attachments

(1 file, 5 obsolete files)

No description provided.
Process:         b2g [53786]
Path:            /Volumes/VOLUME/*/b2g-bin
Identifier:      org.mozilla.b2g
Version:         28.0a1 (28.0a1)
Code Type:       X86-64 (Native)
Parent Process:  node [53784]
Responsible:     iTerm [584]
User ID:         502

Date/Time:       2013-11-05 17:37:17.909 -0800
OS Version:      Mac OS X 10.9 (13A2093)
Report Version:  11
Anonymous UUID:  6DC2C02C-4BD7-77A3-79B7-767251821F69

Sleep/Wake UUID: 15A21D6A-65D6-4DD0-AE5C-3E5253985B35

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000

VM Regions Near 0:
--> 
    __TEXT                 0000000100000000-0000000100002000 [    8K] r-x/rwx SM=COW  /Users/USER/*/B2GDebug.app/Contents/MacOS/b2g

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libmozalloc.dylib             	0x0000000100092a21 mozalloc_abort(char const*) + 81 (mozalloc_abort.cpp:30)
1   libmozalloc.dylib             	0x0000000100092a50 abort + 16 (mozalloc_oom.cpp:29)
2   XUL                           	0x0000000103854ff9 mozilla::gfx::DrawTargetCG::DrawSurface(mozilla::gfx::SourceSurface*, mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::RectTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::DrawSurfaceOptions const&, mozilla::gfx::DrawOptions const&) + 937
3   XUL                           	0x0000000101dbdd3b mozilla::dom::CanvasRenderingContext2D::Demote() + 347 (nsTArray.h:371)
4   XUL                           	0x0000000101dbe034 mozilla::dom::CanvasRenderingContext2D::EnsureTarget() + 372 (CanvasRenderingContext2D.cpp:794)
5   XUL                           	0x0000000101dc6a2b mozilla::dom::CanvasRenderingContext2D::DrawImage(mozilla::dom::HTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement const&, double, double, double, double, double, double, double, double, unsigned char, mozilla::ErrorResult&) + 155 (UnionTypes.h:1170)
6   XUL                           	0x0000000102cc7b7e mozilla::dom::CanvasRenderingContext2DBinding::drawImage(JSContext*, JS::Handle<JSObject*>, mozilla::dom::CanvasRenderingContext2D*, JSJitMethodCallArgs const&) + 3038 (ErrorResult.h:103)
7   XUL                           	0x0000000102cc3dbd mozilla::dom::CanvasRenderingContext2DBinding::genericMethod(JSContext*, unsigned int, JS::Value*) + 221 (.CanvasRenderingContext2DBinding.cpp:4381)
8   ???                           	0x00000001167e0144 0 + 4672323908
9   ???                           	0x0000000116f4f368 0 + 4680119144
10  ???                           	0x00000001007b287b 0 + 4303038587
11  XUL                           	0x0000000103d6f7c9 EnterBaseline(JSContext*, js::jit::EnterJitData&) + 553 (BaselineJIT.cpp:124)
12  XUL                           	0x0000000103d6f4dd js::jit::EnterBaselineMethod(JSContext*, js::RunState&) + 221 (BaselineJIT.cpp:153)
13  XUL                           	0x0000000103c04025 js::RunScript(JSContext*, js::RunState&) + 213 (Interpreter.cpp:399)
14  XUL                           	0x0000000103c12ceb js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) + 587 (Interpreter.cpp:482)
15  XUL                           	0x0000000103c13394 js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) + 452 (Interpreter.cpp:513)
16  XUL                           	0x0000000103d49f99 js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) + 2473 (BaselineIC.cpp:7672)
17  ???                           	0x00000001007ba333 0 + 4303070003
18  ???                           	0x0000000115fc0490 0 + 4663805072
19  ???                           	0x00000001007b287b 0 + 4303038587
20  XUL                           	0x0000000103d6f7c9 EnterBaseline(JSContext*, js::jit::EnterJitData&) + 553 (BaselineJIT.cpp:124)
21  XUL                           	0x0000000103d6f4dd js::jit::EnterBaselineMethod(JSContext*, js::RunState&) + 221 (BaselineJIT.cpp:153)
22  XUL                           	0x0000000103c04025 js::RunScript(JSContext*, js::RunState&) + 213 (Interpreter.cpp:399)
23  XUL                           	0x0000000103c12ceb js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) + 587 (Interpreter.cpp:482)
24  XUL                           	0x0000000103c13394 js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) + 452 (Interpreter.cpp:513)
25  XUL                           	0x0000000103d49f99 js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) + 2473 (BaselineIC.cpp:7672)
26  ???                           	0x00000001007ba333 0 + 4303070003
27  ???                           	0x000000010d3cf190 0 + 4517065104
28  ???                           	0x00000001007b287b 0 + 4303038587
29  XUL                           	0x0000000103d6f7c9 EnterBaseline(JSContext*, js::jit::EnterJitData&) + 553 (BaselineJIT.cpp:124)
30  XUL                           	0x0000000103d6f4dd js::jit::EnterBaselineMethod(JSContext*, js::RunState&) + 221 (BaselineJIT.cpp:153)
31  XUL                           	0x0000000103c04025 js::RunScript(JSContext*, js::RunState&) + 213 (Interpreter.cpp:399)
32  XUL                           	0x0000000103c12ceb js::Invoke(JSContext*, JS::CallArgs, js::MaybeConstruct) + 587 (Interpreter.cpp:482)
33  XUL                           	0x0000000103c13394 js::Invoke(JSContext*, JS::Value const&, JS::Value const&, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) + 452 (Interpreter.cpp:513)
34  XUL                           	0x0000000103a779de JS_CallFunctionValue(JSContext*, JSObject*, JS::Value, unsigned int, JS::Value*, JS::Value*) + 430 (jsapi.cpp:4906)
35  XUL                           	0x0000000102d61bdb mozilla::dom::EventHandlerNonNull::Call(JSContext*, JS::Handle<JSObject*>, nsDOMEvent&, mozilla::ErrorResult&) + 491 (.EventHandlerBinding.cpp:37)
36  XUL                           	0x000000010221ae7c JS::Value mozilla::dom::EventHandlerNonNull::Call<nsISupports*>(nsISupports* const&, nsDOMEvent&, mozilla::ErrorResult&, mozilla::dom::CallbackObject::ExceptionHandling) + 220 (EventHandlerBinding.h:59)
37  XUL                           	0x0000000102219f73 nsJSEventListener::HandleEvent(nsIDOMEvent*) + 883 (ErrorResult.h:125)
38  XUL                           	0x0000000101e502ec nsEventListenerManager::HandleEventSubType(nsListenerStruct*, mozilla::dom::CallbackObjectHolder<mozilla::dom::EventListener, nsIDOMEventListener> const&, nsIDOMEvent*, mozilla::dom::EventTarget*, nsCxPusher*) + 140 (nsEventListenerManager.cpp:955)
39  XUL                           	0x0000000101e50720 nsEventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, nsIDOMEvent**, mozilla::dom::EventTarget*, nsEventStatus*, nsCxPusher*) + 864 (nsEventListenerManager.cpp:1029)
40  XUL                           	0x0000000101e4c0ca nsEventTargetChainItem::HandleEvent(nsEventChainPostVisitor&, ELMCreationDetector&, nsCxPusher*) + 474 (nsEventDispatcher.cpp:198)
41  XUL                           	0x0000000101e494cc nsEventTargetChainItem::HandleEventTargetChain(nsTArray<nsEventTargetChainItem>&, nsEventChainPostVisitor&, nsDispatchingCallback*, ELMCreationDetector&, nsCxPusher*) + 524 (nsEventDispatcher.cpp:294)
42  XUL                           	0x0000000101e4acb3 nsEventDispatcher::Dispatch(nsISupports*, nsPresContext*, mozilla::WidgetEvent*, nsIDOMEvent*, nsEventStatus*, nsDispatchingCallback*, nsCOMArray<mozilla::dom::EventTarget>*) + 4643 (nsEventDispatcher.cpp:611)
43  XUL                           	0x0000000101e4b31c nsEventDispatcher::DispatchDOMEvent(nsISupports*, mozilla::WidgetEvent*, nsIDOMEvent*, nsPresContext*, nsEventStatus*) + 300 (nsEventDispatcher.cpp:679)
44  XUL                           	0x0000000101d40cdb nsINode::DispatchEvent(nsIDOMEvent*, bool*) + 203 (nsINode.cpp:1137)
45  XUL                           	0x0000000101c9d3e9 nsContentUtils::DispatchEvent(nsIDocument*, nsISupports*, nsAString_internal const&, bool, bool, bool, bool*) + 201 (nsContentUtils.cpp:3395)
46  XUL                           	0x0000000101c9d30e nsContentUtils::DispatchTrustedEvent(nsIDocument*, nsISupports*, nsAString_internal const&, bool, bool, bool*) + 30 (nsContentUtils.cpp:3365)
47  XUL                           	0x0000000101e12eb7 nsAsyncDOMEvent::Run() + 663 (nsAsyncDOMEvent.cpp:57)
48  XUL                           	0x000000010319057e nsThread::ProcessNextEvent(bool, bool*) + 1438 (nsThread.cpp:622)
49  XUL                           	0x000000010313057d NS_ProcessPendingEvents(nsIThread*, unsigned int) + 77 (nsThreadUtils.cpp:201)
50  XUL                           	0x0000000102971eba nsBaseAppShell::NativeEventCallback() + 106 (nsBaseAppShell.cpp:96)
51  XUL                           	0x00000001028f9bbf nsAppShell::ProcessGeckoEvents(void*) + 191 (nsAppShell.mm:389)
52  com.apple.CoreFoundation      	0x00007fff8a1518f1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
53  com.apple.CoreFoundation      	0x00007fff8a143062 __CFRunLoopDoSources0 + 242
54  com.apple.CoreFoundation      	0x00007fff8a1427ef __CFRunLoopRun + 831
55  com.apple.CoreFoundation      	0x00007fff8a142275 CFRunLoopRunSpecific + 309
56  com.apple.HIToolbox           	0x00007fff9180cf0d RunCurrentEventLoopInMode + 226
57  com.apple.HIToolbox           	0x00007fff9180ccb7 ReceiveNextEventCommon + 479
58  com.apple.HIToolbox           	0x00007fff9180cabc _BlockUntilNextEventMatchingListInModeWithFilter + 65
59  com.apple.AppKit              	0x00007fff85be328e _DPSNextEvent + 1434
60  com.apple.AppKit              	0x00007fff85be28db -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
61  XUL                           	0x00000001028f8c16 -[GeckoNSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 86 (nsAppShell.mm:165)
62  com.apple.AppKit              	0x00007fff85bd69cc -[NSApplication run] + 553
63  XUL                           	0x00000001028fa1fe nsAppShell::Run() + 94 (nsAppShell.mm:742)
64  XUL                           	0x0000000102769c62 nsAppStartup::Run() + 130 (nsAppStartup.cpp:268)
65  XUL                           	0x00000001014de262 XREMain::XRE_mainRun() + 5618 (nsAppRunner.cpp:3976)
66  XUL                           	0x00000001014de8b5 XREMain::XRE_main(int, char**, nsXREAppData const*) + 277 (nsAppRunner.cpp:4044)
67  XUL                           	0x00000001014dec56 XRE_main + 230 (nsAppRunner.cpp:4246)
68  b2g-bin                       	0x0000000100000eb1 main + 913 (nsBrowserApp.cpp:168)
69  b2g-bin                       	0x0000000100000b14 start + 52
As far as we can tell, it seems to be related to the automated launching of an app on retina displays, launching b2g manually works fine so it may be a timing problem

The issue comes up with both prebuilt images installed by the tests and custom builds, curiously it also crashes when run under virtualbox
Found that a build made around the 24th passes, bisecting regression range now
Bisected the regression down to 

https://bugzilla.mozilla.org/show_bug.cgi?id=923961
Component: JSMarionette → Graphics
Product: Testing → Core
ok confirmed reverting the above fixes the crash, I attempted disabling hardware acceleration via

$ git diff
diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js
index af6ea1b..5b2ca88 100644
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -258,7 +258,7 @@ pref("layers.async-video.enabled", false);
 #else
 pref("dom.ipc.tabs.disabled", false);
 pref("layers.offmainthreadcomposition.enabled", true);
-pref("layers.acceleration.disabled", false);
+pref("layers.acceleration.disabled", true);
 pref("layers.offmainthreadcomposition.async-animations", true);
 pref("layers.async-video.enabled", true);
 pref("layers.async-pan-zoom.enabled", true);
@@ -366,7 +366,7 @@ pref("security.apps.certified.CSP.default", "default-src *; script-src 'self'; o
 // Temporarily force-enable GL compositing.  This is default-disabled
 // deep within the bowels of the widgetry system.  Remove me when GL
 // compositing isn't default disabled in widget/android.
-pref("layers.acceleration.force-enabled", true);
+pref("layers.acceleration.force-enabled", false);


however that didnt seem to have any effect (with a clean profile)
What should we do here?  Back out bug 923961 or try to fix this?  I can't tell which of the two is more important.
Depends on: 923961
Flags: needinfo?(mrbkap)
Flags: needinfo?(anygregor)
(In reply to Milan Sreckovic [:milan] from comment #6)
> What should we do here?  Back out bug 923961 or try to fix this?  I can't
> tell which of the two is more important.

OOP b2g-desktop is crucial for our development but in this case I think we should back out so gaia devs can run tests.
We should still try to fix it asap.
Flags: needinfo?(anygregor)
Backing out also means we are very likely to regress it again and all our hard work debugging and fixing was for nothing. Milan, how fast can someone take a look here?
Flags: needinfo?(milan)
Blocks: 914584
This is one of those trick questions, I can tell.  Markus, any chance you can take a look?  You reviewed the original fix, perhaps we're very close.
Flags: needinfo?(milan) → needinfo?(mstange)
Looks like we're trying to paint a GL SourceSurfaceSkia into a DrawTargetCG, and DrawTargetCG can't handle that.

Why are we using accelerated Skia for canvas in B2G Desktop Mac builds? Can we turn it off?
Flags: needinfo?(mstange)
I asked mstange on IRC for the switches:
mstange: gwagner: probably gfx.content.azure.backends and gfx.content.azure.accelerated
[08:07am] mstange: gwagner: try setting it to "cg" and false
It sounds like Gregor can actually reproduce this, so clearing the needinfo request on me.
Flags: needinfo?(mrbkap)
Assignee: nobody → dale
Attachment #830321 - Flags: review?(mstange)
Suggested config changes fixes the crash, I assume we will only want those changes on desktop, not on device right?
(In reply to Dale Harvey (:daleharvey) from comment #14)
> Suggested config changes fixes the crash, I assume we will only want those
> changes on desktop, not on device right?

Yes, and thanks for the patch.  We want accelerated ski on b2g devices (or, if we don't, it will be for different reasons, in a different bug.)
Comment on attachment 830321 [details] [diff] [review]
Turn off accelerated skia on b2g desktop

This looks reversed to me. Also, I think you can leave out the non-Gonk case because that should already get the right prefs through /modules/libpref/src/init/all.js .
CoreGraphics ("cg") is only available on Mac OS X, so even if the #ifdefs in this patch were reversed, this patch wouldn't work on non-Mac. But all.js already deals with that, so if you remove the non-Gonk case it should just work.
Attachment #830321 - Flags: review?(mstange) → review-
Apologies, was supposed to be an ifdef not ifndef and didnt realise all.js would handle platform support, cheers
Attachment #830321 - Attachment is obsolete: true
Attachment #830337 - Flags: review?(mstange)
Any chance of a review on this? cheers
Flags: needinfo?(mstange)
Switching away from SkiaGL seems a bit like wallpapering over the problem.

I'm not sure what the preferred behaviour is, to match the canvas renderer we use on device, or match the renderer used by desktop firefox.

But it should work either way :)

I think the problem is that Demote (http://mxr.mozilla.org/mozilla-central/source/content/canvas/src/CanvasRenderingContext2D.cpp#739) is expecting both the old and the new DrawTargets to be BACKEND_SKIA, but the old one has GL enabled and the new one doesn't.

Instead we're getting a BACKEND_COREGRAPHICS DrawTarget for the new one, and interop between DT types isn't supported.

Someone should debug the 'EnsureTarget' call in this function, and figure out why it's not creating a software skia DrawTarget. I think the right solution is to find and fix this, and add an assert that mTarget->Backend() == BACKEND_SKIA after the EnsureTarget call.

It's possible (but I don't see a reason) that we might want to support switching from SkiaGL to CG when demoting, in which case we'd need to add explicit code to handle the interop between types.
Realised I misread the review comments from the previous review, fixed now

As for the above comment, I think we should likely open a new bug for it as this is currently preventing gaia developers from being able to test properly
Attachment #830337 - Attachment is obsolete: true
Attachment #830337 - Flags: review?(mstange)
Attachment #832686 - Flags: review?(mstange)
(In reply to Matt Woodrow (:mattwoodrow) from comment #19)
> Switching away from SkiaGL seems a bit like wallpapering over the problem.

This is true. Our immediate goal here is to have multiprocess b2g-desktop working so that we (including developers with retina displays) can run tests on them. I'll file a followup bug to investigate the rest of your comment.
(In reply to Blake Kaplan (:mrbkap) from comment #21)
> on them. I'll file a followup bug to investigate the rest of your comment.

I filed bug 938978.
Comment on attachment 832686 [details] [diff] [review]
Only use accelerated skia on gonk

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

::: b2g/app/b2g.js
@@ -261,5 @@
>  pref("layers.acceleration.disabled", false);
>  pref("layers.offmainthreadcomposition.async-animations", true);
>  pref("layers.async-video.enabled", true);
>  pref("layers.async-pan-zoom.enabled", true);
> -pref("gfx.content.azure.backends", "cairo");

I think we want to leave this here.
Attachment #832686 - Flags: review?(mstange) → review+
Didnt notice canvas vs content and thought it was duplicated, taken out, carried r+, cheers
Attachment #832686 - Attachment is obsolete: true
Attachment #832736 - Flags: review+
Flags: needinfo?(mstange)
Whiteboard: [systemsfe]
Target Milestone: --- → 1.3 Sprint 5 - 11/22
Lets disable this one test and land again.
Pretty confused here, if I run this test locally (osx b2g desktop), all passes on m-c, apply the patch then I get 12 failures from the line-dashes test and not this one

Also it doesnt seem to make sense for this to fail with the patch as it means we revert to the default backend which already has this test passing (navigator.platform is MacIntel on b2g desktop on osx, so cant just sniff if with that)
So this test should be disabled on linux already, however it seems like navigator.platform may be reporting '' on linux b2g desktop builds
The failing test is supposed to be disabled, however navigator.platform reports '' on b2g desktop on Linux, the test specifies the problem being with the backend which it already tested for so removing the additional failing IsLinux test seemed reasonable
Attachment #832736 - Attachment is obsolete: true
Attachment #8335748 - Flags: review?(matt.woodrow)
I don't see why this is ok. We should fix navigator.platform if it's returning bogus results.
Yeh my instinct was the same, just wanted to check as it may be a complex fix and disabling the test seemed somewhat reasonable
Depends on: 941410
No longer depends on: 923961
Changed the IsLinux check to use app-info service which will report the correct platform, navigator.platform is '' by design as referred to in previous bug.
Attachment #8335748 - Attachment is obsolete: true
Attachment #8335748 - Flags: review?(matt.woodrow)
Attachment #8335968 - Flags: review?(matt.woodrow)
Attachment #8335968 - Flags: review?(matt.woodrow) → review+
https://hg.mozilla.org/mozilla-central/rev/fdb358b6232d
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [systemsfe] → [systemsfe][qa-]
You need to log in before you can comment on or make changes to this bug.