After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 775307 - Dynamic changes of monitor type cause segfaults
Dynamic changes of monitor type cause segfaults
Status: RESOLVED WONTFIX
Product: gamin
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Gamin Maintainer(s)
Gamin Maintainer(s)
gnome[unmaintained]
Depends on:
Blocks:
 
 
Reported: 2016-11-29 10:26 UTC by Ondrej Holy
Modified: 2018-07-01 08:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix segfaults if mon_type changes dynamically (6.13 KB, patch)
2016-11-29 10:27 UTC, Ondrej Holy
none Details | Review

Description Ondrej Holy 2016-11-29 10:26:33 UTC
Dynamic changes of monitor type (e.g. due to autofs mounts) cause segfaults from inotify code. The crucial problem is that same path may be local filesystem (e.g. ext4) one time and other time remote filesystem (e.g. nfs). Consequently, gam_add_subscription may for example call gam_kernel_add_subscription and subsequent gam_remove_subscription may call gam_poll_remove_subscription...

Core was generated by `/usr/libexec/gam_server'.
Program terminated with signal 11, Segmentation fault.
  • #0 gam_queue_event
    at gam_connection.c line 632
  • #0 gam_queue_event
    at gam_connection.c line 632
  • #1 ih_event_callback
    at inotify-helper.c line 193
  • #2 ip_event_dispatch
    at inotify-path.c line 411
  • #3 ip_event_callback
    at inotify-path.c line 474
  • #4 ik_process_eq_callback
    at inotify-kernel.c line 658
  • #5 g_timeout_dispatch
    at gmain.c line 3893
  • #6 g_main_dispatch
    at gmain.c line 2441
  • #7 g_main_context_dispatch
    at gmain.c line 3014
  • #8 g_main_context_iterate
    at gmain.c line 3092
  • #9 g_main_loop_run
    at gmain.c line 3300
  • #10 main
    at gam_server.c line 647

Possible workaround:
Same monitoring method has to be used for parent dir filesystem type also as for the remote filesystem type, e.g.:
fsset ext4 none
fsset nfs none

It can be reproduced with autofs, see the downstream bug report for more details:
https://bugzilla.redhat.com/show_bug.cgi?id=1385040
Comment 1 Ondrej Holy 2016-11-29 10:27:14 UTC
Created attachment 340966 [details] [review]
Fix segfaults if mon_type changes dynamically

It fixes segfaults which occurs when autofs mount point is monitored,
so the mon_type changes its value dynamically...

This fixes inotify part, I am not sure whether other parts don't need
similar changes also...
Comment 2 Ondrej Holy 2016-11-29 10:27:52 UTC
The patch just ensures that gam_remove_subscription is called for same monitor type, which was used by gam_add_subscription. However, we should probably also dynamically change the monitor type in such situations...
Comment 3 André Klapper 2018-07-01 08:46:44 UTC
gamin is not under active development anymore and has not seen code changes for many years.
Its codebase has been archived: https://gitlab.gnome.org/Archive/gamin/commits/master

Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Please feel free to reopen this ticket (or rather transfer the project to GNOME Gitlab, as GNOME Bugzilla is deprecated) if anyone takes the responsibility for active development again.