home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.hp
- Path: sparky!uunet!munnari.oz.au!yarrina.connect.com.au!codex!bpja
- From: bpja@codex.com.au (Brett Adam)
- Subject: Is it safe to free() mem alloc'd by xdr routines?
- Message-ID: <1992Nov5.081038.1639@codex.oz.au>
- Keywords: free, malloc, xdr, rpc
- Sender: bpja@codex.oz.au
- Reply-To: bpja@codex.com.au
- Organization: Codex Software Development Pty Ltd
- Date: Thu, 5 Nov 92 08:10:38 GMT
- Lines: 41
-
-
- I'm experiencing weird memory problems in a system I'm currently porting to the
- HP 700 series.
-
- Normally, I'd be looking for bugs in my code, and wouldn't bother the Net
- community, but this software has already been successfully ported to 4 other
- platforms and is running at numerous sites ...
-
- What I'm getting are frequent and repeatable crashes in _fcntl() and free().
- Looking at the call chain with xdb indicates that in both cases, the crash is
- the result of a call to either free() or realloc().
-
- Looking further, what is actually happening is that an earlier call to free()
- is trashing neighboring memory, such that nearby pointers in a struct are being
- garbled. Hence, when the code gets to free'ing these other pointers, free()
- goes awol.
-
- In examining the code, the only 'common factor' I can identify is that the
- memory involved was originally alloc'd by the XDR routines - the memory is the
- result structs of RPC calls.
-
- Now under SunOS, and others, it's OK to free() memory returned by the XDR
- routines. However, this may not be the case under HP/UX.
-
- Does anyone know for sure?
-
- Are there any other malloc() related issues I should be aware of under HP/UX?
-
- (Like, when I did the RS/6000 port, the vendor supplied malloc was outright
- buggy. Some kind soul on the Net finally pointed this out which saved me hours
- of hair pulling. [the workarounds were NON obvious!])
-
- Thanks in advance,
-
-
-
- --
- -------------------------------------------------------------------
- Brett Adam
- Xedoc Software Development Pty. Ltd. Melbourne, Australia
- Phone : +61 3 696 2490
-