Last Comment Bug 776742 - FramebufferNativeWindow doesn't implement ANativeWindow::cancelBuffer
: FramebufferNativeWindow doesn't implement ANativeWindow::cancelBuffer
Product: Core
Classification: Components
Component: Widget: Gonk (show other bugs)
: Trunk
: ARM Gonk (Firefox OS)
-- normal (vote)
: mozilla17
Assigned To: Marshall Culpepper [:marshall_law]
Depends on: 776045
Blocks: b2g-gecko-updates
  Show dependency treegraph
Reported: 2012-07-23 15:54 PDT by Marshall Culpepper [:marshall_law]
Modified: 2014-03-14 00:43 PDT (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

cancelBuffer - v1 (2.64 KB, patch)
2012-07-23 16:06 PDT, Marshall Culpepper [:marshall_law]
cjones.bugs: review+
Details | Diff | Splinter Review
cancelBuffer - v1 (rebased) (1.46 KB, patch)
2012-08-06 09:17 PDT, Marshall Culpepper [:marshall_law]
no flags Details | Diff | Splinter Review

Description User image Marshall Culpepper [:marshall_law] 2012-07-23 15:54:33 PDT
On the emulator, When the b2g process tries to exit, a segfault happens when the emulator's EGL code tries to clean up it's internal buffers by calling eglCancelBuffer() -- unfortunately, ANativeWindow::cancelBuffer is not set by the FramebufferNativeWindow.

This is technically an AOSP bug, but we don't currently maintain forks of either platform_frameworks_base or platform_development (where this would be ideally fixed).

In the interest of maintainability, it is easy enough to set the cancelBuffer function pointer to a no-op so we can avoid segfaulting for now..
Comment 1 User image Marshall Culpepper [:marshall_law] 2012-07-23 16:06:03 PDT
Created attachment 645106 [details] [diff] [review]
cancelBuffer - v1
Comment 2 User image Marshall Culpepper [:marshall_law] 2012-07-23 16:09:13 PDT
I meant to say this happens in the EGL surface destructor. You can see the code in question here:

egl_window_surface_t destructor:

notice the missing set of cancelBuffer in FramebufferNativeWindow.cpp:
Comment 3 User image Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-07-23 16:14:28 PDT
Comment on attachment 645106 [details] [diff] [review]
cancelBuffer - v1

>diff --git a/widget/gonk/nsWindow.cpp b/widget/gonk/nsWindow.cpp

>+/* static */ int
>+nsWindow::CancelBufferNoop(ANativeWindow* aWindow, ANativeWindowBuffer* aBuffer)

Let's just make this a static function in this compilation unit,
not part of nsWindow.

r=me with that change.
Comment 4 User image :Ehsan Akhgari 2012-07-24 11:34:57 PDT
I backed out this patch because of build bustage:

Example build failure:
Comment 5 User image Marshall Culpepper [:marshall_law] 2012-07-24 11:52:59 PDT
Looks like this is environment related -- this definitely compiles locally in the B2G emulator config. Phil mentioned that the Tinderboxes aren't currently setup for ICS: Bug 776045
Comment 6 User image Marshall Culpepper [:marshall_law] 2012-08-06 09:17:57 PDT
Created attachment 649292 [details] [diff] [review]
cancelBuffer - v1 (rebased)
Comment 7 User image Marshall Culpepper [:marshall_law] 2012-08-06 10:55:48 PDT
I've confirmed this build error
Comment 8 User image Marshall Culpepper [:marshall_law] 2012-08-06 10:56:48 PDT
* I've confirmed this build error occurs because of the GB toolchain in Tinderbox. ICS based toolchains are building this patch just fine..
Comment 9 User image Marshall Culpepper [:marshall_law] 2012-08-07 13:56:42 PDT
Comment 10 User image Ed Morley [:emorley] 2012-08-08 09:33:07 PDT

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