Proposed fix here: https://salsa.debian.org/gnome-
team/glib/-/merge_requests/52

This turned out to need an additional patch because the original patch
was broken:
https://gitlab.freedesktop.org/xdg/xdgmime/-/merge_requests/32

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to glib2.0 in Ubuntu.
https://bugs.launchpad.net/bugs/2097496

Title:
  libglib: Crash due to infinite recursion in MIME subclassing

Status in GLib:
  Fix Released
Status in glib2.0 package in Ubuntu:
  Fix Released
Status in glib2.0 source package in Jammy:
  In Progress
Status in glib2.0 source package in Noble:
  Fix Released
Status in glib2.0 source package in Oracular:
  Fix Released
Status in glib2.0 source package in Plucky:
  Fix Released

Bug description:
  [ Impact ]

  There's an infinite recursion in MIME resolution bug which affects
  processes using gio to resolve certain MIME types.  In my case,
  tracker-miner-fs-3 has been crashing in a loop for weeks due to this
  issue.

  This affects any program that attempts to resolve a "recursive" MIME
  type using glib.

  I reported the issue to the GLib maintainers here:
  https://gitlab.gnome.org/GNOME/glib/-/issues/3601

  The fix is given here: 
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3714
  The backport to 2.78 is here: 
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3718

  [ Test Plan ]

  1. Install the mime file from the attachment with:
     $ mkdir -p ~/.local/share/mime/packages
     $ wget https://launchpadlibrarian.net/790257958/js-test.xml -O 
~/.local/share/mime/packages/js-test.xml
     $ update-mime-database ~/.local/share/mime
  2. Create a javascript file:
     $ echo "{}" > ~/foo.js
  3. Try to open the file:
     $ xdg-open ~/foo.js
  4. Verify that the file was opened in your default text editor for JavaScript
  5. Verify that the program did not crash

  6. Open the "Files" app
  7. Navigate to the Home directory
  8. Right-click "foo.js"
  9. Verify that Nautilus did not crash
  10. Click "Open With Other Application"
  11. Verify that the dialog says "Opening JavaScript program" files

  To cleanup the created files, you may run these commands:
     $ rm ~/.local/share/mime/packages/js-test.xml
     $ update-mime-database ~/.local/share/mime
     $ rm ~/foo.js

  [ Where problems could occur ]

  The patch will not affect the behaviour of the MIME type resolver except 
detecting and avoiding infinite subclassing for buggy recursive types.
  The same patch is in place in all newer Ubuntu versions without known 
side-effects.
  Problems could manifest with file-associations not being honoured in case the 
MIME type resolver is broken (which is verified in the test plan), or with 
crashes similar to the ones here reported in the patch is inconclusive.

To manage notifications about this bug go to:
https://bugs.launchpad.net/glib/+bug/2097496/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to