This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdb.base/info-os.c: clean up SysV IPC on error


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]