[gclist] GC and Linux IA64

Boehm, Hans hans_boehm@hp.com
Tue, 18 Nov 2003 14:50:50 -0800


The preferred mailing list for discussion specific to this collector is probably
gc@linux.hpl.hp.com.  Please see the bottom of the page at
http://www.hpl.hp.com/personal/Hans_Boehm/gc for details.

Some answers:

- I believe the reported addresses are correct.  GC_malloc doesn't necessarily allocate
at addresses similar to malloc.  And you are really replacing malloc in this case.

- You don't currently get reasonable leak reports on IA64.  The information you get
is correct, but not useful.  You end up with a routine called malloc, which calls
GC_debug_malloc_replacement.  The only information GC_debug_malloc_replacement has
access to is its caller's address, which is always "malloc".  This needs to be fixed
in two distinct ways:

1) It should be possible to get rid of the extra level of calls, so that at least the
return address is meaningful.  I'll see if I can do that for the official 6.3 release.
This should help a number of platforms, provided gcc is used as the compiler.  This part
of it is really a bug.

2) It should be possible to get full call stack traces on ia64 with libunwind
(http://www.hpl.hp.com/research/linux/libunwind/).  I think this is easy to hack by
implementing GC_save_callers (bottom of os_dep.c) in terms of libunwind.  It's a little
harder to get the configuration stuff right, since I don't think libunwind is currently
in all ia64 Linux distributions, though it's rapidly getting there.   You will probably
see a more appreciable slowdown with this approach, but I think performance should
still be acceptable for most purposes.

Hans



> -----Original Message-----
> From: owner-gclist@lists.iecc.com 
> [mailto:owner-gclist@lists.iecc.com]On
> Behalf Of Sebastien Termeau
> Sent: Tuesday, November 18, 2003 1:39 AM
> To: gclist@iecc.com
> Subject: [gclist] GC and Linux IA64
> 
> 
> Hello,
> 
>  
> 
> I am new to GC, and I cannot find the mailing list archive ( ftp site
> down? ).
> 
> I am trying to find memory leaks under Linux IA64.
> 
> I get latest GC release (6.3) ( I tried with older version too ).
> 
> When I use GC functions in my code, it works fine, even if it returns
> bad addresses:
> 
> Leaked composite object at 0x6000000000045fd0 (testgc.c:18, sz=4)
> 
> Intead of
> 
> Leaked composite object at 0x4000000000000a30 (testgc.c:18, sz=4)
> 
>  
> 
> However when I use normal malloc calls and LD_PRELOAD, GC fails to
> retrieve memory leaks locations (files and line numbers).
> 
> Addr2line and GDB returns the correct addresses.
> 
> Is it a known problem with IA64?
> 
> Do you have a solution?
> 
> Regards
> 
>  
> 
> Termeau Sebastien
> 
> 04-76-52-65-67
> 
> termeau@tidhom1g.grenoble. <mailto:termeau@tidhom1g.grenoble.hp.com>
> hp.com
> 
> http://155.208.210.70/
> 
>  
>