[Nagiosplug-devel] [ nagiosplug-Patches-1455619 ] check_procs segfaults with zombies

SourceForge.net noreply at sourceforge.net
Thu Jan 4 15:26:33 CET 2007

Patches item #1455619, was opened at 2006-03-21 21:03
Message generated for change (Comment added) made by lausser
You can respond by visiting: 

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Bugfix
Group: None
>Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: gerhard lausser (lausser)
Assigned to: Ton Voon (tonvoon)
Summary: check_procs segfaults with zombies

Initial Comment:
under solaris, ps produces output like this for 
zombie processes:
Z 55618 28898 15263    0    0  0.0 

The statement 
cols = sscanf (input_line, PS_FORMAT, PS_VARLIST);
which is actually this one:
...sscanf (input_line, "%s %d %d %d %d %d %f %s%n", 

does not fill the pos variable with a value because 
there is no match for the last %s. pos keeps the 
value it got when the last time a non-zombie process 
was found.

pos points to the arguments following procprog which 
is senseless in this case anyway. but later it is 
used to initialize the procargs array.
asprintf (&procargs, "%s", input_line + pos);
In the case of a zombie pos has a value related to 
the last input_line but not the current one, so an 
illegal byte beyond the strings end may be accessed.

I made a patch which takes this into account.

Greetings from Munich,


>Comment By: gerhard lausser (lausser)
Date: 2007-01-04 15:26

Logged In: YES 
Originator: YES

Sorry for the "delay". The same problems with zombies killing check_procs
occurred under 1.4.5. The patch is identical to the one i submitted nearly
a year ago for 1.4.2. Again, it solves the issue.
File Added: check_procs.c-1.4.5-zombies-patch


Comment By: SourceForge Robot (sf-robot)
Date: 2006-04-06 04:20

Logged In: YES 

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).


Comment By: Ton Voon (tonvoon)
Date: 2006-03-22 14:15

Logged In: YES 


Thanks for the patch. For the upcoming 1.4.3 release, Solaris processes
be read differently. A new executable, pst, will be created which will
the equivalent ps output. Please can you try this and see if it fixes your

zombie issues.

If not, I'll be happy to accept a patch against that.

Please try the snapshot at http://nagiosplug.sourceforge.net/snapshot/



You can respond by visiting: 

More information about the Devel mailing list