Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 28234 - psmisc killall segmentation fault (segv)
Summary: psmisc killall segmentation fault (segv)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-08 20:26 UTC by Grant McDorman
Modified: 2003-09-14 11:26 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed patch for psmisc killall (psmisc-21.2.patch,368 bytes, patch)
2003-09-08 20:27 UTC, Grant McDorman
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Grant McDorman 2003-09-08 20:26:31 UTC
killall _process_ crashes with a segmentation fault when some process contains a command 
line of 128 bytes or more. 
 
This is due to erroneous coding at line 209: 
  if(!realloc(&command_buf, cmd_size)) 
'realloc' does *not* take a pointer to the pointer to the memory to be reallocated; it takes the 
memory pointer itself and returns a new pointer. The line should read: 
  if(!(command_buf = realloc(command_buf, cmd_size))) 
(if one wants to keep it as one line.) 
 
On my system, the process that caused the problem was a CUPS print job. 
 
The attached patch contains this change.
Comment 1 Grant McDorman 2003-09-08 20:27:10 UTC
Created attachment 17305 [details, diff]
Proposed patch for psmisc killall
Comment 2 Grant McDorman 2003-09-08 20:28:37 UTC
Oops, forgot to name the file (although it should be obvious from the patch or inspecting the 
source): killall.c. 
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2003-09-14 11:26:49 UTC
I could not recreate it, but it does look fishy.  Fixed in -r4, thanks.