Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Infinite loop in favorite-vfs-file-enumerator next_file() freezes system (xdg-desktop-portal floods log)

未关闭 适合新手
#215 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 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,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

linuxmint/xapp 的其他 Issue

查看 linuxmint/xapp 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。