Repository navigation
[Bug]: Desktop main process SIGTRAPs when dragging a file with non-ASCII characters and a space in its name into the composer (Linux/Wayland) #13746
Description
Activity
This is an Electron/Chromium crash, not the composer attachment code. Dropping a file on Linux Wayland is handled in the browser process before
makeWorkspaceFileDropHandlersoraddComposerAttachmentsrun. Those only see aFileafter Chromium has accepted the drop. TheSIGTRAPwithsi_code: SI_KERNELis Chromium's fatal check, and the dump is thet3codemain process, so the window and the bundled server both go away. A renderer crash would be reloaded; this one is not.The same signature is already tracked upstream in electron/electron#54153 (Electron 44.4.3, KDE Wayland, non-ASCII filename, ASCII rename works, file bytes irrelevant). Maintainers reproduced it on Chrome and closed it as upstream on September 24. It is not fixed. This repo is still on Electron 44.4.2, including the nightlies you tested. The
mime.cacheline is unrelated Chromium noise; it also shows up for drops that attach.The space is probably not required. Both of your failing names contain non-ASCII characters, and the Electron report crashes on an em dash alone. Renaming to ASCII is the workaround that is known to work. The paperclip button uses the file chooser (
<input type="file">) instead of the Wayland drag path, so it may also work. That is not confirmed.- addedbugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.via-triageFiled through npx t3 triageFiled through npx t3 triage
on Sep 26, 2026 Root cause found. This is not a T3 Code bug. It is a Chromium
CHECKin the browser process, triggered because the process runs with a non-UTF-8LC_CTYPE. The space in the name is irrelevant; one non-ASCII character is enough.Symbolized stack
I symbolized the core dump with the official Electron 44.4.2 breakpad symbols (build-id
e3816f4c…matches). Main thread:content::PathInfo::PathInfo(PathType, FilePath, std::string) base/immediate_crash.h:180 content::FileInfosToDataTransferFiles(...) content/browser/renderer_host/data_transfer_util.cc:118 content::DropDataToDragData(...) data_transfer_util.cc:231 content::RenderWidgetHostImpl::DragTargetDrop(...) render_widget_host_impl.cc:2121 content::WebContentsViewAura::CompleteDrop(...) web_contents_view_aura.cc:1875 ... ui::WaylandDataDragController::OnDragDrop(...) wayland_data_drag_controller.cc:571 ui::WaylandDataDevice::OnDrop(...) wayland_data_device.cc:151The crash happens while Chromium converts the drop, before the renderer receives any drag event. No T3 Code code (composer, preload, IPC) runs.
Why
data_transfer_util.cc:114checks that theFilePathdisplay name is non-empty, but line 118 passesdisplay_name.AsUTF8Unsafe()toPathInfo, which doesCHECK(!display_name.empty())(file_system_access_permission_context.h:85).- On desktop Linux,
AsUTF8Unsafe()goes throughSysNativeMBToWide()/mbrtowc(), which returns an empty string for any non-ASCII byte whenLC_CTYPEisC. content_main.cccallssetlocale(LC_ALL, ""). glibc fails that call as a whole when any locale variable names a locale that is not installed. On my machine, KDE's Region settings exportLC_TIME=en_GB.UTF-8, but onlyen_US.UTF-8is generated. So the process stays inCeven thoughLANG=en_US.UTF-8.
I replayed the same libc calls with the app's environment:
== LANG=en_US.UTF-8 LC_TIME=en_GB.UTF-8 (en_GB not installed): setlocale(LC_ALL, "") returned: NULL -> LC_CTYPE: C 'ação b.txt': mbstowcs -> -1 'ação.txt': mbstowcs -> -1 'a b.txt': mbstowcs -> 7 'plain.txt': mbstowcs -> 9 == LANG=en_US.UTF-8 only: setlocale(LC_ALL, "") returned: en_US.UTF-8 (all names convert)Workaround
Make every locale variable name an installed locale, for example by enabling
en_GB.UTF-8 UTF-8in/etc/locale.genand runninglocale-gen, or by settingLC_TIMEto an installed locale.LC_ALL=Creproduces the crash.T3 Code cannot work around this: the locale is fixed by Chromium before any app JavaScript runs, and the crash happens before the drop reaches the renderer.
Same crash upstream: electron/electron#54153 (Electron maintainers confirmed it reproduces in Chrome and asked for an upstream Chromium report) and probably electron/electron#49804 ("crashes when launched from the desktop file, not from a terminal"). I'm filing the Chromium report and will link it here.
Closing: this is not a T3 Code bug. It is a Chromium crash in the browser process, and it only happens when the process runs with a non-UTF-8
LC_CTYPE. Summary for anyone who lands here with the same symptom (the detailed analysis is in the comment above).Symptom
On Linux, dropping a file whose name contains any non-ASCII character (
ação.txt,repro — test.md, …) onto an Electron/Chromium window kills the main process with SIGTRAP (si_code: SI_KERNEL). Nothing is logged, and nodragenter/dragover/drophandler runs. ASCII names work, and the space in the name is irrelevant. It affects any Electron app, not only T3 Code.Root cause
Symbolized stack (Electron 44.4.2 = Chromium 152.0.7977.130, official breakpad symbols):
content::PathInfo::PathInfo(PathType, FilePath, std::string) base/immediate_crash.h:180 content::FileInfosToDataTransferFiles(...) content/browser/renderer_host/data_transfer_util.cc:118 content::DropDataToDragData(...) data_transfer_util.cc:231 content::RenderWidgetHostImpl::DragTargetDrop(...) render_widget_host_impl.cc:2121 content::WebContentsViewAura::CompleteDrop(...) web_contents_view_aura.cc:1875 ... ui::WaylandDataDragController::OnDragDrop(...) wayland_data_drag_controller.cc:571 ui::WaylandDataDevice::OnDrop(...) wayland_data_device.cc:151content_main.cccallssetlocale(LC_ALL, "")at startup. glibc fails that whole call, and leaves every category atC, when any locale variable names a locale that is not installed. In my case KDE's Region settings exportedLC_TIME=en_GB.UTF-8while onlyen_US.UTF-8was generated, so the process ran inCeven thoughLANG=en_US.UTF-8.- On a drop,
FileInfosToDataTransferFiles()checks that theFilePathdisplay name is non-empty (line 114), but passesdisplay_name.AsUTF8Unsafe()toPathInfo(line 118). - On desktop Linux,
AsUTF8Unsafe()converts throughSysNativeMBToWide()/mbrtowc(), which returns an empty string for any non-ASCII byte in theClocale. PathInfothen hitsCHECK(!this->display_name.empty())(content/public/browser/file_system_access_permission_context.h:85), and the browser process traps.
The crash happens before the drop reaches the renderer, and the locale is fixed before any app JavaScript runs, so T3 Code cannot work around it. The same code is still on Chromium
main.Am I affected?
Run
localefrom the same environment that launches the app. Lines likelocale: Cannot set LC_ALL to default locale: No such file or directorymean yes. Compare yourLANG/LC_*values withlocale -a. Launching from a terminal can behave differently from launching from the desktop menu if the session exports extraLC_*variables, which matches the "only crashes when launched from the GUI" report in electron/electron#49804.Fix
Make every
LANG/LC_*variable name an installed locale. On Arch: uncomment the locale in/etc/locale.genand runlocale-gen, or change the variable (for example in KDE's Region settings) to a locale you have. Restart the app afterwards.LC_ALL=Creproduces the crash on purpose.Upstream
- Crash (SIGTRAP) on drag-and-drop of a file whose filename contains a non-ASCII character (U+2014) — Linux/Wayland electron/electron#54153: the same crash. Electron maintainers confirmed it reproduces in Chrome and asked for an upstream Chromium report.
- Crash on drag and drop with a Unicode file extension on Linux electron/electron#49804: very likely the same bug.
- The Chromium-side fix is to guard on the converted string instead of the
FilePathindata_transfer_util.cc(or to convert without depending on the C library locale). Note that thePathInfo(PathType, FilePath)constructors derive the display name the same way, so other File System Access entry points may hit the same CHECK in aC-locale process.
Before submitting
Area
apps/desktop
Steps to reproduce
plain.pdf(any PDF, ASCII name) andação b.txt(a few bytes, non-ASCII characters and a space in the name).plain.pdffrom the file manager (Dolphin) into the composer. It is attached normally.ação b.txtfrom the file manager into the composer.Expected behavior
The file is attached like any other file.
Actual behavior
The desktop main process dies with SIGTRAP a few seconds after the drop (systemd-coredump:
Signal: 5 (TRAP) si_code: SI_KERNEL). The window disappears and any thread in progress loses its session.The trigger is the file name, not the type or size: a 1.7 MB PDF named
Oportunidades … para comércio exterior no Brasil.pdfcrashes the app, while a byte-identical copy renamed topdfsemacento.pdfattaches fine. Renaming files to ASCII names without spaces avoids the crash. I have not isolated whether the accent or the space alone is enough.Reproduced 5 times in one evening across three nightly builds (20260924.2200, 20260925.2269, 20260926.2282).
Impact
Major degradation or frequent failure
Version or commit
0.0.43-nightly.20260926.2282 (also 0.0.43-nightly.20260925.2269 and 0.0.43-nightly.20260924.2200)
Environment
Arch Linux, kernel 7.2.4, KDE Plasma (KWin 6.7.5) on Wayland (
--ozone-platform=wayland), Electron 44.4.2 / Chrome 152.0.7977.130, LANG=en_US.UTF-8Logs or stack traces
The
mime.cachewarning also appears for files that attach fine and in other Electron apps on this machine, so it is probably noise. The binary is stripped, so the core dumps have no symbols. I can provide them or run a debug build if that helps.Workaround
Rename the file to an ASCII name without spaces before dragging it in.