malloc() problem on sysv386

Conor P. Cahill cpcahil at virtech.uucp
Fri May 24 10:00:08 AEST 1991


moore at forty2.enet.dec.com (Paul Moore) writes:

>I've recently had this error occuring when malloc is called running an
>application on ISC SVR3.2 (observed from the sdb debugger):
>   memory fault (11) (sig 11)
>The problem only occurs when malloc() had been previously called in the code
>execution path; it doesn't appear when this code path isn't executed.

>Any ideas, anyone?

My first bet would be that you are overrunning the malloc data that you
allocate (i.e. writing to 10 bytes when you only allocated 8).  Second
guess is that you are expecting the data to be cleared - which it isn't.

To track this down, you should get ahold of the malloc debugging package
that I put together (was posted to c.s.u last year, send email if you 
want an upto date copy).  With that package, the problem will probably
be caught in the function that is overrunniing, and almost certainly
at the subsequent malloc call.

-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170 



More information about the Comp.unix.sysv386 mailing list