Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở Phù hợp với người mới
#215 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c, linux
Lĩnh vực
desktop-dev

Hướng nghiên cứu

Điểm vào bị ảnh hưởng là favorite-vfs-file-enumerator.c: next_file(); trước tiên hãy đọc vòng lặp của nó và đường dẫn cập nhật display-name được tham chiếu trong xapp-favorites.c. Xác minh rằng cả trường hợp missing-display-name và failed-query đều làm tiến trình liệt kê tiếp tục và kết thúc hoặc báo lỗi, thay vì lặp lại, sau đó xác nhận rằng hộp thoại không còn làm ngập logs.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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).

Ngôn ngữ chính
C
Star
167
Fork
49
Merge trung bình
5 ngày 15 giờ
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của linuxmint/xapp

Tất cả issue của linuxmint/xapp

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.