Skip to content

linux can't run example app, i got libflutter_linux_glfw.so segfault error #47954

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

Closed
theyough opened this issue Dec 29, 2019 · 17 comments · Fixed by flutter/engine#16924
Closed
Labels
a: desktop Running on desktop c: crash Stack traces logged to the console e: glfw GLFW desktop embedding engine flutter/engine repository. See also e: labels. platform-linux Building on or for Linux specifically

Comments

@theyough
Copy link

Steps to Reproduce

  1. I cloned https://github.com/google/flutter-desktop-embedding and after following the "How To" i get an error

Target Platform: Linux
Target OS version/browser: Linux Ubuntu 18.04
Devices: emulator

Logs

flutter run --verbose

➜  example git:(master) ✗ flutter run -v      
[  +15 ms] executing: [/opt/flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +18 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] 841924e1615621df074fe8b2db6c771c9360715e
[        ] executing: [/opt/flutter/] git describe --match v*.*.* --first-parent --long --tags
[  +10 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[        ] v1.13.5-39-g841924e16
[   +6 ms] executing: [/opt/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[   +3 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/master
[        ] executing: [/opt/flutter/] git ls-remote --get-url origin
[   +3 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] git@github.com:flutter/flutter.git
[  +33 ms] executing: [/opt/flutter/] git rev-parse --abbrev-ref HEAD
[   +3 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] master
[  +20 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +1 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +16 ms] executing: /opt/Android/Sdk/platform-tools/adb devices -l
[   +3 ms] Exit code 0 from: /opt/Android/Sdk/platform-tools/adb devices -l
[        ] List of devices attached
[  +12 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +1 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +138 ms] Launching lib/main.dart on Linux in debug mode...
[   +8 ms] Building Linux application...
[   +1 ms] executing: make -C /opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux
BUILD=debug
[  +16 ms] make: Entering directory '/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux'
[        ] /opt/flutter/packages/flutter_tools/bin/tool_backend.sh linux-x64 debug
[+3846 ms] mkdir -p
/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/../build/linux/obj/debug
[        ] clang++  -std=c++14 -Wall -Werror  -Iflutter/ephemeral
-I/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/flutter/ephemeral/cpp_client_wrapper_
glfw/include  -MMD -c main.cc -o
/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/../build/linux/obj/debug/main.o
[ +334 ms] mkdir -p
/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/../build/linux/obj/debug/flutter
[        ] clang++  -std=c++14 -Wall -Werror  -Iflutter/ephemeral
-I/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/flutter/ephemeral/cpp_client_wrapper_
glfw/include  -MMD -c flutter/generated_plugin_registrant.cc -o
/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/../build/linux/obj/debug/flutter/genera
ted_plugin_registrant.o
[ +113 ms] mkdir -p
/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/../build/linux/debug
[   +1 ms] clang++  -std=c++14 -Wall -Werror  -Iflutter/ephemeral
-I/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/flutter/ephemeral/cpp_client_wrapper_
glfw/include
/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/../build/linux/obj/debug/main.o
/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/../build/linux/obj/debug/flutter/genera
ted_plugin_registrant.o
/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/../build/linux/obj/debug//opt/Pro
ject/Perso/flutter/flutter-desktop-embedding/example/linux/flutter/ephemeral/cpp_client_wrapper_glfw/flutter_win
dow_controller.o
/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/../build/linux/obj/debug//opt/Pro
ject/Perso/flutter/flutter-desktop-embedding/example/linux/flutter/ephemeral/cpp_client_wrapper_glfw/plugin_regi
strar.o
/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/../build/linux/obj/debug//opt/Pro
ject/Perso/flutter/flutter-desktop-embedding/example/linux/flutter/ephemeral/cpp_client_wrapper_glfw/engine_meth
od_result.o -L/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/../build/linux/debug/lib
-lflutter_linux_glfw  -Wl,-rpath=\$ORIGIN/lib -o
/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/../build/linux/debug/flutter_desktop_ex
ample
[  +71 ms] mkdir -p
/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/../build/linux/debug/data
[        ] rsync -rpu --delete
/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/../build/flutter_assets
/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux/../build/linux/debug/data
[   +2 ms] make: Leaving directory '/opt/Project/Perso/flutter/flutter-desktop-embedding/example/linux'
[   +8 ms] Building Linux application... (completed in 4.4s)
[ +185 ms] Error waiting for a debug connection: Bad state: No element
[   +1 ms] Error launching application on Linux.
[   +1 ms] "flutter run" took 4,803ms.

#0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:560:7)
<asynchronous suspension>
#2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:626:18)
<asynchronous suspension>
#3      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:522:33)
<asynchronous suspension>
#4      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29)
#5      _rootRun (dart:async/zone.dart:1126:13)
#6      _CustomZone.run (dart:async/zone.dart:1023:19)
#7      _runZoned (dart:async/zone.dart:1518:10)
#8      runZoned (dart:async/zone.dart:1465:12)
#9      AppContext.run (package:flutter_tools/src/base/context.dart:149:18)
#10     FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:512:20)
#11     CommandRunner.runCommand (package:args/command_runner.dart:197:27)
#12     FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:333:21)
<asynchronous suspension>
#13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29)
#14     _rootRun (dart:async/zone.dart:1126:13)
#15     _CustomZone.run (dart:async/zone.dart:1023:19)
#16     _runZoned (dart:async/zone.dart:1518:10)
#17     runZoned (dart:async/zone.dart:1465:12)
#18     AppContext.run (package:flutter_tools/src/base/context.dart:149:18)
#19     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:284:19)
#20     CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
#21     new Future.sync (dart:async/future.dart:224:31)
#22     CommandRunner.run (package:args/command_runner.dart:112:14)
#23     FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:227:18)
#24     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:22)
#25     _rootRun (dart:async/zone.dart:1126:13)
#26     _CustomZone.run (dart:async/zone.dart:1023:19)
#27     _runZoned (dart:async/zone.dart:1518:10)
#28     runZoned (dart:async/zone.dart:1502:12)
#29     run.<anonymous closure> (package:flutter_tools/runner.dart:62:18)
<asynchronous suspension>
#30     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29)
#31     _rootRun (dart:async/zone.dart:1126:13)
#32     _CustomZone.run (dart:async/zone.dart:1023:19)
#33     _runZoned (dart:async/zone.dart:1518:10)
#34     runZoned (dart:async/zone.dart:1465:12)
#35     AppContext.run (package:flutter_tools/src/base/context.dart:149:18)
#36     runInContext (package:flutter_tools/src/context_runner.dart:64:24)
#37     run (package:flutter_tools/runner.dart:51:10)
#38     main (package:flutter_tools/executable.dart:65:9)
#39     main (file:///opt/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#40     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:305:32)
#41     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)

flutter analyze

➜  example git:(master) ✗ flutter analyze
Analyzing example...                                                    

   info • Unused import: 'package:flutter/services.dart' • lib/main.dart:18:8 • unused_import
   info • Prefer declare const constructors on `@immutable` classes • lib/main.dart:43:3 •
          prefer_const_constructors_in_immutables

2 issues found. (ran in 1.1s; 4 public members lack documentation)

flutter doctor -v

➜  example git:(master) ✗ flutter doctor -v
[✓] Flutter (Channel master, v1.13.6-pre.39, on Linux, locale en_US.UTF-8)
    • Flutter version 1.13.6-pre.39 at /home/hugo/flutter
    • Framework revision 841924e161 (22 hours ago), 2019-12-28 14:50:12 -0500
    • Engine revision bdc9708d23
    • Dart version 2.8.0 (build 2.8.0-dev.0.0 c547f5d933)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /home/hugo/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /home/hugo/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Linux toolchain - develop for Linux desktop
    • clang++ 6.0.0
    • GNU Make 4.1

[✓] Android Studio (version 3.5)
    • Android Studio at /home/hugo/android-studio
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] Connected device (1 available)
    • Linux • Linux • linux-x64 • Linux

• No issues found!

also when i looked into /var/log/syslog i got this error:

kernel: [ 2343.518142] io.flutter.io[10773]: segfault at ffffffffffffff30 ip 00007f693dfc13b4 sp 00007f692c89a630 error 5 in libflutter_linux_glfw.so[7f693dc91000+a27000]
@VladyslavBondarenko VladyslavBondarenko added e: glfw GLFW desktop embedding c: crash Stack traces logged to the console platform-linux Building on or for Linux specifically labels Dec 30, 2019
@stuartmorgan-g stuartmorgan-g added a: desktop Running on desktop engine flutter/engine repository. See also e: labels. labels Dec 31, 2019
@stuartmorgan-g
Copy link
Contributor

Can you get a backtrace running the binary under gdb?

@theyough
Copy link
Author

theyough commented Jan 7, 2020

@stuartmorgan Can you explain me how to do ?

@stuartmorgan-g
Copy link
Contributor

If you aren't familiar with gdb, never mind the backtrace.

Can you describe your configuration? For instance, you say "Devices: emulator"; does that mean this is a VM rather than an actual machine? If so, does OpenGL content in general work in this emulator?

@theyough
Copy link
Author

theyough commented Jan 7, 2020

I m working on ubuntu 18.04 Desktop and flutter is working on the same machine, No VM or container.
I'm able to work with flutter and visual studio to build Android App without any issue.

I've never had any issue with opengl in my desktop environment.
if you need more details, lmk

@theyough
Copy link
Author

@stuartmorgan
i got the backtrace

Reading symbols from build/linux/debug/flutter_desktop_example...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/hugo/Project/Perso/flutter/flutter-desktop-embedding/example/build/linux/debug/flutter_desktop_example 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffeee8b700 (LWP 10634)]
[New Thread 0x7fffee68a700 (LWP 10635)]
[New Thread 0x7fffede89700 (LWP 10636)]
[New Thread 0x7fffed688700 (LWP 10637)]
[New Thread 0x7fffec8af700 (LWP 10638)]
[New Thread 0x7fffdde75700 (LWP 10639)]
[New Thread 0x7fffdd674700 (LWP 10640)]
[New Thread 0x7fffdcd96700 (LWP 10641)]
[New Thread 0x7fffca70f700 (LWP 10642)]
[New Thread 0x7fffc9f0e700 (LWP 10643)]
[New Thread 0x7fffc970d700 (LWP 10644)]
[New Thread 0x7fffc8f0c700 (LWP 10645)]
[New Thread 0x7fffc870b700 (LWP 10646)]
[New Thread 0x7fffc7f0a700 (LWP 10647)]
[New Thread 0x7fffc7709700 (LWP 10648)]
[New Thread 0x7fffdc595700 (LWP 10649)]
[New Thread 0x7fffc6f08700 (LWP 10650)]

Thread 8 "io.flutter.io" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffdd674700 (LWP 10640)]
0x00007ffff763cce4 in GrGLExtensions::init(GrGLStandard, GrGLFunction<unsigned char const* (unsigned int)>, GrGLFunction<unsigned char const* (unsigned int, unsigned int)>, GrGLFunction<void (unsigned int, int*)>, GrGLFunction<char const* (void*, int)>, void*) () from /home/hugo/Project/Perso/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
(gdb) bt
#0  0x00007ffff763cce4 in GrGLExtensions::init(GrGLStandard, GrGLFunction<unsigned char const* (unsigned int)>, GrGLFunction<unsigned char const* (unsigned int, unsigned int)>, GrGLFunction<void (unsigned int, int*)>, GrGLFunction<char const* (void*, int)>, void*) () from /home/hugo/Project/Perso/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#1  0x00007ffff7623636 in GrGLMakeAssembledGLInterface(void*, void (*(*)(void*, char const*))()) () from /home/hugo/Project/Perso/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#2  0x00007ffff7939747 in flutter::CreateGLInterface(std::__1::function<void* (char const*)>) () from /home/hugo/Project/Perso/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#3  0x00007ffff793956f in flutter::GPUSurfaceGLDelegate::GetGLInterface() const () from /home/hugo/Project/Perso/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#4  0x00007ffff7355148 in flutter::EmbedderSurfaceGL::CreateResourceContext() const () from /home/hugo/Project/Perso/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#5  0x00007ffff7358393 in flutter::PlatformViewEmbedder::CreateResourceContext() const () from /home/hugo/Project/Perso/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#6  0x00007ffff7746410 in std::__1::__function::__func<flutter::Shell::CreateShellOnPlatformThread(flutter::DartVMRef, flutter::TaskRunners, flutter::WindowData, flutter::Settings, fml::RefPtr<flutter::DartSnapshot const>, std::__1::function<std::__1::unique_ptr<flutter::PlatformView, std::__1::default_delete<flutter::PlatformView> > (flutter::Shell&)> const&, std::__1::function<std::__1::unique_ptr<flutter::Rasterizer, std::__1::default_delete<flutter::Rasterizer> > (flutter::Shell&)> const&)::$_11(std::__1::allocator<std::__1::allocator>, void ())>::operator()() ()
   from /home/hugo/Project/Perso/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#7  0x00007ffff7360f43 in fml::MessageLoopImpl::FlushTasks(fml::FlushType) () from /home/hugo/Project/Perso/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#8  0x00007ffff7367f9b in fml::MessageLoopLinux::Run() () from /home/hugo/Project/Perso/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#9  0x00007ffff7360e71 in fml::MessageLoopImpl::DoRun() () from /home/hugo/Project/Perso/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#10 0x00007ffff73671db in void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, fml::Thread::Thread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0> >(void*) () from /home/hugo/Project/Perso/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#11 0x00007ffff49856db in start_thread (arg=0x7fffdd674700) at pthread_create.c:463
#12 0x00007ffff547f88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
(gdb)

@stuartmorgan-g
Copy link
Contributor

Thanks, that's very helpful. It'll need more investigation, but between that and the information in google/flutter-desktop-embedding#632 there's much more to go on.

@stuartmorgan-g
Copy link
Contributor

@theyough What version of libglvnd do you have? Based on the other bug it seems like this crash may be related to that library.

@theyough
Copy link
Author

theyough commented Jan 15, 2020 via email

@james-lawrence
Copy link

james-lawrence commented Feb 9, 2020

@stuartmorgan I can confirm that on arch linux package libglvnd-1.3.0-2 crashes and libglvnd-1.2.0-5 works. (using https://github.com/go-flutter-desktop/go-flutter)

here is the stacktrace from the coredump using gdb.

#0  runtime.raise () at /usr/lib/go/src/runtime/sys_linux_amd64.s:150
#1  0x0000000000463eec in runtime.raisebadsignal (sig=11, c=0x7efcfcff8018) at /usr/lib/go/src/runtime/signal_unix.go:492
#2  0x00000000004641b1 in runtime.badsignal (sig=11, c=0x7efcfcff8018) at /usr/lib/go/src/runtime/signal_unix.go:600
#3  0x000000000046390e in runtime.sigtrampgo (sig=<optimized out>, info=0x7efcfcff81f0, ctx=0x7efcfcff80c0) at /usr/lib/go/src/runtime/signal_unix.go:300
#4  0x000000000047d303 in runtime.sigtramp () at /usr/lib/go/src/runtime/sys_linux_amd64.s:357
#5  <signal handler called>
#6  0x00007efd75e78c54 in GrGLExtensions::init(GrGLStandard, GrGLFunction<unsigned char const* (unsigned int)>, GrGLFunction<unsigned char const* (unsigned int, unsigned int)>, GrGLFunction<void (unsigned int, int*)>, GrGLFunction<char const* (void*, int)>, void*) () from /shared/james-lawrence/development/examples/text_demo/go/build/outputs/linux/libflutter_engine.so
#7  0x00007efd75e5fd06 in GrGLMakeAssembledGLInterface(void*, void (*(*)(void*, char const*))()) () from /shared/james-lawrence/development/examples/text_demo/go/build/outputs/linux/libflutter_engine.so
#8  0x00007efd76173c47 in flutter::CreateGLInterface(std::__1::function<void* (char const*)>) () from /shared/james-lawrence/development/examples/text_demo/go/build/outputs/linux/libflutter_engine.so
#9  0x00007efd76173a6f in flutter::GPUSurfaceGLDelegate::GetGLInterface() const () from /shared/james-lawrence/development/examples/text_demo/go/build/outputs/linux/libflutter_engine.so
#10 0x00007efd75b75e88 in flutter::EmbedderSurfaceGL::CreateResourceContext() const () from /shared/james-lawrence/development/examples/text_demo/go/build/outputs/linux/libflutter_engine.so
#11 0x00007efd75b790d3 in flutter::PlatformViewEmbedder::CreateResourceContext() const () from /shared/james-lawrence/development/examples/text_demo/go/build/outputs/linux/libflutter_engine.so
#12 0x00007efd75f83c00 in std::__1::__function::__func<flutter::Shell::CreateShellOnPlatformThread(flutter::DartVMRef, flutter::TaskRunners, flutter::Settings, fml::RefPtr<flutter::DartSnapshot const>, std::__1::function<std::__1::unique_ptr<flutter::PlatformView, std::__1::default_delete<flutter::PlatformView> > (flutter::Shell&)> const&, std::__1::function<std::__1::unique_ptr<flutter::Rasterizer, std::__1::default_delete<flutter::Rasterizer> > (flutter::Shell&)> const&)::$_11, std::__1::allocator<flutter::Shell::CreateShellOnPlatformThread(flutter::DartVMRef, flutter::TaskRunners, flutter::Settings, fml::RefPtr<flutter::DartSnapshot const>, std::__1::function<std::__1::unique_ptr<flutter::PlatformView, std::__1::default_delete<flutter::PlatformView> > (flutter::Shell&)> const&, std::__1::function<std::__1::unique_ptr<flutter::Rasterizer, std::__1::default_delete<flutter::Rasterizer> > (flutter::Shell&)> const&)::$_11>, void ()>::operator()() () from /shared/james-lawrence/development/examples/text_demo/go/build/outputs/linux/libflutter_engine.so
#13 0x00007efd75ba32d3 in fml::MessageLoopImpl::FlushTasks(fml::FlushType) () from /shared/james-lawrence/development/examples/text_demo/go/build/outputs/linux/libflutter_engine.so
#14 0x00007efd75baa6db in fml::MessageLoopLinux::Run() () from /shared/james-lawrence/development/examples/text_demo/go/build/outputs/linux/libflutter_engine.so
#15 0x00007efd75ba3201 in fml::MessageLoopImpl::DoRun() () from /shared/james-lawrence/development/examples/text_demo/go/build/outputs/linux/libflutter_engine.so
#16 0x00007efd75ba991b in void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, fml::Thread::Thread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0> >(void*) () from /shared/james-lawrence/development/examples/text_demo/go/build/outputs/linux/libflutter_engine.so
#17 0x00007efd748e64cf in start_thread () from /usr/lib/libpthread.so.0
#18 0x00007efd748132d3 in clone () from /usr/lib/libc.so.6

@stuartmorgan-g
Copy link
Contributor

stuartmorgan-g commented Feb 10, 2020

Pulling the important bits from a comment of mine from the closed bug:

The crash is in Skia, so it seems like this is either a Skia bug, or in (based on the above) libglvnd. I think the best next step would be for someone who can reproduce this and has a backtrace to file a Skia bug for further investigation by the Skia team as a starting point; they would better be able to tell if it's an issue in Skia or in the underlying library.

@kenvandine
Copy link
Contributor

Ubuntu Focal (20.04) has libglvnd 1.3.0 as well and we're seeing this crash. Can you guide me through getting a backtrace with debug symbols? I have a backtrace, but it would be better with symbols.

Thread 8 "io.flutter.io" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffea7fc700 (LWP 53625)]
0x00007ffff782ed84 in GrGLExtensions::init(GrGLStandard, GrGLFunction<unsigned char const* (unsigned int)>, GrGLFunction<unsigned char const* (unsigned int, unsigned int)>, GrGLFunction<void (unsigned int, int*)>, GrGLFunction<char const* (void*, int)>, void*) ()
from /home/ken/src/flutter/examples/flutter_gallery/build/linux/release/lib/libflutter_linux_glfw.so
(gdb) bt
#0 0x00007ffff782ed84 in GrGLExtensions::init(GrGLStandard, GrGLFunction<unsigned char const* (unsigned int)>, GrGLFunction<unsigned char const* (unsigned int, unsigned int)>, GrGLFunction<void (unsigned int, int*)>, GrGLFunction<char const* (void*, int)>, void*) ()
from /home/ken/src/flutter/examples/flutter_gallery/build/linux/release/lib/libflutter_linux_glfw.so
#1 0x00007ffff78153b6 in GrGLMakeAssembledGLInterface(void*, void (()(void*, char const*))()) ()
from /home/ken/src/flutter/examples/flutter_gallery/build/linux/release/lib/libflutter_linux_glfw.so
#2 0x00007ffff7b2cb47 in flutter::CreateGLInterface(std::__1::function<void* (char const*)>) ()
from /home/ken/src/flutter/examples/flutter_gallery/build/linux/release/lib/libflutter_linux_glfw.so
#3 0x00007ffff7b2c96f in flutter::GPUSurfaceGLDelegate::GetGLInterface() const ()
from /home/ken/src/flutter/examples/flutter_gallery/build/linux/release/lib/libflutter_linux_glfw.so
#4 0x00007ffff752ba58 in flutter::EmbedderSurfaceGL::CreateResourceContext() const ()
from /home/ken/src/flutter/examples/flutter_gallery/build/linux/release/lib/libflutter_linux_glfw.so
#5 0x00007ffff752eca3 in flutter::PlatformViewEmbedder::CreateResourceContext() const ()
from /home/ken/src/flutter/examples/flutter_gallery/build/linux/release/lib/libflutter_linux_glfw.so
#6 0x00007ffff7938920 in std::__1::__function::__func<flutter::Shell::CreateShellOnPlatformThread(flutter::DartVMRef, flutter::TaskRunners, flutter::WindowData, flutter::Settings, fml::RefPtr<flutter::DartSnapshot const>, std::__1::function<std::__1::unique_ptr<flutter::PlatformView, std::__1::default_deleteflutter::PlatformView > (flutter::Shell&)> const&, std::__1::function<std::__1::unique_ptr<flutter::Rasterizer, std::__1::default_deleteflutter::Rasterizer > (flutter::Shell&)> const&)::$_11, std::__1::allocator<flutter::Shell::CreateShellOnPlatformThread(flutter::DartVMRef, flutter::TaskRunners, flutter::WindowData, flutter::Settings, fml::RefPtr<flutter::DartSnapshot const>, std::__1::function<std::__1::unique_ptr<flutter::PlatformView, std::__1::default_deleteflutter::PlatformView > (flutter::Shell&)> const&, std::__1::function<std::__1::unique_ptr<flutter::Rasterizer, std::__1::default_deleteflutter::Rasterizer > (flutter::Shell&)> const&)::$_11>, void ()>::operator()() () from /home/ken/src/flutter/examples/flutter_gallery/build/linux/release/lib/libflutter_linux_glfw.so
#7 0x00007ffff75380f3 in fml::MessageLoopImpl::FlushTasks(fml::FlushType) ()
from /home/ken/src/flutter/examples/flutter_gallery/build/linux/release/lib/libflutter_linux_glfw.so
#8 0x00007ffff753e6db in fml::MessageLoopLinux::Run() ()
from /home/ken/src/flutter/examples/flutter_gallery/build/linux/release/lib/libflutter_linux_glfw.so
#9 0x00007ffff7538021 in fml::MessageLoopImpl::DoRun() ()
from /home/ken/src/flutter/examples/flutter_gallery/build/linux/release/lib/libflutter_linux_glfw.so
#10 0x00007ffff753d91b in void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct >, fml::Thread::Thread(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)::$_0> >(void*) () from /home/ken/src/flutter/examples/flutter_gallery/build/linux/release/lib/libflutter_linux_glfw.so
#11 0x00007ffff5aab669 in start_thread (arg=) at pthread_create.c:479
#12 0x00007ffff5ddd333 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

@RokkuCode
Copy link

Debian Sid here with libglvnd 1.3.1-1

(gdb) run
Starting program: /home/pyloor/development/flutter/flutter-desktop-embedding/example/build/linux/debug/flutter_desktop_example 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff2086700 (LWP 294824)]
[New Thread 0x7ffff1885700 (LWP 294825)]
[New Thread 0x7ffff1084700 (LWP 294826)]
[New Thread 0x7fffe26a6700 (LWP 294827)]
[New Thread 0x7fffe1ea5700 (LWP 294828)]
[New Thread 0x7fffe16a4700 (LWP 294829)]
[New Thread 0x7fffe0ea3700 (LWP 294830)]
[New Thread 0x7fffe06a2700 (LWP 294831)]
[New Thread 0x7fffdfea1700 (LWP 294832)]
[New Thread 0x7fffdf6a0700 (LWP 294833)]
[New Thread 0x7fffdee9f700 (LWP 294834)]
[New Thread 0x7fffde69e700 (LWP 294835)]
[New Thread 0x7fffdde9d700 (LWP 294836)]
[New Thread 0x7fffdd69c700 (LWP 294837)]
[New Thread 0x7fffdce9b700 (LWP 294838)]
[New Thread 0x7fffdc69a700 (LWP 294839)]
[New Thread 0x7fffdbe99700 (LWP 294840)]
[New Thread 0x7fffdb698700 (LWP 294841)]
[New Thread 0x7fffdae97700 (LWP 294842)]
[New Thread 0x7ffff07a6700 (LWP 294843)]
[New Thread 0x7ffff024f700 (LWP 294844)]
[New Thread 0x7fffda07f700 (LWP 294845)]
[New Thread 0x7fffd9f7e700 (LWP 294846)]
flutter: Observatory listening on http://127.0.0.1:44193/Atghv7ox_8I=/

Thread 4 "io.flutter.io" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff1084700 (LWP 294826)]
0x00007ffff782be94 in GrGLExtensions::init(GrGLStandard, GrGLFunction<unsigned char const* (unsigned int)>, GrGLFunction<unsigned char const* (unsigned int, unsigned int)>, GrGLFunction<void (unsigned int, int*)>, GrGLFunction<char const* (void*, int)>, void*) ()
   from /home/pyloor/development/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
(gdb) bt
#0  0x00007ffff782be94 in GrGLExtensions::init(GrGLStandard, GrGLFunction<unsigned char const* (unsigned int)>, GrGLFunction<unsigned char const* (unsigned int, unsigned int)>, GrGLFunction<void (unsigned int, int*)>, GrGLFunction<char const* (void*, int)>, void*) ()
   from /home/pyloor/development/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#1  0x00007ffff78123d6 in GrGLMakeAssembledGLInterface(void*, void (*(*)(void*, char const*))()) ()
   from /home/pyloor/development/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#2  0x00007ffff7b29c07 in flutter::CreateGLInterface(std::__1::function<void* (char const*)>) ()
   from /home/pyloor/development/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#3  0x00007ffff7b29a2f in flutter::GPUSurfaceGLDelegate::GetGLInterface() const ()
   from /home/pyloor/development/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#4  0x00007ffff7527728 in flutter::EmbedderSurfaceGL::CreateResourceContext() const ()
   from /home/pyloor/development/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#5  0x00007ffff752a973 in flutter::PlatformViewEmbedder::CreateResourceContext() const ()
   from /home/pyloor/development/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#6  0x00007ffff7935be0 in std::__1::__function::__func<flutter::Shell::CreateShellOnPlatformThread(flutter::DartVMRef, flutter::TaskRunners, flutter::WindowData, flutter::Settings, fml::RefPtr<flutter::DartSnapshot const>, std::__1::function<std::__1::unique_ptr<flutter::PlatformView, std::__1::default_delete<flutter::PlatformView> > (flutter::Shell&)> const&, std::__1::function<std::__1::unique_ptr<flutter::Rasterizer, std::__1::default_delete<flutter::Rasterizer> > (flutter::Shell&)> const&)::$_11, std::__1::allocator<flutter::Shell::CreateShellOnPlatformThread(flutter::DartVMRef, flutter::TaskRunners, flutter::WindowData, flutter::Settings, fml::RefPtr<flutter::DartSnapshot const>, std::__1::function<std::__1::unique_ptr<flutter::PlatformView, std::__1::default_delete<flutter::PlatformView> > (flutter::Shell&)> const&, std::__1::function<std::__1::unique_ptr<flutter::Rasterizer, std::__1::default_delete<flutter::Rasterizer> > (flutter::Shell&)> const&)::$_11>, void ()>::operator()() () from /home/pyloor/development/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#7  0x00007ffff7533dc3 in fml::MessageLoopImpl::FlushTasks(fml::FlushType) ()
   from /home/pyloor/development/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#8  0x00007ffff753a3ab in fml::MessageLoopLinux::Run() () from /home/pyloor/development/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#9  0x00007ffff7533cf1 in fml::MessageLoopImpl::DoRun() () from /home/pyloor/development/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#10 0x00007ffff75395eb in void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, fml::Thread::Thread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0> >(void*) ()
   from /home/pyloor/development/flutter/flutter-desktop-embedding/example/build/linux/debug/lib/libflutter_linux_glfw.so
#11 0x00007ffff56c1fb7 in start_thread (arg=<optimized out>) at pthread_create.c:486
#12 0x00007ffff5dc92cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

@stuartmorgan-g
Copy link
Contributor

stuartmorgan-g commented Feb 26, 2020

Can you guide me through getting a backtrace with debug symbols? I have a backtrace, but it would be better with symbols.

Currently the only way I know of offhand is to build the engine from source, and run with that local engine (flutter run --local-engine=host_debug_unopt). At some point we'll need to ensure we have symbol handling in place for the all desktop engine builds, but it hasn't been done yet.

@stuartmorgan-g
Copy link
Contributor

To avoid this getting overly long: more copies of the stack trace aren't necessary at this point; they aren't adding new information.

Again, the next step here is for someone who can reproduce this, and ideally is willing to do some more debugging if requested by the Skia team, to file a Skia bug and link to it from here.

@RokkuCode
Copy link

RokkuCode commented Feb 26, 2020

I've setup a debug build for flutter engine and ran the example application with gdb. here is what i got.
for me this looks like a bug in skia. so i'm going to open a bug @ skia and point them to this bug, too.

let me know if you need more debug outputs.

(gdb) run

0x00007ffff72069ee in eat_space_sep_strings (out=0x7fffef6ab440, in=0xffffffffffffff28 <error: Cannot access memory at address 0xffffffffffffff28>)
    at ../../third_party/skia/src/gpu/gl/GrGLExtensions.cpp:53
53              while (' ' == *in) {
(gdb) bt
#0  0x00007ffff72069ee in eat_space_sep_strings (out=0x7fffef6ab440, in=0xffffffffffffff28 <error: Cannot access memory at address 0xffffffffffffff28>)
    at ../../third_party/skia/src/gpu/gl/GrGLExtensions.cpp:53
#1  0x00007ffff7206949 in GrGLExtensions::init(GrGLStandard, GrGLFunction<unsigned char const* (unsigned int)>, GrGLFunction<unsigned char const* (unsigned int, unsigned int)>, GrGLFunction<void (unsigned int, int*)>, GrGLFunction<char const* (void*, int)>, void*) (this=0x7fffef6ab438, standard=kGL_GrGLStandard, getString=..., getStringi=..., getIntegerv=..., 
    queryString=..., eglDisplay=0xffffffffffffff28) at ../../third_party/skia/src/gpu/gl/GrGLExtensions.cpp:117
#2  0x00007ffff71c1614 in GrGLMakeAssembledGLInterface (ctx=0x7fffef6ab600, 
    get=0x7ffff79eb7b0 <flutter::CreateGLInterface(std::__1::function<void* (char const*)>)::$_0::__invoke(void*, char const*)>)
    at ../../third_party/skia/src/gpu/gl/GrGLAssembleGLInterfaceAutogen.cpp:49
#3  0x00007ffff79eb3d5 in flutter::CreateGLInterface(std::__1::function<void* (char const*)>) (proc_resolver=...) at ../../flutter/shell/gpu/gpu_surface_gl_delegate.cc:83
#4  0x00007ffff79eb294 in flutter::GPUSurfaceGLDelegate::GetGLInterface (this=0x6a7c88) at ../../flutter/shell/gpu/gpu_surface_gl_delegate.cc:92
#5  0x00007ffff661a68e in flutter::EmbedderSurfaceGL::CreateResourceContext (this=0x6a7c80) at ../../flutter/shell/platform/embedder/embedder_surface_gl.cc:96
#6  0x00007ffff662832e in flutter::PlatformViewEmbedder::CreateResourceContext (this=0x467290) at ../../flutter/shell/platform/embedder/platform_view_embedder.cc:82
#7  0x00007ffff74bf88f in flutter::Shell::CreateShellOnPlatformThread(flutter::DartVMRef, flutter::TaskRunners, flutter::WindowData, flutter::Settings, fml::RefPtr<flutter::DartSnapshot const>, std::__1::function<std::__1::unique_ptr<flutter::PlatformView, std::__1::default_delete<flutter::PlatformView> > (flutter::Shell&)> const&, std::__1::function<std::__1::unique_ptr<flutter::Rasterizer, std::__1::default_delete<flutter::Rasterizer> > (flutter::Shell&)> const&)::$_11::operator()() const (this=0x7fffe4000ce8) at ../../flutter/shell/common/shell.cc:117
#8  0x00007ffff74bf80d in std::__1::__invoke<flutter::Shell::CreateShellOnPlatformThread(flutter::DartVMRef, flutter::TaskRunners, flutter::WindowData, flutter::Settings, fml::RefPtr<flutter::DartSnapshot const>, std::__1::function<std::__1::unique_ptr<flutter::PlatformView, std::__1::default_delete<flutter::PlatformView> > (flutter::Shell&)> const&, std::__1::function<std::__1::unique_ptr<flutter::Rasterizer, std::__1::default_delete<flutter::Rasterizer> > (flutter::Shell&)> const&)::$_11&> (__f=...) at ../../third_party/libcxx/include/type_traits:3530
#9  0x00007ffff74bf7bd in std::__1::__invoke_void_return_wrapper<void>::__call<flutter::Shell::CreateShellOnPlatformThread(flutter::DartVMRef, flutter::TaskRunners, flutter::WindowData, flutter::Settings, fml::RefPtr<flutter::DartSnapshot const>, std::__1::function<std::__1::unique_ptr<flutter::PlatformView, std::__1::default_delete<flutter::PlatformView> > (flutter::Shell&)> const&, std::__1::function<std::__1::unique_ptr<flutter::Rasterizer, std::__1::default_delete<flutter::Rasterizer> > (flutter::Shell&)> const&)::$_11&>(flutter::Shell::CreateShellOnPlatformThread(flutter::DartVMRef, flutter::TaskRunners, flutter::WindowData, flutter::Settings, fml::RefPtr<flutter::DartSnapshot const>, std::__1::function<std::__1::unique_ptr<flutter::PlatformView, std::__1::default_delete<flutter::PlatformView> > (flutter::Shell&)> const&, std::__1::function<std::__1::unique_ptr<flutter::Rasterizer, std::__1::default_delete<flutter::Rasterizer> > (flutter::Shell&)> const&)::$_11&) (__args=...) at ../../third_party/libcxx/include/__functional_base:348
#10 0x00007ffff74bf78d in std::__1::__function::__alloc_func<flutter::Shell::CreateShellOnPlatformThread(flutter::DartVMRef, flutter::TaskRunners, flutter::WindowData, flutter::Settings, fml::RefPtr<flutter::DartSnapshot const>, std::__1::function<std::__1::unique_ptr<flutter::PlatformView, std::__1::default_delete<flutter::PlatformView> > (flutter::Shell&)> const&, std::__1::function<std::__1::unique_ptr<flutter::Rasterizer, std::__1::default_delete<flutter::Rasterizer> > (flutter::Shell&)> const&)::$_11, std::__1::allocator<flutter::Shell::CreateShellOnPlatformThread(flutter::DartVMRef, flutter::TaskRunners, flutter::WindowData, flutter::Settings, fml::RefPtr<flutter::DartSnapshot const>, std::__1::function<std::__1::unique_ptr<flutter::PlatformView, std::__1::default_delete<flutter::PlatformView> > (flutter::Shell&)> const&, std::__1::function<std::__1::unique_ptr<flutter::Rasterizer, std::__1::default_delete<flutter::Rasterizer> > (flutter::Shell&)> const&)::$_11>, void ()>::operator()() (this=0x7fffe4000ce8) at ../../third_party/libcxx/include/functional:1533
#11 0x00007ffff74bea49 in std::__1::__function::__func<flutter::Shell::CreateShellOnPlatformThread(flutter::DartVMRef, flutter::TaskRunners, flutter::WindowData, flutter::Settings, fml::RefPtr<flutter::DartSnapshot const>, std::__1::function<std::__1::unique_ptr<flutter::PlatformView, std::__1::default_delete<flutter::PlatformView> > (flutter::Shell&)> const&, std::__1::function<std::__1::unique_ptr<flutter::Rasterizer, std::__1::default_delete<flutter::Rasterizer> > (flutter::Shell&)> const&)::$_11, std::__1::allocator<flutter::Shell::CreateShellOnPlatformThread(flutter::DartVMRef, flutter::TaskRunners, flutter::WindowData, flutter::Settings, fml::RefPtr<flutter::DartSnapshot const>, std::__1::function<std::__1::unique_ptr<flutter::PlatformView, std::__1::default_delete<flutter::PlatformView> > (flutter::Shell&)> const&, std::__1::function<std::__1::unique_ptr<flutter::Rasterizer, std::__1::default_delete<flutter::Rasterizer> > (flutter::Shell&)> const&)::$_11>, void ()>::operator()() (this=0x7fffe4000ce0) at ../../third_party/libcxx/include/functional:1707
#12 0x00007ffff6594225 in std::__1::__function::__value_func<void ()>::operator()() const (this=0x7fffe4000ca0) at ../../third_party/libcxx/include/functional:1860
#13 0x00007ffff6591d25 in std::__1::function<void ()>::operator()() const (this=0x7fffe4000ca0) at ../../third_party/libcxx/include/functional:2419
#14 0x00007ffff664f823 in fml::MessageLoopImpl::FlushTasks (this=0x7fffe4000b80, type=fml::FlushType::kAll) at ../../flutter/fml/message_loop_impl.cc:127
#15 0x00007ffff664f70a in fml::MessageLoopImpl::RunExpiredTasksNow (this=0x7fffe4000b80) at ../../flutter/fml/message_loop_impl.cc:137
#16 0x00007ffff6661323 in fml::MessageLoopLinux::OnEventFired (this=0x7fffe4000b80) at ../../flutter/fml/platform/linux/message_loop_linux.cc:89
#17 0x00007ffff66612c6 in fml::MessageLoopLinux::Run (this=0x7fffe4000b80) at ../../flutter/fml/platform/linux/message_loop_linux.cc:70
#18 0x00007ffff664f692 in fml::MessageLoopImpl::DoRun (this=0x7fffe4000b80) at ../../flutter/fml/message_loop_impl.cc:96
#19 0x00007ffff664e7bd in fml::MessageLoop::Run (this=0x7fffe4000b60) at ../../flutter/fml/message_loop.cc:49
--Type <RET> for more, q to quit, c to continue without paging--c
#20 0x00007ffff665df81 in fml::Thread::Thread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0::operator()() const (this=0x6d0848) at ../../flutter/fml/thread.cc:34
#21 0x00007ffff665decd in std::__1::__invoke<fml::Thread::Thread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0> (__f=...) at ../../third_party/libcxx/include/type_traits:3530
#22 0x00007ffff665de75 in std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, fml::Thread::Thread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, fml::Thread::Thread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0>&, std::__1::__tuple_indices<>) (__t=...) at ../../third_party/libcxx/include/thread:341
#23 0x00007ffff665dbf3 in std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, fml::Thread::Thread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_0> >(void*) (__vp=0x6d0840) at ../../third_party/libcxx/include/thread:351
#24 0x00007ffff3ce9fb7 in start_thread (arg=<optimized out>) at pthread_create.c:486
#25 0x00007ffff43f12cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

GrGLExtensions.cpp:53
https://skia.googlesource.com/skia/+/refs/heads/master/src/gpu/gl/GrGLExtensions.cpp

static void eat_space_sep_strings(SkTArray<SkString>* out, const char in[]) {
    if (!in) {
        return;
    }
    while (true) {
        // skip over multiple spaces between extensions
        while (' ' == *in) {
            ++in;
        }
        // quit once we reach the end of the string.
        if ('\0' == *in) {
            break;
        }
        // we found an extension
        size_t length = strcspn(in, " ");
        out->push_back().set(in, length);
        in += length;
    }
}

GrGLExtensions.cpp:117
https://skia.googlesource.com/skia/+/refs/heads/master/src/gpu/gl/GrGLExtensions.cpp

if (queryString) {
        const char* extensions = queryString(eglDisplay, GR_EGL_EXTENSIONS);

        eat_space_sep_strings(&fStrings, extensions);
    }

Updated
I have opened a bugreport @ skia:
https://bugs.chromium.org/p/skia/issues/detail?id=9967

stuartmorgan-g added a commit to stuartmorgan-g/engine that referenced this issue Mar 4, 2020
Skia expects an EGL context, but GLFW was defaulting to non-EGL, which
causes eglGetCurrentDisplay to fail--since the context wasn't made
current via EGL--with new versions of libglvnd. (It may have worked only
by accident with previous versions).

Fixes flutter/flutter#47954
stuartmorgan-g added a commit to flutter/engine that referenced this issue Mar 4, 2020
Skia expects an EGL context, but GLFW was defaulting to non-EGL, which
causes eglGetCurrentDisplay to fail--since the context wasn't made
current via EGL--with new versions of libglvnd. (It may have worked only
by accident with previous versions).

Fixes flutter/flutter#47954
@kenvandine
Copy link
Contributor

kenvandine commented Mar 5, 2020

This fixes the crash on Ubuntu Focal, however now I'm seeing this crash on 18.04:

GLFW error 65542: EGL: Failed to get EGL display: Success
Failed to create window.

For reference, focal has libglvnd 1.3.1 and 18.04 has libgvlnd 1.0.0

@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 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: desktop Running on desktop c: crash Stack traces logged to the console e: glfw GLFW desktop embedding engine flutter/engine repository. See also e: labels. platform-linux Building on or for Linux specifically
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants