Bug 556479 - autofs / automount crashes with Segmentation fault
Summary: autofs / automount crashes with Segmentation fault
Status: RESOLVED FIXED
Alias: None
Product: openSUSE 11.2
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Final
Hardware: i686 openSUSE 11.2
: P2 - High : Major with 4 votes (vote)
Target Milestone: ---
Assignee: Leonardo Chiquitto
QA Contact: E-mail List
URL:
Whiteboard: .
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-18 10:43 UTC by Richard Ems
Modified: 2016-04-15 10:32 UTC (History)
7 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
extracted fix from 5.0.5 (734 bytes, patch)
2009-11-25 10:53 UTC, Radek Doulik
Details | Diff
ELF 64-bit LSB shared object, x86-64 (136.85 KB, application/octet-stream)
2009-11-25 13:36 UTC, Radek Doulik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Ems 2009-11-18 10:43:54 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.
Comment 1 Richard Ems 2009-11-24 11:32:36 UTC
I reinstalled openSUSE 11.2 from scratch, the segfault is still there.
Comment 2 Radek Doulik 2009-11-25 10:29:35 UTC
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);
Comment 3 Radek Doulik 2009-11-25 10:38:25 UTC
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);
        }
Comment 4 Radek Doulik 2009-11-25 10:53:15 UTC
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.
Comment 5 Richard Ems 2009-11-25 11:03:19 UTC
Could you provide also a rpm package including this patch?
Comment 6 Radek Doulik 2009-11-25 13:36:17 UTC
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.
Comment 7 Richard Ems 2009-11-25 14:58:49 UTC
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
Comment 8 Radek Doulik 2009-11-25 15:47:04 UTC
(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)
Comment 9 Jürgen Vollmer 2009-12-04 16:18:53 UTC
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
Comment 10 Leonardo Chiquitto 2009-12-23 20:19:31 UTC
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!
Comment 11 Richard Ems 2009-12-24 12:22:56 UTC
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
Comment 12 Jürgen Vollmer 2009-12-27 15:56:53 UTC
(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
Comment 14 Richard Ems 2010-01-05 13:54:46 UTC
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.
Comment 15 Leonardo Chiquitto 2010-01-05 14:14:54 UTC
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
Comment 16 Richard Ems 2010-01-05 14:36:02 UTC
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 ?
Comment 17 Leonardo Chiquitto 2010-01-05 14:59:02 UTC
> 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!
Comment 18 Richard Ems 2010-01-05 16:56:35 UTC
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 ?
Comment 19 Richard Ems 2010-01-05 17:01:34 UTC
Should we open a new bug?
The segfault bug seems to be solved, the hang should be a new bug, or not?
Comment 20 Leonardo Chiquitto 2010-01-05 17:09:41 UTC
> 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.
Comment 21 Leonardo Chiquitto 2010-01-12 10:22:30 UTC
The package autofs-5.0.5-1.1 is now available on openSUSE Factory and fixes
the problem reported in this bug.
Comment 22 Detlef Reichelt 2010-01-31 11:12:04 UTC
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.
Comment 23 Joel Schaerer 2010-02-04 10:54:13 UTC
Any idea when this will reach the 11.2 update repos?
Comment 24 Leonardo Chiquitto 2010-02-04 11:02:48 UTC
Miklos, do you agree to release an AutoFS maintenance update for 11.2? I can prepare and submit the package if needed.
Comment 25 Forgotten User sLJ7K2dvxj 2010-02-04 13:19:59 UTC
Yes, agreed.  Please feel free to submit an updated package to 11.2.  Thanks!
Comment 26 Leonardo Chiquitto 2010-02-04 13:23:08 UTC
Thanks Miklos. Maintenance Team, we need a SWAMP-ID.
Comment 27 Marcus Meissner 2010-02-04 15:29:37 UTC
the openSUSE maintenance team is btw the decision maker on such issues.

regarding this specific issue I would be for an update +1
Comment 28 Swamp Workflow Management 2010-02-05 11:18:35 UTC
The SWAMPID for this issue is 30803.
Please submit the patch and patchinfo file using this ID.
(https://swamp.suse.de/webswamp/wf/30803)
Comment 29 Christian Dengler 2010-02-05 11:20:24 UTC
also for an update; Be so kind and submit a patchinfo and the fixed sources.
Comment 30 Leonardo Chiquitto 2010-02-05 14:01:45 UTC
Submitted request id 31641 (openSUSE 11.2).
Comment 31 Leonardo Chiquitto 2010-02-05 14:06:01 UTC
Submitted patchinfo.
Comment 32 Joel Schaerer 2010-02-09 08:25:06 UTC
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.
Comment 33 Christian Dengler 2010-02-09 10:15:42 UTC
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 ;-)
Comment 34 Swamp Workflow Management 2010-02-17 11:12:08 UTC
Update released for: autofs, autofs-debuginfo, autofs-debugsource
Products:
openSUSE 11.2 (debug, i586, x86_64)
Comment 35 Christian Dengler 2010-02-17 11:14:13 UTC
update released ...
Comment 36 Leonardo Chiquitto 2010-02-17 11:20:53 UTC
Thanks Christian.

Closing as FIXED, please reopen if needed.
Comment 37 Bernhard Wiedemann 2016-04-15 10:32:51 UTC
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