[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in gfx::NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL during startup #123

Closed
FlutterIssues opened this issue Nov 9, 2015 · 8 comments
Labels
c: crash Stack traces logged to the console engine flutter/engine repository. See also e: labels. platform-android Android applications specifically

Comments

@FlutterIssues
Copy link

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:

@chinmaygarde @abarth

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
@FlutterIssues FlutterIssues added the c: crash Stack traces logged to the console label Nov 9, 2015
@FlutterIssues
Copy link
Author

Comment by eseidelGoogle
Friday Aug 07, 2015 at 21:24 GMT


Ok, yeah easily repeatable by spamming the "recent activities" button during startup.

@FlutterIssues
Copy link
Author

Comment by jamesr
Monday Aug 10, 2015 at 19:23 GMT


Maybe the ANativeWindow* died in between posting the On..Available task and it running?

@FlutterIssues
Copy link
Author

Comment by chinmaygarde
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::ReleaseWindow before 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
Copy link
Author

Comment by jamesr
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.

@Hixie Hixie modified the milestone: Blue Sky Dec 16, 2015
@Hixie Hixie added the engine flutter/engine repository. See also e: labels. label Dec 16, 2015
@eseidelGoogle eseidelGoogle added the platform-android Android applications specifically label May 13, 2016
@eseidelGoogle
Copy link
Contributor

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
Copy link
Contributor

I suspect this is long since fixed.

@chinmaygarde
Copy link
Member

I got rid of gfx entirely.
On Wed, Jul 13, 2016 at 8:29 AM Eric Seidel notifications@github.com
wrote:

I suspect this is long since fixed.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#123 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AACsNbnXDU82xL8XshKRN-b75o2J9pS-ks5qVQRugaJpZM4Ge7vx
.

@github-actions
Copy link

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 -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: crash Stack traces logged to the console engine flutter/engine repository. See also e: labels. platform-android Android applications specifically
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants