Bug 512766 - Haruna crashes when trying to open file whose path contain "[" and/or "]" characters
Summary: Haruna crashes when trying to open file whose path contain "[" and/or "]" cha...
Status: RESOLVED FIXED
Alias: None
Product: Haruna
Classification: Applications
Component: generic (other bugs)
Version First Reported In: 1.6.0
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: george fb
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-29 18:42 UTC by zhemaitisvladimir
Modified: 2025-12-25 16:01 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zhemaitisvladimir 2025-11-29 18:42:40 UTC
SUMMARY
When trying to open file whose path contains "[" and/or "]" characters program will crash.

BACKTRACE
When running under gdb, recreating the bug causes Haruna to exit with following message:

Thread 1 "haruna" received signal SIGSEGV, Segmentation fault.
QStringBuilder<QStringBuilder<QString const&, QLatin1Char>, QString&>::convertTo<QString> (this <optimized out>)
    at /usr/include/qt6/QtCore/qstringbuilder.h:105
105	       const qsizetype len = Concatenable::size(*this);

Running backtrace shows:

(gdb) backtrace
#0  QStringBuilder<QStringBuilder<QString const&, QLatin1Char>, QString&>::convertTo<QString> (
    this=<optimized out>) at /usr/include/qt6/QtCore/qstringbuilder.h:105
#1  QStringBuilder<QStringBuilder<QString const&, QLatin1Char>, QString&>::operator QString (
    this=<optimized out>) at /usr/include/qt6/QtCore/qstringbuilder.h:131
#2  QQuickFileDialogImplPrivate::updateSelectedFile (this=0x5555572db000, oldFolderPath=...)
    at /usr/src/debug/qt6-declarative/qtdeclarative/src/quickdialogs/quickdialogsquickimpl/qquickfiledialogimpl.cpp:98
Backtrace stopped: Cannot access memory at address 0x7fffffff7fb8

STEPS TO REPRODUCE

1. Find a sample .mkv file (should work for every format, but I have only tested mkv), make sure it runs ok with Haruna under normal circumstances.
2. Place it into directory containing "[" or "]" characters (tested directory names: "[", "]", "[]", "test[dir]")
3. Run Haruna and open file with context menu (default binding Ctrl+O, then navigate to the file destination and then open it)

OBSERVED RESULT
Haruna crashes

EXPECTED RESULT
Haruna plays selected video

SOFTWARE/OS VERSIONS
Linux (Arch Linux)
Compositor: Wayland (Hyprland)
Kernel: Linux 6.17.9
Qt Version: 6.10.1
Haruna version: 1.6.0

ADDITIONAL INFORMATION
The actual file name may contain theese symbols (i.e. "[].mkv" opens just fine in all scenarios). Seemingly only the file's parent directories affect this behaviour.

Additionaly, when providing path from command line everything works just fine. The bug is there only when opening via the context menu.
Comment 1 GoldBarb 2025-12-04 11:18:20 UTC
KDE Plasma Version: 6.5.3
KDE Frameworks Version: 6.20.0
Qt Version: 6.10.1
Distribution: Archlinux
Haruna: 1.6.0

I cannot replicate this specific issue on Plasma.

Steps to replicate:

1. create a directory called 'test[dir]' or '[]'  or '[' or ']' in /home/user1
2. place sample.mkv file into above directory
3. open haruna
4. use  right click to open the context menu > open file > navigate to file location
5. use [Ctrl+O] then navigate to file location

In either steps 4/5 above the file opens as expected.
Comment 2 zhemaitisvladimir 2025-12-04 20:02:19 UTC
(In reply to GoldBarb from comment #1)

I installed KDE Plasma and tried to replicate the bug there (unsuccessfully). It appears to be Hyprlnad specific or something...
The bug is very niche and is easy to bypass. It is also inconsistent between window managers (appears only for Hyprlnad as far as I'm concerned).

Maybe it's not worthwhile to investigate after all
Comment 3 zhemaitisvladimir 2025-12-25 16:01:08 UTC
Ok, latest haruna version 1.7.0-1 fixes the issue entirely. After updating haruna's pacman package I wasn't able to replicate the bug. As far as I'm concerned the bug is fixed, and thus the thread should be marked as resolved. 

Thanks to everyone involved :)