Infinite loop in favorite-vfs-file-enumerator next_file() freezes system (xdg-desktop-portal floods log)
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- c, linux
- 领域
- desktop-dev
调研方向
受影响的入口点是 favorite-vfs-file-enumerator.c: next_file(); 首先阅读其循环以及 xapp-favorites.c 中所引用的 display-name 更新路径。验证 missing-display-name 和 failed-query 两种情况都会推进枚举并结束或报告错误,而不是重复执行,然后确认对话框不再向 logs 大量输出。
由索引模型根据 Issue 内容生成。
描述
System
- Linux Mint 22.3 Cinnamon (X11)
- libxapp1 3.2.3+zena, xdg-desktop-portal-xapp 1.1.3+zena, xdg-desktop-portal-gtk 1.15.1-1build2
What happened
After a file open/save dialog was opened, xdg-desktop-portal-gtk logged
"(../libxapp/favorite-vfs-file-enumerator.c:57):next_file: code should not be reached"
about 200,000 times per second for 78 minutes (5.1M lines kept by journald,
several million more suppressed every 30s) until the desktop froze and needed a hard reboot.
Cause (from reading the source on master)
In next_file(), when xapp_favorites_find_by_display_name() returns NULL,
the code calls g_warn_if_reached() but does not advance priv->current_pos
inside the while loop, so while (priv->current_pos != NULL && info == NULL)
retries the same entry forever. current_pos is only advanced after the loop.
The same applies if g_file_query_info() returns NULL in the else branch
(infinite loop, without the warning).
Trigger
Favorites included a network:///dnssd-server-._smb._tcp location. Its
initial display name (the URI basename) is later replaced by the real display
name (" (File Sharing)") from the async query in xapp-favorites.c. If the
enumerator snapshotted the display names before that update, the old name is
no longer found and the loop never ends. It's timing-dependent: here, opening the
dialog also triggered a slow CIFS automount of another favorite at the same moment.
A favorite for an unmounted ftp:// location (query fails) looks like it could
cause the same loop via the else branch.
Workaround
Removing the network:/// and ftp:// entries from org.x.apps.favorites list.
Suggested fix
Advance priv->current_pos inside the loop on both the not-found and the
query-failure paths (and return/propagate the error instead of spinning).
I did not deliberately reproduce it (it hard-freezes the machine).
- 主要语言
- C
- 星标
- 167
- 派生
- 49
- 平均合并
- 5 天 15 小时
- 30 天内合并 PR
- 2
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
linuxmint/xapp 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 3/5 1-2 天 新手友好度 72/100
-
难度 4/5 3-5 天 新手友好度 42/100
-
难度 2/5 1-3 小时 新手友好度 55/100
-
难度 4/5 3-5 天 新手友好度 45/100
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
johnsonjh/emu2-cpm86#68 · 1 条评论 ·
维护者通常 1 天内回复
-
Zenmap Crash未关闭Zenmap
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
BasedHardware/omi#19306 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
fastfetch-cli/fastfetch#2619 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
serhii-londar/open-source-mac-os-apps#1419 ·
维护者通常 5 天内回复