[Crash-utility] mount cmd crashes crash
Dave Anderson
anderson at redhat.com
Wed Aug 18 20:57:08 UTC 2010
----- "Bob Montgomery" <bob.montgomery at hp.com> wrote:
> I'm working on a dump of a system that did not have a PID 1. I don't
> think it's relevant to the crash itself, but it does cause crash get
> a seg fault.
>
> crash> ps | head
> PID PPID CPU TASK ST %MEM VSZ RSS COMM
> 0 0 0 ffffffff805144c0 RU 0.0 0 0 [swapper]
> 0 -1 1 ffff81012bc0a100 RU 0.0 0 0 [swapper]
> 2 -1 0 ffff81012bd3c040 IN 0.0 0 0 [migration/0]
> 3 -1 0 ffff81012bd3e7c0 RU 0.0 0 0 [ksoftirqd/0]
> 4 -1 0 ffff81012bd3e080 IN 0.0 0 0 [watchdog/0]
> 5 -1 1 ffff81012bd3f800 IN 0.0 0 0 [migration/1]
> 6 -1 1 ffff81012bd3f0c0 RU 0.0 0 0 [ksoftirqd/1]
> 7 -1 1 ffff81012bc0a840 IN 0.0 0 0 [watchdog/1]
> 8 -1 0 ffff81012af02880 IN 0.0 0 0 [events/0]
> crash> mount
> Segmentation fault (core dumped)
>
> In cmd_mount, this returns null and subsequent use causes the seg fault:
>
> 1156
> 1157 namespace_context = pid_to_context(1);
>
> I don't know if it was important to have the context of pid 1 for
> reporting mounts, or just any context, but this hack makes the problem
> go away, although not a very efficient way to find the lowest existing
> PID above 0.
Yeah, it's not important to use the context of pid 1, but it just needs
some context, and I had presumed that init would always exist. I thought
that the panic("Attempted to kill the idle task!") in do_exit() would
prevent pid 1 from ever going away -- but apparently your kernel figured
out how to do it elsewhere... ;-)
Your patch would pick a kernel thread pid, and apparently everything still
works OK? That being the case, it's fine with me.
Thanks,
Dave
> --- filesys.c.orig 2010-08-18 14:03:26.000000000 -0600
> +++ filesys.c 2010-08-18 14:10:02.000000000 -0600
> @@ -1153,8 +1153,12 @@ cmd_mount(void)
> ulong vfsmount = 0;
> int flags = 0;
> int save_next;
> + ulong pid;
>
> - namespace_context = pid_to_context(1);
> + /* find a context */
> + pid = 1;
> + while ((namespace_context = pid_to_context(pid)) == NULL)
> + pid++;
>
> while ((c = getopt(argcnt, args, "ifn:")) != EOF) {
> switch(c)
>
> Bob Montgomery
> At HP
>
>
>
>
>
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
More information about the Crash-utility
mailing list