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

[Linux] Failed to setup Skia Gr context. #135

Closed
ckopsa opened this issue Oct 11, 2018 · 21 comments
Closed

[Linux] Failed to setup Skia Gr context. #135

ckopsa opened this issue Oct 11, 2018 · 21 comments

Comments

@ckopsa
Copy link

ckopsa commented Oct 11, 2018

Following the instructions in the README for the example application briefly opens the application, but then yields the following error:

./example/out/flutter_embedder_example 
flutter: Observatory listening on http://127.0.0.1:42549/
[ERROR:flutter/shell/gpu/gpu_surface_gl.cc(73)] Failed to setup Skia Gr context.
Segmentation fault (core dumped)

Ubuntu 18.04

@stuartmorgan
Copy link
Collaborator

@chinmaygarde This is flutter/engine#6353 right? Do we need to add the resolver callback, or are you going to add fallbacks as discussed in the other bug?

@chinmaygarde
Copy link
Member

I am going to add the fallback for OpenGL proc accessors. Though, it is a good idea for embedders to be explicit about the same. I'll submit a patch to both.

Sorry about the delay, I thought flutter/engine#6353 was already reverted while I was on vacation.

@chinmaygarde
Copy link
Member

chinmaygarde commented Oct 13, 2018

This has been patched in the engine (flutter/engine#6523). No changes should necessary for embedders once the updates are pulled in.

@stuartmorgan
Copy link
Collaborator

Awesome, thanks!

@malkia
Copy link

malkia commented Nov 7, 2018

This is still broken for me.

@malkia
Copy link

malkia commented Nov 7, 2018

`malkia@penguin:~/p/flutter/bin$ ./flutter doctor -v
[✓] Flutter (Channel master, v0.10.3-pre.123, on Linux, locale en_US.UTF-8)
• Flutter version 0.10.3-pre.123 at /home/malkia/p/flutter
• Framework revision 028087d0fc (49 minutes ago), 2018-11-06 22:44:01 -0800
• Engine revision 4f4c470d24
• Dart version 2.1.0 (build 2.1.0-dev.8.0 bf26f760b1)

[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.io/setup/#android-setup for detailed instructions).
If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.
You may also want to add it to your PATH environment variable.

[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.io/setup/#android-setup for detailed instructions).

[!] VS Code (version 1.28.2)
• VS Code at /usr/share/code
• Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[!] Connected device
! No devices available

! Doctor found issues in 4 categories.`

@malkia
Copy link

malkia commented Nov 7, 2018

malkia@penguin:~/p/flutter-desktop-embedding/example/linux$ ./out/flutter_embedder_example
flutter: Observatory listening on http://127.0.0.1:45017/
[ERROR:flutter/shell/gpu/gpu_surface_gl.cc(81)] Failed to setup Skia Gr context.
Segmentation fault

@malkia
Copy link

malkia commented Nov 7, 2018

malkia@penguin:~/p/flutter-desktop-embedding/example/linux/out$ ldd ./flutter_embedder_example
linux-vdso.so.1 (0x00007ffcba9b1000)
libglfw.so.3 => /usr/lib/x86_64-linux-gnu/libglfw.so.3 (0x00007b451ac0f000)
libjsoncpp.so.1 => /usr/lib/x86_64-linux-gnu/libjsoncpp.so.1 (0x00007b451a9db000)
libflutter_embedder.so => /home/malkia/p/flutter-desktop-embedding/example/linux/out/./lib/libflutter_embedder.so (0x00007b451a790000)
libflutter_engine.so => /home/malkia/p/flutter-desktop-embedding/example/linux/out/./lib/libflutter_engine.so (0x00007b4519216000)
libflutter_embedder_color_panel.so => /home/malkia/p/flutter-desktop-embedding/example/linux/out/./lib/libflutter_embedder_color_panel.so (0x00007b451900e000)
libflutter_embedder_file_chooser.so => /home/malkia/p/flutter-desktop-embedding/example/linux/out/./lib/libflutter_embedder_file_chooser.so (0x00007b4518e02000)
libflutter_embedder_menubar.so => /home/malkia/p/flutter-desktop-embedding/example/linux/out/./lib/libflutter_embedder_menubar.so (0x00007b4518bf8000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007b4518876000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007b4518572000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007b451835b000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007b4517fbc000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007b4517db4000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007b4517bb0000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007b4517870000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007b4517653000)
libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007b4517448000)
libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007b4517245000)
libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007b451703f000)
libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007b4516e34000)
libgtk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007b451651e000)
libgdk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-3.so.0 (0x00007b4516227000)
libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007b451601a000)
libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007b4515dce000)
libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007b4515ba8000)
libcairo-gobject.so.2 => /usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2 (0x00007b451599f000)
libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007b451568b000)
libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007b4515467000)
libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007b45150d1000)
libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007b4514e7e000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007b4514b6a000)
libepoxy.so.0 => /usr/lib/x86_64-linux-gnu/libepoxy.so.0 (0x00007b4514874000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007b4514602000)
/lib64/ld-linux-x86-64.so.2 (0x00007b451b035000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007b45143da000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007b45141c8000)
libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007b4513fbe000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007b4513db8000)
libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007b4513bb4000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007b45139a4000)
libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007b45137a1000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007b451359e000)
libatk-bridge-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0 (0x00007b451336f000)
libxkbcommon.so.0 => /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007b451312f000)
libwayland-cursor.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-cursor.so.0 (0x00007b4512f27000)
libwayland-egl.so.1 => /usr/lib/x86_64-linux-gnu/libwayland-egl.so.1 (0x00007b4512d25000)
libwayland-client.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-client.so.0 (0x00007b4512b16000)
libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007b4512900000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007b45126c2000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007b4512413000)
libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007b4512211000)
libthai.so.0 => /usr/lib/x86_64-linux-gnu/libthai.so.0 (0x00007b4512007000)
libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007b4511d60000)
libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007b4511b2d000)
libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007b4511929000)
libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007b451171b000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007b4511501000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007b45112d9000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007b45110c2000)
libmount.so.1 => /lib/x86_64-linux-gnu/libmount.so.1 (0x00007b4510e74000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007b4510c6b000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007b45109f8000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007b45107ce000)
libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007b45105cb000)
libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007b45103c8000)
libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007b45101c1000)
libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007b450ffbf000)
libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007b450fd90000)
libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007b450fb8e000)
libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007b450f973000)
libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007b450f76e000)
libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007b450f55e000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007b450f35a000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007b450f154000)
libatspi.so.0 => /usr/lib/x86_64-linux-gnu/libatspi.so.0 (0x00007b450ef23000)
libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007b450ecd3000)
libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007b450ea3e000)
libdatrie.so.1 => /usr/lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007b450e836000)
libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007b450e5f0000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007b450e3da000)
libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007b451b198000)
libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007b450e1ad000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007b450dfa8000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007b450dd82000)
liblz4.so.1 => /usr/lib/x86_64-linux-gnu/liblz4.so.1 (0x00007b450db70000)
libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007b450d860000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007b450d64c000)

@ckopsa
Copy link
Author

ckopsa commented Nov 8, 2018

I had found that I needed to go into some of the scripts and specify the correct commit hash in order for it to pull in the changes mentioned above. I can check my local repository and see what those changes were once I get to my computer.

@ckopsa
Copy link
Author

ckopsa commented Nov 8, 2018

Here is the diff of the file I had to change to make things work:

modified   linux/library/Makefile
@@ -46,7 +46,7 @@ $(LIBRARY_OUT): $(SOURCES) $(HEADERS) $(LIBRARIES)
 # already has, and makes things slightly more fragile, in exchange for
 # avoiding unnecessary relinks.
 $(FLUTTER_ENGINE_LIB_FILE): $(FLUTTER_DIR)/bin/internal/engine.version
-	$(ENGINE_UPDATER) --flutter_root=$(FLUTTER_DIR) ./
+	$(ENGINE_UPDATER) --hash=1242f6dfe11f8c16d083265e1afd50886a383ec2 ./
 	if [ -f $(FLUTTER_ENGINE_HEADER) ]; then \
 		mv $(FLUTTER_ENGINE_HEADER) include/; \
 		fi

@stuartmorgan
Copy link
Collaborator

I had found that I needed to go into some of the scripts and specify the correct commit hash

In general, forcing a specific engine version is a bad idea. There can be dependencies between the Flutter tree version and the engine version, which is why there's an auto-roller in Flutter that tests the engine before pulling in a new version. You may have arbitrary problems when using an untested combination.

Except in rare cases where you really know what you are doing, the right way to pick up an engine change is to roll your Flutter tree forward to a version whose engine pin has advanced beyond the engine commit you want.

(In this case, your hard-coded version is nearly a month behind the version of the engine that @malkia should be using with that Flutter tree, so forcing that version would likely regress something.)

• Framework revision 028087d0fc (49 minutes ago), 2018-11-06 22:44:01 -0800
• Engine revision 4f4c470d24

That should definitely have the fix. @malkia, could you check your library/linux/.last_engine_version file to see that it is in fact showing that engine hash?

@ckopsa
Copy link
Author

ckopsa commented Nov 8, 2018

I completely understand, I was just offering a work around that fixed it for me. Thanks for sharing the proper steps to diagnose/solve the issue.

@malkia
Copy link

malkia commented Nov 8, 2018

@stuartmorgan - I have this:

malkia@penguin:~/p/flutter-desktop-embedding$ find . | grep last_engine
./library/linux/.last_engine_version

malkia@penguin:~/p/flutter-desktop-embedding$ cat ./library/linux/.last_engine_version 
4f4c470d2419abed2cac6b02761e207d9b2aa920

@stuartmorgan
Copy link
Collaborator

That means you do have the correct engine version (unless something went wrong with the update step such that the library didn't get updated, but the version stamp did). I've updated my Linux machine to your exact Flutter version though, and it's working for me.

Have you ever had it working on this machine? If not, perhaps your issue isn't related to the resolver change even though the failure mode is the same. (If so, the only other thing I can think to try is a completely clean build in case something is stale and not getting rebuilt.)

@malkia
Copy link

malkia commented Nov 9, 2018

So it could be due to Crostini, that's my Linux on my Chromebook, and AFAIK there is not (yet) real gfx acceleration there. I'll try to install crouton again, and test it out!

FYI: I've tried passing --enable-software-rendering, and extending the example to do so - but did nothing.

@GeertJohan
Copy link
Contributor

I experience this issue when using flutter v1.0 with the latest master for flutter-desktop-embedding. I'm building the example on an up-to-date Ubuntu Bionic. Please let me know when there are any details I may provide or debugging steps to take.

@GeertJohan
Copy link
Contributor

Perhaps this should be re-opened @stuartmorgan ?

@stuartmorgan
Copy link
Collaborator

Please file a new bug; the error message is pretty generic, and can be caused by a variety of issues. The initial bug was 100% reproducible for everyone on Linux because of an engine change that has been fixed. What's happening for some people now is different, even though the final error message is the same, so I'd rather not conflate it with the earlier bug's discussion.

@parren
Copy link

parren commented Dec 10, 2018

Seeing this too after a fresh install.

$ flutter --version
Flutter 1.0.1-pre.8 • channel master • http://github.com/flutter/flutter
Framework • revision e7a4e7c3b6 (2 hours ago) • 2018-12-10 11:21:28 -0800
Engine • revision 7375a0f414
Tools • Dart 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

@stuartmorgan
Copy link
Collaborator

Opened #170 since nobody else has opened a new bug. Please use that bug going forward.

@Hazix00

This comment has been minimized.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants