Re: crash sometimes doesn't terminate, loops forever looking for a process that doesn't exist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- Original Message -----
> On Mon, Nov 7, 2011 at 2:24 PM, Dave Anderson <anderson@xxxxxxxxxx>
> wrote:
> > I would be a little hesitant to get rid of the pc->pipe_pid at this point
> > in time.
> >
> > I can't seem to be able to reproduce it, but certainly there should
> > be an escape valve in output_commands_to_pid() to recognize it and bail
> > out.  But I presume that your piped command sequence actually worked,
> > and so it would be strange/unnecessary for setup_redirect() to do the
> > error(FATAL_RESTART, ...) that it currently does when output_commands_to_pid()
> > returns with a NULL?
>
> I am not sure either what happened exactly but as far as I can tell
> the piped command didn't really work since it terminated before
> reading anything from its stdin. I am not sure how to reproduce the
> problem and it may very well be symptomatic of a problem in our
> environment but I know it happened at least twice (cores available on
> demand). So I think error(FATAL_RESTART) is actually appropriate (or
> at least more appropriate than looping forever). Or do you think it's
> important to get the return value of the child before deciding what
> to do?
>
> > Anyway, my point is to try to keep the fix as simple as possible...
>
> Makes sense.

Adrien,

How does the attached patch work for you?

Dave
--- crash/cmdline.c.orig
+++ crash/cmdline.c
@@ -757,8 +757,12 @@ retry:
                                         p_pid = strtok(NULL, " ");
                                         pgrp = strtok(NULL, " ");
 				        if (STREQ(name, "(sh)") &&
-					    (atoi(p_pid) == getpid())) 
-						pc->pipe_shell_pid = atoi(pid);
+					    (atoi(p_pid) == getpid())) { 
+						if (retries && STREQ(status, "Z"))
+							pc->pipe_shell_pid = 0;
+						else
+							pc->pipe_shell_pid = atoi(pid);
+					}
                                         if (STREQ(name, lookfor) &&
                                             ((atoi(p_pid) == getpid()) ||
 				             (atoi(p_pid) == pc->pipe_shell_pid)
--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux