memory leaks

Hi All,

I don't normally get a chance to read the netcdf digest
so maybe this question has been dealt with previously.
When using the new dbx that comes on the SPARCstation 20
(Solaris 2.3) with the all the memory checking capabilities
turned on (access and mem leak checks) I get complaints from
NC_incr_array().  The complaint is about the memcpy() contained
therein and involves trying to write to unallocated space
off this or that "heap block".  Obviously, it could be my
code but in my defense I have tried it on a number of simple
test examples.  I know that in this mode the debugger is
sensitive to argument lists with incorrect ptr types and
have seen it complain about usage of BSD malloc (i.e.,
malloc(unsigned)).  I also know that simply making sure
the argument matchs correctly (in the case of malloc this
would mean making sure that the arg is size_t) solves 
this particular problem. 

I notice in the source that malloc sometimes uses size_t
and sometimes not.  I also presume that sizeof() returns
size_t here since I see malloc(sizeof(NC_something)) alot.

If anybody has any suggestions they would surely be
appreciated, since they could save me a great deal
of thrashing about.  For me this is an important issue
since it makes working with this otherwise wonderful
and excellent dbx option useless.

Thanks,
Dan

-- 
Dan Hansen              | #include <standard.disclaimer>
dhansen@xxxxxxxxxxxxx   |
(303) 497-8945          |
National Center for Atmospheric Research


  • 1995 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: