This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
__libc_ia64_register_backing_store_base
- To: java-patches at gcc dot gnu dot org, libc-alpha at sourceware dot cygnus dot com
- Subject: __libc_ia64_register_backing_store_base
- From: rth at mufasa dot cygnus dot com
- Date: Wed, 29 Aug 2001 14:57:46 -0700
At the moment, virtually all Java programs crash immediately,
because we try to garbage collect in shared library constructors.
(GDB couldn't trace back far enough to figure out _what_ was
causing the collection -- presumably libgcj was allocating a
whole bunch of memory.)
We crash because __libc_ia64_register_backing_store_base has
not been initialized yet. This gets set in _start in the main
application, which doesn't happen until after shared library
initialization.
A temporary workaround for bohem-gc is attached, but I think the
proper solution is to move the init of this variable into libc.
Specifically, into _dl_start_user for ld.so, and __libc_init_first
for the static libc. Uli, this seem right to you?
r~
* os_dep.c (GC_get_register_stack_base): Check that
__libc_ia64_register_backing_store_base is initialized
before using it.
Index: os_dep.c
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/os_dep.c,v
retrieving revision 1.18
diff -c -p -d -r1.18 os_dep.c
*** os_dep.c 2001/08/18 01:04:43 1.18
--- os_dep.c 2001/08/29 21:45:51
*************** ptr_t GC_get_stack_base()
*** 680,686 ****
ptr_t GC_get_register_stack_base(void)
{
! if (0 != &__libc_ia64_register_backing_store_base) {
return __libc_ia64_register_backing_store_base;
} else {
word result = (word)GC_stackbottom - BACKING_STORE_DISPLACEMENT;
--- 680,687 ----
ptr_t GC_get_register_stack_base(void)
{
! if (0 != &__libc_ia64_register_backing_store_base
! && __libc_ia64_register_backing_store_base) {
return __libc_ia64_register_backing_store_base;
} else {
word result = (word)GC_stackbottom - BACKING_STORE_DISPLACEMENT;