Repository navigation
Crash in gfx::NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL during startup #123
Copy link
Copy link
Closed
Labels
c: crashStack traces logged to the consoleStack traces logged to the consoleengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-androidAndroid applications specificallyAndroid applications specifically
Description
Issue by eseidelGoogle
Friday Aug 07, 2015 at 21:23 GMT
Originally opened as https://github.com/flutter/engine/issues/507
gpu_thread crash during startup.
I started fitness app via shelldb:
sky/tools/shelldb start out/android_Debug sky/packages/sky/example/fitness/lib/main.dart
And right as I was doing so, I hit the recent activity button on my Nexus 5 and attempted to close the Asteroids.apk which was running behind it. I think that caused it to lose its gl context at a bad time.
Not sure if this is repeatable or if we care, but here is a stack:
signal 11 (SIGSEGV), code 1, fault addr 0x4 in tid 27952 (gpu_thread)
pid: 27932, tid: 27952, name: gpu_thread >>> org.domokit.sky.shell <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x4
r0 00000001 r1 00000004 r2 00000001 r3 b6b82d99
r4 00000004 r5 00000001 r6 b498b608 r7 aebff738
r8 b498b608 r9 aec26348 sl aebff848 fp b4894c68
ip b6deed84 sp aebff648 lr b6de6fb4 pc b6de6fb4
Stack Trace:
RELADDR FUNCTION FILE:LINE
00003fb4 android_atomic_add+16 /system/lib/libcutils.so
0000eb99 android::RefBase::incStrong(void const*) const+6 /system/lib/libutils.so
00008e7d ANativeWindow_acquire+4 /system/lib/libandroid.so
0026e4d9 gfx::NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL(ANativeWindow*, gfx::SurfaceConfiguration) /src/sky_engine/src/out/android_Debug/../../ui/gl/gl_surface_egl.cc:368
0026df71 gfx::GLSurface::CreateViewGLSurface(ANativeWindow*, gfx::SurfaceConfiguration const&) /src/sky_engine/src/out/android_Debug/../../ui/gl/gl_surface_android.cc:52 (discriminator 1)
002718b7 sky::shell::Rasterizer::OnAcceleratedWidgetAvailable(ANativeWindow*) /src/sky_engine/src/out/android_Debug/../../sky/shell/gpu/rasterizer.cc:41 (discriminator 1)
v------> base::Callback<void ()>::Run() const /src/sky_engine/src/out/android_Debug/../../base/callback.h:396 (discriminator 1)
002770c7 base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask const&) /src/sky_engine/src/out/android_Debug/../../base/debug/task_annotator.cc:49 (discriminator 1)
000a0083 base::MessageLoop::RunTask(base::PendingTask const&) /src/sky_engine/src/out/android_Debug/../../base/message_loop/message_loop.cc:481
000a04ef base::MessageLoop::DeferOrRunPendingTask(base::PendingTask const&) /src/sky_engine/src/out/android_Debug/../../base/message_loop/message_loop.cc:490
000a05cf base::MessageLoop::DoWork() /src/sky_engine/src/out/android_Debug/../../base/message_loop/message_loop.cc:602
000b4c19 mojo::common::MessagePumpMojo::DoRunLoop(mojo::common::MessagePumpMojo::RunState*, base::MessagePump::Delegate*) /src/sky_engine/src/out/android_Debug/../../mojo/common/message_pump_mojo.cc:159
000b4cfb mojo::common::MessagePumpMojo::Run(base::MessagePump::Delegate*) /src/sky_engine/src/out/android_Debug/../../mojo/common/message_pump_mojo.cc:123
000a13f1 base::MessageLoop::RunHandler() /src/sky_engine/src/out/android_Debug/../../base/message_loop/message_loop.cc:445 (discriminator 1)
000a48fd base::RunLoop::Run() /src/sky_engine/src/out/android_Debug/../../base/run_loop.cc:55
0009fe0f base::MessageLoop::Run() /src/sky_engine/src/out/android_Debug/../../base/message_loop/message_loop.cc:288
000abc85 base::Thread::ThreadMain() /src/sky_engine/src/out/android_Debug/../../base/threading/thread.cc:248
000ab06f ThreadFunc /src/sky_engine/src/out/android_Debug/../../base/threading/platform_thread_posix.cc:74
00016baf __pthread_start(void*)+30 /system/lib/libc.so
00014af3 __start_thread+6 /system/lib/libc.so
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
c: crashStack traces logged to the consoleStack traces logged to the consoleengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-androidAndroid applications specificallyAndroid applications specifically
Activity
FlutterIssues commentedon Nov 9, 2015
Friday Aug 07, 2015 at 21:24 GMT
Ok, yeah easily repeatable by spamming the "recent activities" button during startup.
FlutterIssues commentedon Nov 9, 2015
Monday Aug 10, 2015 at 19:23 GMT
Maybe the ANativeWindow* died in between posting the On..Available task and it running?
FlutterIssues commentedon Nov 9, 2015
Tuesday Aug 11, 2015 at 19:28 GMT
@eseidelGoogle https://github.com/domokit/sky_engine/blob/master/sky/shell/android/platform_view_android.cc#L63 is passing the Rasterizer an unretained reference. If the last reference is released via
PlatformViewAndroid::ReleaseWindowbefore the the GPU thread is able to create the GLSurface from the same, you would get a crash. I suggest passing the widget as a weak reference and check for the validity of the same when the rasterizer gets the onAcceleratedWidgetAvailable.FlutterIssues commentedon Nov 9, 2015
Tuesday Aug 11, 2015 at 19:53 GMT
I'm not seeing anything related to Rasterizer at that line. Weak refs don't work cross thread, which I believe this is trying to do, so we probably need a mutex guarded pointer that we check itself.
eseidelGoogle commentedon May 13, 2016
I was able to repro a crash by spamming the recent activities button during launch of a JIT (--debug) built app on Android just now:
I/DEBUG ( 186): Abort message: '[FATAL:rasterizer_direct.cc(59)] Check failed: surface_. GLSurface required.
@jason-simmons or @chinmaygarde would know.
The --release (aot) builds launch too fast to hit this.
eseidelGoogle commentedon Jul 13, 2016
I suspect this is long since fixed.
chinmaygarde commentedon Jul 13, 2016
I got rid of gfx entirely.
On Wed, Jul 13, 2016 at 8:29 AM Eric Seidel [email protected]
wrote:
Roll dart-sdk to 2.0.0-dev.16.0 (flutter#123)
github-actions commentedon Aug 17, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.