From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9567 invoked by alias); 31 Jan 2015 11:56:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 9546 invoked by uid 89); 31 Jan 2015 11:56:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: cvs.linux-mips.org Received: from eddie.linux-mips.org (HELO cvs.linux-mips.org) (148.251.95.138) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 31 Jan 2015 11:56:00 +0000 Received: from localhost.localdomain ([127.0.0.1]:57133 "EHLO localhost.localdomain" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S27010411AbbAaLz5JPzdE (ORCPT ); Sat, 31 Jan 2015 12:55:57 +0100 Date: Sat, 31 Jan 2015 22:22:00 -0000 From: "Maciej W. Rozycki" To: Don Breazeal cc: gdb-patches@sourceware.org Subject: Re: [PATCH] gdb.base/info-os.c: clean up SysV IPC on error In-Reply-To: <1422637464-20419-1-git-send-email-donb@codesourcery.com> Message-ID: References: <1422637464-20419-1-git-send-email-donb@codesourcery.com> User-Agent: Alpine 2.11 (LFD 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes X-SW-Source: 2015-01/txt/msg00813.txt.bz2 Don, > We have noticed here that over time some of our test systems accumulate > stale System V IPC resources. At least some of this is due to a GDB test > program, gdb.base/info-os.c. The program doesn't clean up any allocated > IPC objects when an error occurs. System V IPC objects will stay around > forever unless they are explicitly removed (or until a reboot). > > This patch puts the IPC cleanup code into a function and calls the > function everywhere that a fatal error can occur, as well as at > successful termination. Use `atexit' to run `ipc_cleanup' automagically instead maybe? This way you won't have to run the function manually at each exit point and also it won't be missed on any future updates. Just a thought if you want to experiment with it, there's nothing really wrong with your proposal as it stands. Maciej