Re: A little off the subject

    Billy> How can I tell when I'm running out of address space?  Will malloc
    Billy> fail to allocate any?

    Billy> I'm having some memory errors that I can't find with Purify on my
    Billy> sol7 box or with bounds checker on winders.

    Billy> Both tell me is a stack overflow.

    Billy> I'm lost at the exact meaning and where to look for the error.

Add a check for a NULL return from a malloc/realloc call.  Run the progam, and
when it dies, go back and look at how much memory you were trying to
allocate.  I often find I forget to initialize variable on Solaris and
whatever value happens to be in it gets used.

BTW, one of the best debuggers on Solaris is "ups."  It is by far the most
useful debugger I've ever used.  It is free and can be found at
Mark Leisher
Computing Research Lab            Cinema, radio, television, magazines are a
New Mexico State University       school of inattention: people look without
Box 30001, Dept. 3CRL             seeing, listen without hearing.
Las Cruces, NM  88003                            -- Robert Bresson

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]