I've observed that linux apps running under the linuxulator have a habit of leaving behind shared memory segments which are unused, but which eventually cause the system to run out of free segments and these apps will stop working. ipcrm(1) currently only allows removal of unused message queues, shared memory segments and semaphores on an individual basis, or those having a matching (non-zero) key. However it would often be convenient to just do a complete cleanup of everything, usually as root. The attached patch allows removal of all message queues, shared memory segments or semaphores by specifying an id of -1 (ala kill(2)). The code to lookup ids was taken from ipcs. Fix: See attached patch. Patch attached with submission follows:
Responsible Changed From-To: freebsd-bugs->edwin Handle with submitter/mentor/-hackers
edwin 2007-12-25 00:52:25 UTC FreeBSD src repository Modified files: usr.bin/ipcs Makefile ipcs.c usr.bin/ipcrm Makefile ipcrm.1 ipcrm.c Added files: usr.bin/ipcs ipc.c ipc.h Log: Add the ability to clean up all shared memory segments which are unused in one go. From the original PR: I've observed that linux apps running under the linuxulator have a habit of leaving behind shared memory segments which are unused, but which eventually cause the system to run out of free segments and these apps will stop working. ipcrm(1) currently only allows removal of unused message queues, shared memory segments and semaphores on an individual basis, or those having a matching (non-zero) key. However it would often be convenient to just do a complete cleanup of everything, usually as root. PR: bin/118292 Submitted by: Callum Gibson <callumgibson@optusnet.com.au> Not reviewed by: grog@ Approved by: grog@ Revision Changes Path 1.7 +5 -0 src/usr.bin/ipcrm/Makefile 1.15 +36 -1 src/usr.bin/ipcrm/ipcrm.1 1.13 +133 -18 src/usr.bin/ipcrm/ipcrm.c 1.8 +1 -0 src/usr.bin/ipcs/Makefile 1.1 +207 -0 src/usr.bin/ipcs/ipc.c (new) 1.1 +71 -0 src/usr.bin/ipcs/ipc.h (new) 1.31 +17 -197 src/usr.bin/ipcs/ipcs.c _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->patched Commited to HEAD
Responsible Changed From-To: edwin->freebsd-bugs Give back into the pool until later.
edwin 2008-07-12 06:19:25 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) usr.bin/ipcrm Makefile ipcrm.1 ipcrm.c usr.bin/ipcs Makefile ipcs.c Added files: (Branch: RELENG_7) usr.bin/ipcs ipc.c ipc.h Log: SVN rev 180459 on 2008-07-12 06:19:25Z by edwin MFC of svn revision 174891 and 174750 Add the ability to clean up all shared memory segments which are unused in one go. PR: bin/118292 Submitted by: Callum Gibson <callumgibson@optusnet.com.au> Revision Changes Path 1.6.24.1 +5 -0 src/usr.bin/ipcrm/Makefile 1.14.2.1 +36 -1 src/usr.bin/ipcrm/ipcrm.1 1.11.24.1 +258 -126 src/usr.bin/ipcrm/ipcrm.c 1.7.18.1 +1 -0 src/usr.bin/ipcs/Makefile 1.1.2.1 +207 -0 src/usr.bin/ipcs/ipc.c (new) 1.1.2.1 +71 -0 src/usr.bin/ipcs/ipc.h (new) 1.29.2.1 +319 -430 src/usr.bin/ipcs/ipcs.c _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: patched->closed Committed, thanks!
edwin 2008-07-12 06:48:59 UTC FreeBSD src repository Modified files: (Branch: RELENG_6) usr.bin/ipcrm Makefile ipcrm.1 ipcrm.c usr.bin/ipcs Makefile ipcs.c Added files: (Branch: RELENG_6) usr.bin/ipcs ipc.c ipc.h Log: SVN rev 180462 on 2008-07-12 06:48:59Z by edwin MFC of svn revision 174891 and 174750 Add the ability to clean up all shared memory segments which are unused in one go. PR: bin/118292 Submitted by: Callum Gibson <callumgibson@optusnet.com.au> Revision Changes Path 1.6.14.1 +5 -0 src/usr.bin/ipcrm/Makefile 1.13.8.1 +36 -1 src/usr.bin/ipcrm/ipcrm.1 1.11.14.1 +258 -126 src/usr.bin/ipcrm/ipcrm.c 1.7.8.1 +1 -0 src/usr.bin/ipcs/Makefile 1.1.4.1 +207 -0 src/usr.bin/ipcs/ipc.c (new) 1.1.4.1 +71 -0 src/usr.bin/ipcs/ipc.h (new) 1.27.2.2 +319 -430 src/usr.bin/ipcs/ipcs.c _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
A commit references this bug: Author: rodrigc Date: Thu Jul 30 19:44:47 UTC 2015 New revision: 286093 URL: https://svnweb.freebsd.org/changeset/base/286093 Log: Use correct number of arguments to semctl() for IPC_RMID. PR: 118292 Submitted by: araujo Differential Revision: D2669 Changes: head/usr.bin/ipcrm/ipcrm.c