Bugzilla – Bug 556479
autofs / automount crashes with Segmentation fault
Last modified: 2016-04-15 10:32:51 UTC
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091103 SUSE/3.5.5-2.2 Firefox/3.5.5 Just accesing /net crashes automount with Segmentation fault . This is an openSUSE 11.2, upgraded from 11.1 with zypper dup. auto.master only has the lines /net -hosts +auto.master Starting automount on a console gives the following output: # /usr/sbin/automount -vdf Starting automounter version 5.0.4, master map auto.master using kernel protocol version 5.01 lookup_nss_read_master: reading master files auto.master parse_init: parse(sun): init gathered global options: (null) lookup_read_master: lookup(file): read entry /net lookup_read_master: lookup(file): read entry +auto.master lookup_nss_read_master: reading master files auto.master parse_init: parse(sun): init gathered global options: (null) lookup_nss_read_master: reading master nis auto.master parse_init: parse(sun): init gathered global options: (null) lookup(yp): read of master map auto.master failed: No such map in server's domain lookup(file): failed to read included master map auto.master master_do_mount: mounting /net automount_path_to_fifo: fifo name /var/run/autofs.fifo-net lookup_nss_read_map: reading map hosts (null) parse_init: parse(sun): init gathered global options: (null) mounted indirect on /net with timeout 600, freq 150 seconds st_ready: st_ready(): state = 0 path /net ghosting enabled handle_packet: type = 3 handle_packet_missing_indirect: token 8, name c3m, request pid 17906 attempting to mount entry /net/c3m Segmentation fault (core dumped) The last four lines only appear when running "ls /net/c3m" . Running "ls /net" works fine and shows a list of hosts, including our server c3m. Our configuration has been working on this workstation for over 2 years and up to yesterday on 11.1. Mounting and autofs/automount still works on other workstations running 11.1. Running "mount c3m:/tmp /mnt" also works fine and the FS gets mounted and is accessible under /mnt. Reproducible: Always Steps to Reproduce: 1. rcautofs start 2. ls /net/c3m Actual Results: automount crashes. Expected Results: No automount crash.
I reinstalled openSUSE 11.2 from scratch, the segfault is still there.
Happens on my system as well. It crashes when NULL pointer is used at lookup_hosts.c:151, because it was set to NULL at lookup_hosts.c:148. 146 if (!me->mapent) { 147 cache_delete(me->mc, name); 148 me = NULL; 149 } 150 151 cache_unlock(me->mc);
It is fixed in 5.0.5 where the cache pointer is stored before me is set to NULL and is later used to unlock the cache. if (me) { struct mapent_cache *fmc = me->mc; if (me->status >= time(NULL)) { cache_unlock(fmc); return NSS_STATUS_NOTFOUND; } if (!me->mapent) { cache_delete(fmc, name); me = NULL; } cache_unlock(fmc); }
Created attachment 329407 [details] extracted fix from 5.0.5 I have tried the patch and it indeed fixes the problem here. Hope it will help.
Could you provide also a rpm package including this patch?
Created attachment 329461 [details] ELF 64-bit LSB shared object, x86-64 I am sorry, I don't have rpm, but if you are indeed on x86_64 architecture, you can copy attached file to /usr/lib64/autofs/, once you restart autofs it should fix the crash.
Ok, thanks Radek. The attached lookup_hosts.so file works for me too. autofs is not segfaulting anymore. For me this bug is fixed. An updated autofs rpm package would be very useful. Thanks, Richard
(In reply to comment #7) > An updated autofs rpm package would be very useful. Yup. I am not working on packaging autofs, I just got annoyed by automounter crashing on my machine as well :-) Vojta, please could you reassign the bug to the packager of autofs? (sorry I don't know how the opensuse release/updates process works)
Hi, just for those who have the same problem, until no RPM is provided. it's quite easy to compile the code yourself. For my SuSE 32 bit system I did: - fetch the source http://www.kernel.org/pub/linux/daemons/autofs/v5/autofs-5.0.5.tar.gz - unpack it, and: > make configure; make; make install - restart autofs: > rcautofs restart and everything's fine. Jürgen
There's an updated autofs package available in the filesystems devel project: http://download.opensuse.org/repositories/filesystems/ It should reach Factory after some rounds of tests, so we'd appreciate if you guys could test it (packages for 11.2 available in the same repository) and report feedback. Thanks!
It's installed and working fine here, at least no more segfaults up to now. I will test it the next days and will report back in January. Thanks, Richard
(In reply to comment #10) versuion 5.0.5 worked fine for me, since 12/04, when I compiled it. Now I installed the autofs-RPM from http://download.opensuse.org/repositories/filesystems/ and it works fine. Jürgen
I had today a hang while shutting down autofs, the system was hanging at "shutting down autofs" for almost a day. Only a ALT + SYSRQ + b rebooted the system. I remember having this type of error in the past, but not any more on 11.1.
Thanks for reporting this. In fact, the init script changed a lot in the updated packages, including some changes in the stop routine that might be the culprit. I'd like to suggest the following: 1. Enable debugging [1], so if it happens again we can collect some data to analyze (make sure you use ALT+SYSRQ+s before forcing the reboot). 2. Disable USE_MISC_DEVICE [2] as this feature requires some kernel changes that are not available on 11.1's kernel (2.6.27). If the problem occurs again after the changes, please attach the logs here and I'll try to prepare an updated package for openSUSE 11.1. [1] Set DEFAULT_LOGGING="debug" in /etc/sysconfig/autofs [2] Set USE_MISC_DEVICE="no" in /etc/sysconfig/autofs
Sorry, my previous comment was not clear enough. The hang happened on 11.2 with autofs-5.0.5-12.1.x86_64 while booting from 2.6.31.5-0.1-default to 2.6.31.8-0.1-default . 11.2 is the system for which I reported this autofs error. My comment about 11.1 was only because I don't remember having any of this autofs hanging issues on 11.1, but I did have this hangs several times before 11.1 . Do your suggestions also apply to 11.2 ?
> Do your suggestions also apply to 11.2 ? Just the first one. Another thing that may help with the diagnostic is to enable bash debugging in the init script: -#!/bin/bash +#!/bin/bash -x Could you please implement both and attach the logs when the problem occurs again? Thanks!
Ok, both are implemented. But on shutdown I don't see any output from the bash init script /etc/init.d/autofs . Where should this output go to? /var/log/messages ?
Should we open a new bug? The segfault bug seems to be solved, the hang should be a new bug, or not?
> Should we open a new bug? > The segfault bug seems to be solved, the hang should be a new bug, or not? Yes, this is a good idea. Please assign the new bug to me.
The package autofs-5.0.5-1.1 is now available on openSUSE Factory and fixes the problem reported in this bug.
Reopen because of missing RPM in openSUSE Update. We couldn't fix a realy annoying bug with the comment "new rpm in XXX repo available". Such bugs has to fixed in update repo.
Any idea when this will reach the 11.2 update repos?
Miklos, do you agree to release an AutoFS maintenance update for 11.2? I can prepare and submit the package if needed.
Yes, agreed. Please feel free to submit an updated package to 11.2. Thanks!
Thanks Miklos. Maintenance Team, we need a SWAMP-ID.
the openSUSE maintenance team is btw the decision maker on such issues. regarding this specific issue I would be for an update +1
The SWAMPID for this issue is 30803. Please submit the patch and patchinfo file using this ID. (https://swamp.suse.de/webswamp/wf/30803)
also for an update; Be so kind and submit a patchinfo and the fixed sources.
Submitted request id 31641 (openSUSE 11.2).
Submitted patchinfo.
Sorry to insist, but could you give an idea of how long this will take to reach the repos? It's OK if you say 6 months, I just need rough estimate to decide how I will handle the issue.
Since 2010-02-05 it is available in the update-test repo. If there is no negative feedback about the update, I release it at the beginning of the next week into the "normal" update channel. Happy testing ;-)
Update released for: autofs, autofs-debuginfo, autofs-debugsource Products: openSUSE 11.2 (debug, i586, x86_64)
update released ...
Thanks Christian. Closing as FIXED, please reopen if needed.
This is an autogenerated message for OBS integration: This bug (556479) was mentioned in https://build.opensuse.org/request/show/31641 11.2:Test / autofs