Bug 151668 - [maintainer-update] conky bugfix for the kvm_getprocs crash
[maintainer-update] conky bugfix for the kvm_getprocs crash
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Any Any
: Normal Affects Only Me
Assigned To: Max Brazhnikov
Depends on:
  Show dependency treegraph
Reported: 2010-10-24 01:30 UTC by ntarmos
Modified: 2010-10-30 12:54 UTC (History)
0 users

See Also:

file.txt (2.47 KB, text/plain)
2010-10-24 01:30 UTC, ntarmos
no flags Details
maxpipekva.diff (940 bytes, patch)
2010-10-27 18:32 UTC, ntarmos
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ntarmos 2010-10-24 01:30:10 UTC
After 1.8.0 was released, I've been getting reports of conky crashing shortly after it is started. I've tried to reproduce the issue for some time but to no avail. I recently managed to get my hands on a proper core file and gdb backtrace with the help of an anonymous user and had a more in-depth look. It turns out the crashes were caused by kvm_getprocs(3) being called simultaneously by multiple threads within conky.

Fix: The attached patch uses a mutex to synchronize accesses to the locally allocated kinfo_proc structure, a pointer to which is returned by kvm_getprocs(3).

Patch attached with submission follows:
How-To-Repeat: Run conky>=1.8.0 with $processes or $running_processes in ~/.conkyrc and wait...
Comment 1 Max Brazhnikov freebsd_committer 2010-10-25 20:41:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->makc

I'll take it.
Comment 2 ntarmos 2010-10-27 18:32:41 UTC
With this one out of the way, conky is now running into
kern.ipc.maxpipekva. This seems to be caused by rogue pipes never being
closed (typo?). The attached patch fixes this issue. I could send-pr it
separately but I'd rather they go in the tree together.


Comment 3 dfilter freebsd_committer 2010-10-30 12:43:51 UTC
makc        2010-10-30 11:43:47 UTC

  FreeBSD ports repository

  Modified files:
    sysutils/conky       Makefile distinfo 
    sysutils/conky/files patch-src-conky.c 
  Added files:
    sysutils/conky/files patch-src-exec.c patch-src-freebsd.c 
  Fix crash
  Remove md5 sum
  PR:             ports/151668
  Submitted by:   Nikos Ntarmos (maintainer)
  Revision  Changes    Path
  1.57      +1 -0      ports/sysutils/conky/Makefile
  1.24      +0 -1      ports/sysutils/conky/distinfo
  1.10      +17 -1     ports/sysutils/conky/files/patch-src-conky.c
  1.3       +28 -0     ports/sysutils/conky/files/patch-src-exec.c (new)
  1.18      +44 -0     ports/sysutils/conky/files/patch-src-freebsd.c (new)
  1.3       +16 -0     ports/sysutils/conky/files/patch-src-freebsd.h (new)
cvs-all@freebsd.org mailing list
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 4 Max Brazhnikov freebsd_committer 2010-10-30 12:54:03 UTC
State Changed
From-To: open->closed

Committed. Thanks!