https://bugs.kde.org/show_bug.cgi?id=528585

            Bug ID: 528585
           Summary: VLC snap crashes when opening a file if it was started
                    a second time during first-run setup
    Classification: KDE Neon
           Product: neon
      Version First unspecified
       Reported In:
          Platform: Ubuntu
                OS: Linux
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: Snaps
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

Created attachment 198273
  --> https://bugs.kde.org/attachment.cgi?id=198273&action=edit
backtrace

The launcher script in kf6-core24 (common/mark-and-exec in
neon/snap-packaging/snapcraft-desktop-integration, installed as
/snap/kf6-core24/current/snap/command-chain/desktop-launch6) writes its "setup
done" marker ($SNAP_USER_DATA/.last_revision) before setup is actually done.

The background jobs it waits for include update-mime-database,
gdk-pixbuf-query-loaders, fontconfig and the icon caches. For me they took
about 3 minutes.

If you start the app again during those 3 minutes, the new launch sees the
marker, skips setup, and starts without the mime database
($XDG_DATA_HOME/mime/mime.cache). Without it, gdk-pixbuf can't tell what a PNG
is, and GTK 3 crashes the first time it tries to draw an icon. In VLC that
happens when the file dialog opens.

The script is the same on master, work.core24 and work.core26.

STEPS TO REPRODUCE
What happened to me (depends on timing):
1. sudo snap install vlc
2. Start VLC. Before its window shows up, start it again.
3. In the window that opens, click Media > Open File.

Reliable way (crashed 3 out of 3 times):
1. mv ~/snap/vlc/current/.local/share/mime
~/snap/vlc/current/.local/share/mime.bak
2. Start VLC and click Media > Open File.
3. To undo: mv ~/snap/vlc/current/.local/share/mime.bak
~/snap/vlc/current/.local/share/mime

OBSERVED RESULT
VLC crashes as soon as the file dialog opens, before picking any file:

(vlc:2391821): Gtk-WARNING **: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../../../gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion
failed (error == NULL): Failed to load
/snap/vlc/4472/data-dir/icons/Yaru/16x16/status/image-missing.png: Unrecognized
image file format (gdk-pixbuf-error-quark, 3)
Bail out! Gtk:ERROR:../../../gtk/gtkiconhelper.c:495:ensure_surface_for_gicon:
assertion failed (error == NULL): Failed to load
/snap/vlc/4472/data-dir/icons/Yaru/16x16/status/image-missing.png: Unrecognized
image file format (gdk-pixbuf-error-quark, 3)

Short backtrace (full one attached):

#2  abort () from libc.so.6
#5  ensure_surface_for_gicon () at gtk/gtkiconhelper.c:495
#71 gtk_file_chooser_widget_init () at gtk/gtkfilechooserwidget.c:8896
#92 gtk_file_chooser_dialog_new () at gtk/gtkfilechooserdialog.c:713
#93 QGtk3FileDialogHelper::QGtk3FileDialogHelper() from libqgtk3.so
#95 QXdgDesktopPortalTheme::createPlatformDialogHelper() from
libqxdgdesktopportal.so
#99 QFileDialog::getOpenFileUrls() from libQt6Widgets.so.6
#100 ?? from vlc/plugins/gui/libqt_plugin.so

What the journal showed the first time:
- First launch starts setup.
- Second launch crashes.
- Third launch crashes the same way.
- mime.cache gets written and the first window finally appears.
- After that, no more crashes.

I also loaded image-missing.png directly with the snap's own gdk-pixbuf. With
the mime folder empty it fails ("Couldn't recognize the image file format").
With mime.cache in place it loads fine.

EXPECTED RESULT
VLC shouldn't crash if it's started again during first-run setup.

SOFTWARE/OS VERSIONS
Operating System: Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic
Desktop: GNOME on Wayland (VLC runs through XWayland)
KDE Plasma Version: n/a
KDE Frameworks Version: 6.31.0 (from kf6-core24)
Qt Version: 6.11.2 (from kf6-core24)

ADDITIONAL INFORMATION
vlc 3.0.24-rc1 (rev 4472), kf6-core24 6.11.2-6.31.0-6.7.5-26.08.2 (rev 69),
gtk-common-themes rev 1535, snapd 2.78
Inside kf6-core24: GTK 3.24.41, gdk-pixbuf 2.42.10, GLib 2.84.0,
shared-mime-info 2.4

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to