courier-imap utilizes gamin for file-alteration-monitor purposes with ENHANCEDIDLE=1. It seems both pieces of software has a bug which in combination causes a problem, as described by the referenced debian bug. So far I have not managed to locate a workaround other than to periodically do a killall gam_server ... which is really nasty. It seems gam_server at some point stops accepting new connections. A very simple test is to telnet to port 143 and issue a login, when locked up you will merely see the LOGIN line going to the server, nothing will appear in the system logs, and after a while the connection will presumably just drop. After a killall gam_server everything returns to normal. This looks like two bugs: 1. gamin should not stop accepting connections. 2. courier-imapd really should really fail more graciously. I'm not familiar enough with either project to know where to start debugging at a code level. Reproducible: Always
Please post your `emerge --info app-admin/gamin net-mail/courier-imap' output in a comment.
Hi, Two machines where this is confirmed: 1, bedrosia: Portage 2.2.7 (default/linux/amd64/13.0/no-multilib, gcc-4.7.3, glibc-2.16.0, 3.2.12-uls x86_64) ================================================================= System Settings ================================================================= System uname: Linux-3.2.12-uls-x86_64-Intel-R-_Xeon-R-_CPU_E5405_@_2.00GHz-with-gentoo-2.2 KiB Mem: 4042696 total, 248412 free KiB Swap: 2097136 total, 2030672 free Timestamp of tree: Thu, 26 Dec 2013 11:00:01 +0000 ld GNU ld (GNU Binutils) 2.23.2 app-shells/bash: 4.2_p45 dev-lang/python: 2.7.5-r3, 3.2.5-r3, 3.3.2-r2 dev-util/cmake: 2.8.11.2 dev-util/pkgconfig: 0.28 sys-apps/baselayout: 2.2 sys-apps/openrc: 0.12.4 sys-apps/sandbox: 2.6-r1 sys-devel/autoconf: 2.69 sys-devel/automake: 1.11.1, 1.12.6, 1.13.4 sys-devel/binutils: 2.23.2 sys-devel/gcc: 4.5.4, 4.7.3-r1 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4.2 sys-devel/make: 3.82-r4 sys-kernel/linux-headers: 3.9 (virtual/os-headers) sys-libs/glibc: 2.16.0 Repositories: gentoo uls ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="* -@EULA Intel-SDP" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -march=native -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -march=native -pipe" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--backtrack=30" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://ftp.is.co.za/gentoo-portage" USE="acpi amd64 apache2 bash-completion bzip2 cli cracklib crypt cxx diskio dri fam g729 gzip iconv iproute2 ithreads jpeg kpathsea latin1 logrotate mad mmx modules mudflap mysql ncurses nptl nptlonly openmp pam pcre png readline session sox sse sse2 ssl threads xetex zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="alias autoindex deflate dav dir env expires headers include info mime mime_magic negotiation rewrite status vhost_alias filter authz_core authz_host auth_basic auth_digest authz_default authz_user authn_core dav_fs dav_lock cgi unixd log_config socache_shmcb proxy proxy_fcgi version" APACHE2_MPMS="event" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_GB en af" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON ================================================================= Package Settings ================================================================= app-admin/gamin-0.1.10-r1 was built with the following: USE="" net-mail/courier-imap-4.8.0-r1 was built with the following: USE="berkdb fam -debug -gdbm -gnutls -ipv6 (-selinux) -trashquota" 2. atlantis: Portage 2.2.7 (default/linux/amd64/13.0/no-multilib, gcc-4.7.3, glibc-2.16.0, 3.7.3-uls x86_64) ================================================================= System Settings ================================================================= System uname: Linux-3.7.3-uls-x86_64-Intel-R-_Core-TM-_i3-2100_CPU_@_3.10GHz-with-gentoo-2.2 KiB Mem: 8086232 total, 228000 free KiB Swap: 1048568 total, 964316 free Timestamp of tree: Tue, 31 Dec 2013 17:00:01 +0000 ld GNU ld (GNU Binutils) 2.23.2 app-shells/bash: 4.2_p45 dev-lang/python: 2.6.8-r1, 2.7.5-r2, 3.1.5, 3.2.5-r2, 3.3.2-r2 dev-util/cmake: 2.8.11.2 dev-util/pkgconfig: 0.28 sys-apps/baselayout: 2.2 sys-apps/openrc: 0.12.4 sys-apps/sandbox: 2.6-r1 sys-devel/autoconf: 2.69 sys-devel/automake: 1.9.6-r3, 1.10.3, 1.11.1, 1.12.6, 1.13.4 sys-devel/binutils: 2.23.2 sys-devel/gcc: 4.4.5, 4.5.4, 4.6.3, 4.7.3-r1 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4.2 sys-devel/make: 3.82-r4 sys-kernel/linux-headers: 3.9 (virtual/os-headers) sys-libs/glibc: 2.16.0 Repositories: gentoo uls ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="* -@EULA Intel-SDP" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -march=native -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -march=native -pipe" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--backtrack=30" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://tauri.local.uls.co.za/gentoo-portage" USE="acpi amd64 apache2 bash-completion bzip2 cli cracklib crypt cxx diskio dri fam g729 gzip iconv iproute2 ithreads jpeg kpathsea latin1 logrotate mad mmx modules mudflap mysql ncurses nptl nptlonly openmp pam pcre png readline session sox sse sse2 ssl threads xetex zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="alias autoindex deflate dav dir env expires headers include info mime mime_magic negotiation rewrite status vhost_alias filter authz_core authz_host auth_basic auth_digest authz_default authz_user authn_core dav_fs dav_lock cgi unixd log_config socache_shmcb proxy proxy_fcgi version" APACHE2_MPMS="event" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_GB en af" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby18" SANE_BACKENDS="hp hpljm1005" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON ================================================================= Package Settings ================================================================= app-admin/gamin-0.1.10-r1 was built with the following: USE="" net-mail/courier-imap-4.8.0-r1 was built with the following: USE="berkdb fam -debug -gdbm -gnutls -ipv6 (-selinux) -trashquota" I'm fairly handy with a debugger (strace + gdb) so can probably get you some better internal details if need be, but I'll probably have to recompile most of the box with debug info, a process I just kicked off on atlantis for in case. I have installed a cron job to killall gam_server every hour though, so if I know what I can look for when the situation triggers I'll disable that again.
This looks to be the report in gamin side: https://bugzilla.gnome.org/show_bug.cgi?id=678813 But without much attention from upstream :(
(In reply to Pacho Ramos from comment #3) > This looks to be the report in gamin side: > https://bugzilla.gnome.org/show_bug.cgi?id=678813 > > But without much attention from upstream :( fam/gamin is obsolete in favour of inotify, so you shouldn't be suprised any fixes should be towards porting packages away from using fam/gamin ;)
Hi, A quick google for "courier-imap inotify" seems to indicate that gamin support was added specifically in order to utilize inotify. If I were to write a patch for courier-imap to not require gamin/fam and to instead utilize inotify directly (haven't looked at the code at all yet but compared to squid it can't be much worse), would you be willing to carry that even if upstream rejects it?
I have a related bug in kde-base/dolphin-4.12.2 since a while. Changing to some directories on a NTFS partition lets dolphin hang. Killing the process of /usr/libexec/gam_server then dolphin goes on. Later the gam_server respawns. I found an upstream bug for that. https://bugs.kde.org/show_bug.cgi?id=323316 ================================================================= Package Settings ================================================================= app-admin/gam-server-0.1.10-r1 was built with the following: USE="(multilib) -debug" ABI_X86="64" kde-base/dolphin-4.12.2 was built with the following: USE="semantic-desktop thumbnail (-aqua) -debug -handbook" sys-fs/ntfs3g-2014.2.15 was built with the following: USE="acl external-fuse ntfsdecrypt ntfsprogs xattr -debug -static-libs -suid" the same with sys-fs/ntfs3g-2013.1.13
I have the feeling the bug is gone for me. Did not have new hangs in dolphin since latest gam-server + (lib)gamin updates Is the bug gone for you too, Jaco? ================================================================= Package Settings ================================================================= app-admin/gam-server-0.1.10-r2 was built with the following: USE="-debug" app-admin/gamin-0.1.10-r1 was built with the following: USE="" ABI_X86="64 -32 -x32" dev-libs/libgamin-0.1.10-r5 was built with the following: USE="-debug -python -static-libs" ABI_X86="64 -32 -x32" PYTHON_TARGETS="python2_7 -python2_6" kde-base/dolphin-4.12.4 was built with the following: USE="semantic-desktop thumbnail (-aqua) -debug -handbook" sys-fs/ntfs3g-2014.2.15 was built with the following: USE="acl external-fuse ntfsdecrypt ntfsprogs xattr -debug -static-libs -suid"
The bug is still there. My dolphin was hanging again. Killing /usr/libexec/gam_server helped.
Although the docs point to DVeilliards page there is a git repo at https://github.com/GNOME/gamin The server subdirectory has commits as recent as "Matthias Clasen committed on Feb 1, 2013" Meanwhile there are 300+ bugs at the Gnome bugzilla. While it looks as though DV has done no work on this since the 2005 release. searching google for "gamin obsolete use inotify" returns http://stackoverflow.com/questions/8381566/best-way-to-monitor-file-system-changes-in-linux where the answer with the highest vote total replies- "You should use a library instead of inotify and friends - something like FAM or Gamin (it's the same API for both). This will make your program portable to other Unixes." which contradicts comment #4 Also there is a patch in https://bugzilla.gnome.org/show_bug.cgi?id=693449 to fix the configure.in usage and make it use configure.ac
recently there were some upstream fixes in kcoreaddons: https://quickgit.kde.org/?p=kcoreaddons.git&a=search&h=HEAD&st=commit&s=fam Additionally the live ebuild from kde overlay now changed to a hard disabled fam USE flag: kde-frameworks/kcoreaddons-9999::kde was built with the following: USE="nls -debug -doc (-fam) -test" ABI_X86="64" The interesting is I don't see that change there: https://gitweb.gentoo.org/proj/kde.git/log/kde-frameworks/kcoreaddons depclean: >>> Calculating removal order... >>> These are the packages that would be unmerged: virtual/fam selected: 0-r1 protected: none omitted: none app-admin/gamin selected: 0.1.10-r1 protected: none omitted: none app-admin/gam-server selected: 0.1.10-r2 protected: none omitted: none dev-libs/libgamin selected: 0.1.10-r5 protected: none omitted: none
(In reply to jospezial from comment #10) > recently there were some upstream fixes in kcoreaddons: > https://quickgit.kde.org/?p=kcoreaddons.git&a=search&h=HEAD&st=commit&s=fam > > Additionally the live ebuild from kde overlay now changed to a hard disabled > fam USE flag: > > kde-frameworks/kcoreaddons-9999::kde was built with the following: > USE="nls -debug -doc (-fam) -test" ABI_X86="64" > > The interesting is I don't see that change there: > https://gitweb.gentoo.org/proj/kde.git/log/kde-frameworks/kcoreaddons This change was made in the main tree as a result of bug #559508.
What is the status with 4.16.2-r1 ? What does happen if you disable the optional fam support?