***SPAM*** Re: [ofa-general] Re: [PATCH] infiniband-diags: Fix memory leaks on IBERROR and IBPANIC

Hal Rosenstock hal.rosenstock at gmail.com
Fri Mar 13 04:31:24 PDT 2009


On Thu, Mar 12, 2009 at 6:50 PM, Jason Gunthorpe
<jgunthorpe at obsidianresearch.com> wrote:
> I've never heard of or used an OS that has processes (ie exit) and
> didn't reclaim FDs and memory. The closest I've ever used was classic
> Windows 3.1 vintage where you had processes, but some GUI resources
> could leak if not freed. malloc didn't leak. Heck, even DOS reclaimed
> straight malloc'd memory.

There are a number of "unix" like RTOSs which support abort and exit
without resource tracking/reclamation.

> POSIX environments reclaim virtually everything on exit, though there
> are some APIs for shared memory and some types of non POSIX semaphores
> that can linger due to their multi-process nature. But these are rare
> and need special handling anyhow..
>
> Certainly attempting to unwind malloc, fds, etc at exit on any sort of
> POSIX platform is needless busy work.
>
> When you care about stuff like this is if you are making functions
> that don't have the luxury of calling exit/abort/etc, like in the
> kernel or in some kind of RTOS environment - but in that situation it
> is exit that is forbidden and proper resource clean up and error code
> returning is just a consequence of getting rid of exit.

That's not true in a number of RTOSs I've worked with in the past
(vxWorks is the first one which comes to mind).

-- Hal

> Jason
>



More information about the general mailing list