Bug 504938

Summary: Dolphin hangs indefinitely on reading /usr/share/icons/hicolor/scalable/mimetypes/application-x-ldraw.svgz when a file with that mimetype is found in the directory being displayed
Product: [Applications] dolphin Reporter: Damian Nowak <oferty>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: REPORTED ---    
Severity: crash CC: dolphin-bugs-null, oferty
Priority: NOR    
Version First Reported In: 25.04.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: strace showing the hang on reading the XML
/usr/share/icons/hicolor/scalable/mimetypes/application-x-ldraw.svgz

Description Damian Nowak 2025-05-28 22:59:48 UTC
Created attachment 181839 [details]
strace showing the hang on reading the XML

SUMMARY
Dolphin hangs indefinitely on reading /usr/share/icons/hicolor/scalable/mimetypes/application-x-ldraw.svgz

STEPS TO REPRODUCE
1. Ensure the file /usr/share/icons/hicolor/scalable/mimetypes/application-x-ldraw.svgz exists (comes from the LDraw/LeoCAD icon theme package on this system) - or just dump it as an SVG icon for a different mimetype present on your OS.
2. mkdir ~/test-ldraw && touch ~/test-ldraw/empty.dat
3. dolphin ~/test-ldraw


OBSERVED RESULT
Dolphin becomes unresponsive.  
`strace` attached to the Dolphin process shows a tight loop of:

read(74</usr/share/icons/hicolor/scalable/mimetypes/application-x-ldraw.svgz>, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!-- Created with Inkscape (http://www.inkscape.org/) -->\n\n<svg\n   xmlns:"..., 16384) = 16384
read(74</usr/share/icons/hicolor/scalable/mimetypes/application-x-ldraw.svgz>, "radient3374\"\n       id=\"radialGradient2516\"\n       gradientUnits=\"userSpaceOnUse\"\n       gradientTransform=\"matrix(0.4070671,0,0"..., 16384) = 16384
brk(0x6278224b7000)                     = 0x6278224b7000
read(74</usr/share/icons/hicolor/scalable/mimetypes/application-x-ldraw.svgz>, " -14.260452,-2.492588 -14.260452,-5.567354 0,-3.074766 6.384623,-5.5673542 14.260452,-5.5673542 7.875829,0 14.260452,2.4925882 1"..., 16384) = 2942
read(74</usr/share/icons/hicolor/scalable/mimetypes/application-x-ldraw.svgz>, "", 13442) = 0
read(74</usr/share/icons/hicolor/scalable/mimetypes/application-x-ldraw.svgz>, "", 16384) = 0
read(74</usr/share/icons/hicolor/scalable/mimetypes/application-x-ldraw.svgz>, "", 16384) = 0
read(74</usr/share/icons/hicolor/scalable/mimetypes/application-x-ldraw.svgz>, "", 16384) = 0
… (repeats forever)

Removing or moving the SVG icon file out of /usr/share/icons/hicolor/scalable/mimetypes/
immediately stops the hang.

EXPECTED RESULT
Dolphin should display the directory normally; reading an SVG icon once should not lock the GUI in an infinite read() loop.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 5.116.0
Qt Version: 5.15.16
Dolphin Version: 25.04.1
Kernel Version: 6.14.6-arch1-1
Graphics Platform: x11

ADDITIONAL INFORMATION
* The same directory opens instantly in other file managers (e.g. Krusader, Thunar).
* Happens with any .dat file, even zero-byte ones, so content is not relevant.
* Regression status: unknown - the directory I opened dates back to a long time ago; I didn't have a reason to navigate there in Dolphin for a long time
Comment 1 Damian Nowak 2025-05-28 23:01:32 UTC
Created attachment 181840 [details]
/usr/share/icons/hicolor/scalable/mimetypes/application-x-ldraw.svgz

SVG XML file