Vscode: Linux: dialogs are looking broken in the snap package

Created on 22 Aug 2018  Â·  27Comments  Â·  Source: microsoft/vscode


  • vscode version :
    Version: 1.26.1
    Commit: 493869ee8e8a846b0855873886fc79d480d342de
    Date: 2018-08-16T18:34:20.517Z
    Electron: 2.0.5
    Chrome: 61.0.3163.100
    Node.js: 8.9.3
    V8: 6.1.534.41
    Architecture: x64
  • OS Version:
    Distributor ID: Ubuntu
    Description: Ubuntu 18.04.1 LTS
    Release: 18.04
    Codename: bionic

Steps to Reproduce:

  1. Try to move a file from one folder to an other
  2. Confirmation modal is buggy

When I hover the buttons, they appear. But as you can see, the modal header has some dark black color.

screenshot from 2018-08-22 17-37-05


Does this issue occur when all extensions are disabled?: Yes

bug help wanted install-update linux snap verified

Most helpful comment

For reference, the issue is not due to an incorrect zlib version suggested above. The problem is due to the snap accidentally referencing system libraries instead of it's own. This manifests with vscode loading the libgdk-pixbuf-loader library from the system, which is compiled against a different zlib than the one within the snap's files. The solution, therefore, is not to mess about trying to change the zlib version but to determine why it is using the system libraries in the first place.

I'll try to look at it tomorrow, or @popey or @flexiondotorg might beat me to it.

All 27 comments

@HRK44 in the 1.26 update we moved to Electron 2.0.x and this brings GTK3 dialogs. Are you maybe using a custom theme in Ubuntu that could have an impact?

@bpasero I haven't changed anything in my Ubuntu setup, just upgraded VS code (was working fine with previous version). What kind of information from my settings would be useful for you?

@HRK44 thanks, we should try to reproduce this with a bare Electron to report it to them. Can you:

  • download and install Electron Fiddle (https://github.com/electron/fiddle/releases/download/0.1/electron-fiddle_0.1.0_amd64.deb)
  • start it
  • pick Show Me > Electron APIs > Dialog
  • run it (using the Run button)
  • attach a screenshot here how the dialog looks like (it is a file dialog but maybe it shows the same issue)

screenshot from 2018-08-23 10-21-30

Console output:

  1. Saving files to temp directory...
  2. 10:20:48 AM Saved files to /tmp/tmp-4488go5YQINcznA8
  3. 10:20:48 AM Electron v2.0.5 started.
  4. 10:20:49 AM Gtk-Message: 10:20:49.143: GtkDialog mapped without a transient parent. This is discouraged.
  5. 10:20:49 AM (electron:4639): Gtk-WARNING **: 10:20:49.336: Failed to measure available space: The specified location is not supported
  6. 10:20:49 AM( electron:4639): Gtk-WARNING **: 10:20:49.336: Failed to measure available space: The specified location is not supported
  7. 10:20:49 AM (electron:4639): Gtk-WARNING **: 10:20:49.336: Failed to measure available space: The specified location is not supported
  8. 10:20:49 AM (electron:4639): Gtk-WARNING **: 10:20:49.336: Failed to measure available space: The specified location is not supported
  9. 10:20:49 AM (electron:4639): Gtk-WARNING **: 10:20:49.337: Failed to measure available space: The specified location is not supported
  10. 10:20:49 AM (electron:4639): Gtk-WARNING **: 10:20:49.337: Failed to measure available space: The specified location is not supported

@HRK44 looks pretty normal to me. Can you:

  • close fiddle
  • start it again
  • add the following line to line 25 of "Main Process" on the left: dialog.showErrorBox("Hello", "World");
  • run it and show a screen shot of that dialog

@bpasero I put it inside the callback, it wasn't rendering anything outside (line 25).

screenshot from 2018-08-23 11-04-35

@HRK44 interesting that one looks OK too. Lets try to show the same dialog as the one in code, can you try this dialog instead: dialog.showMessageBox(mainWindow, { title: 'VSCode', message: 'Some message', button: ["Move"] });

@bpasero I commented the rest of the code (same behavior), the button is not showing for some reason

screenshot from 2018-08-23 11-21-56

@HRK44 try with this: dialog.showMessageBox(mainWindow, { title: 'VSCode', message: 'Some message', detail: "this is some details", buttons: ["Move", "Cancel"], type: "warning", cancelId: 0 }, function() {})

@bpasero looks fine

screenshot from 2018-08-23 11-47-11

@HRK44 ok here is the exact code to reproduce the same dialog:

dialog.showMessageBox(mainWindow, {
  buttons: ["Cancel", "_Move"],
  cancelId: 0,
  checkboxLabel: "Do not ask me again",
  defaultId: 1,
  message: "Are you sure you want to move 'vsc-extension-quickstart.md'?",
  noLink: true,
  title: "Code - OSS Dev",
  type: "question"
}, function () { })

@bpasero dialog shows fine

screenshot from 2018-08-23 12-32-06

@HRK44 wow, I am out of ideas on this one. Is there anything logged to VSCode console (run with code --verbose) when the dialog opens?

Does this happen with all dialogs (e.g. try to close a dirty file)?

Here is the console when I start code, that might help :

[16397:0823/132212.476507:WARNING:browser_main_loop.cc(275)] Gtk: Locale not supported by C library.
Using the fallback 'C' locale.
[16397:0823/132212.674543:WARNING:browser_main_loop.cc(275)] Gtk: Error loading image 'file:///usr/share/themes/Ambiance/gtk-3.0/assets/entry.png': Unable to load image-loading module: /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so: /snap/core/current/lib/x86_64-linux-gnu/libz.so.1: version ZLIB_1.2.9' not found (required by /usr/lib/x86_64-linux-gnu/libpng16.so.16) [16397:0823/132212.675331:WARNING:browser_main_loop.cc(275)] Gtk: Error loading image 'file:///usr/share/themes/Ambiance/gtk-3.0/assets/button.png': Unable to load image-loading module: /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so: /snap/core/current/lib/x86_64-linux-gnu/libz.so.1: versionZLIB_1.2.9' not found (required by /usr/lib/x86_64-linux-gnu/libpng16.so.16)
[16397:0823/132212.675873:WARNING:browser_main_loop.cc(275)] Gtk: Error loading image 'file:///usr/share/themes/Ambiance/gtk-3.0/assets/button-toolbar.png': Unable to load image-loading module: /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so: /snap/core/current/lib/x86_64-linux-gnu/libz.so.1: version `ZLIB_1.2.9' not found (required by /usr/lib/x86_64-linux-gnu/libpng16.so.16)
libGL error:
unable to load driver: i965_dri.so
libGL error:
driver pointer missing
libGL error:
failed to load driver: i965
libGL error:
unable to load driver: i965_dri.so
libGL error:
driver pointer missing
libGL error:
failed to load driver: i965
libGL error:
unable to load driver: swrast_dri.so
libGL error:
failed to load driver: swrast
[16431:0823/132212.953380:ERROR:gl_context_glx.cc(186)] Failed to create GL context with glXCreateContextAttribsARB.
[16431:0823/132212.953448:ERROR:gpu_info_collector.cc(51)] gl::init::CreateGLContext failed
[16431:0823/132212.953454:ERROR:gpu_info_collector.cc(119)] Could not create context for info collection.
[16431:0823/132212.953465:ERROR:gpu_init.cc(96)] gpu::CollectGraphicsInfo failed (fatal).
[16431:0823/132212.972915:ERROR:gpu_child_thread.cc(252)] Exiting GPU process due to errors during initialization
[16397:0823/132212.978112:ERROR:browser_gpu_channel_host_factory.cc(103)] Failed to launch GPU process.
[main 1:22:13 PM] Sending env to running instance...
[main 1:22:13 PM] Sent env to running instance. Terminating...
[main 1:22:13 PM] Lifecycle#kill()

screenshot from 2018-08-23 13-23-56

It happens with all dialogs.

More logs :
screenshot from 2018-08-23 13-51-19

ESC[90m[main 1:50:46 PM]ESC[0m windowsService#showMessageBox 1
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
[19768:0823/135046.951999:WARNING:browser_main_loop.cc(275)] Gtk: Error loading image 'file:///usr/share/themes/Ambiance/gtk-3.0/assets/backdrop-check-unselected.png': Unable to load image-loading module: /usr/l
ib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so: /snap/core/current/lib/x86_64-linux-gnu/libz.so.1: version ZLIB_1.2.9' not found (required by /usr/lib/x86_64-linux-gnu/libpng16.so.16) [19768:0823/135046.952045:WARNING:browser_main_loop.cc(275)] Gtk: drawing failure for widget 'GtkCheckButton': invalid matrix (not invertible) [19768:0823/135046.952054:WARNING:browser_main_loop.cc(275)] Gtk: drawing failure for widget 'GtkBox': invalid matrix (not invertible) [19768:0823/135046.952060:WARNING:browser_main_loop.cc(275)] Gtk: drawing failure for widget 'GtkBox': invalid matrix (not invertible) [19768:0823/135046.952065:WARNING:browser_main_loop.cc(275)] Gtk: drawing failure for widget 'GtkBox': invalid matrix (not invertible) [19768:0823/135046.952071:WARNING:browser_main_loop.cc(275)] Gtk: drawing failure for widget 'GtkMessageDialog': invalid matrix (not invertible) [19768:0823/135046.985482:WARNING:browser_main_loop.cc(275)] Gtk: Error loading image 'file:///usr/share/themes/Ambiance/gtk-3.0/assets/check-unselected.png': Unable to load image-loading module: /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so: /snap/core/current/lib/x86_64-linux-gnu/libz.so.1: versionZLIB_1.2.9' not found (required by /usr/lib/x86_64-linux-gnu/libpng16.so.16)
[19768:0823/135046.986894:WARNING:browser_main_loop.cc(275)] Gtk: drawing failure for widget 'GtkCheckButton': invalid matrix (not invertible)
[19768:0823/135046.987664:WARNING:browser_main_loop.cc(275)] Gtk: drawing failure for widget 'GtkBox': invalid matrix (not invertible)
[19768:0823/135046.987972:WARNING:browser_main_loop.cc(275)] Gtk: drawing failure for widget 'GtkBox': invalid matrix (not invertible)
[19768:0823/135046.987990:WARNING:browser_main_loop.cc(275)] Gtk: drawing failure for widget 'GtkBox': invalid matrix (not invertible)
[19768:0823/135046.987997:WARNING:browser_main_loop.cc(275)] Gtk: drawing failure for widget 'GtkMessageDialog': invalid matrix (not invertible)

screenshot from 2018-08-23 13-52-02

[19768:0823/135133.139056:WARNING:browser_main_loop.cc(275)] Gtk: Error loading image 'file:///usr/share/themes/Ambiance/gtk-3.0/assets/button-default-focused-hover.png': Unable to load image-loading module: /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so: /snap/core/current/lib/x86_64-linux-gnu/libz.so.1: version ZLIB_1.2.9' not found (required by /usr/lib/x86_64-linux-gnu/libpng16.so.16) [19768:0823/135133.450674:WARNING:browser_main_loop.cc(275)] Gtk: Error loading image 'file:///usr/share/themes/Ambiance/gtk-3.0/assets/button-hover.png': Unable to load image-loading module: /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so: /snap/core/current/lib/x86_64-linux-gnu/libz.so.1: versionZLIB_1.2.9' not found (required by /usr/lib/x86_64-linux-gnu/libpng16.so.16)
[19768:0823/135142.326246:INFO:CONSOLE(1397)] "%cTRACE", source: file:///snap/vscode/51/usr/share/code/resources/app/out/vs/workbench/workbench.main.js (1397)
[19768:0823/135142.349043:WARNING:x11_util.cc(1353)] X error received: serial 5458, error_code 3 (BadWindow (invalid Window parameter)), request_code 3, minor_code 0 (X_GetWindowAttributes)
[19768:0823/135142.355870:INFO:CONSOLE(1397)] "%cTRACE", source: file:///snap/vscode/51/usr/share/code/resources/app/out/vs/workbench/workbench.main.js (1397)

@HRK44 good one, I think this is because we are using a PNG icon for the dialog and that seems to break the dialog. Can we try that with the electron-fiddle again, this time using an icon:

mainWindow = new BrowserWindow({ width: 800, height: 600, icon: '/home/ticino/Desktop/code.png' })

and the icon being:

code

@bpasero it works fine with the png icon.

It might have something to do with this issue : https://forum.snapcraft.io/t/skype-exits-when-trying-to-add-a-file-to-a-chat/6138/8

screenshot from 2018-08-23 14-07-47

After further searching, there is this issue, that might be on the same problem.

@HRK44 I believe that issue is rather due to the ArchLinux OS (see https://github.com/Microsoft/vscode/issues/55934).

Would you be able to fix the ZLIB_1.2.9 issue to see if that helps? Sounds like a missing dependency to me?

@bpasero I tried some stuff but couldn't manage to successfully update this ZLIB without creating a bunch of system issues, if someone with more advanced skills in Linux would try that'd be great.

I just re-installed VS Code via apt and removed it from snap (actually I completely removed snap...) and now it works correctly.

Basically the issue is that snap is not using the latest library available on the system (libz.so.1) thus messing up other libraries that depend on it (GTK3 on ubuntu 18).

@HRK44 thanks!

FYI @flexiondotorg

For reference, the issue is not due to an incorrect zlib version suggested above. The problem is due to the snap accidentally referencing system libraries instead of it's own. This manifests with vscode loading the libgdk-pixbuf-loader library from the system, which is compiled against a different zlib than the one within the snap's files. The solution, therefore, is not to mess about trying to change the zlib version but to determine why it is using the system libraries in the first place.

I'll try to look at it tomorrow, or @popey or @flexiondotorg might beat me to it.

Any chance on getting a status update on this issue? I am facing the same thing. It would be no great hardship to try HRK44's solution but if there's any hope of seeing this resolved in the near-term I'd just as soon stick with the snap.

Today, I got VSCode version 1.32.3 (via Snap!) and the bug seems to be fixed!

Whereas 1.32.3 is the first version I've noticed has this problem. I reverted to 1.31.1 (I'm using Snap, by the way) and the problem went away. I then refreshed back to 1.32.3 and the problem returned.

Name    Version            Rev   Tracking  Publisher     Notes
core    16-2.37.4          6531  stable    canonical✓    core
vscode  1.32.3-1552606978  89    stable    snapcrafters  classic

Thanks to @flexiondotorg, this is now fixed in master! https://github.com/Microsoft/vscode/pull/70884

Still broken having removed Snapcrafter's vscode snap and installed code 1.33. :-(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukehoban picture lukehoban  Â·  3Comments

trstringer picture trstringer  Â·  3Comments

villiv picture villiv  Â·  3Comments

sijad picture sijad  Â·  3Comments

curtw picture curtw  Â·  3Comments