This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Alignment problem with hashtable locks on PowerPC
- To: "Boehm, Hans" <hans_boehm at hp dot com>
- Subject: Alignment problem with hashtable locks on PowerPC
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- Date: Mon, 12 Nov 2001 00:22:36 +1300
- Cc: java-patches at gcc dot gnu dot org
Hi Hans,
I've been trying to get the hashtable locks going on PowerPC. I've run
into a problem with the locking code assuming that objects are at least
64-bit aligned, with this assertion being triggered:
[bryce@kiteless test]$ ./a.out
a.out: ../../../libjava/java/lang/natObject.cc:948: void
_Jv_MonitorEnter(java::lang::Object*): Assertion `!(addr & (1 | 2 | 4))'
failed.
Aborted (core dumped)
At first I thought it was just the compiler not giving enough alignment
for statically allocated class objects, which I fixed by setting
TYPE_ALIGN for class_type_node in the compiler, but the GC also seems to
be returning objects that are only 32-bit aligned!
(gdb) bt
#0 0x0f724b88 in kill () at soinit.c:56
#1 0x0f89c2a4 in pthread_kill (thread=1024, signo=6) at signals.c:65
#2 0x0f89c90c in raise (sig=6) at signals.c:232
#3 0x0f7260b4 in abort () at ../sysdeps/generic/abort.c:88
#4 0x0f71e398 in __assert_perror_fail (errnum=0,
file=0xfe1a95c "void _Jv_MonitorEnter(java::lang::Object*)", line=0,
function=0x0) at assert.c:59
#5 0x0fc9e620 in _Jv_MonitorEnter (obj=0x10076fdc) <------ !!
at ../../../libjava/java/lang/natObject.cc:948
#6 0x0fd09234 in java.util.Hashtable.put(java.lang.Object,
java.lang.Object) (
this=0x10076fdc, key=0x1004ad80, value=0x0)
at ../../../libjava/java/util/Hashtable.java:385
#7 0x0fd18228 in java.util.TimeZone.__U3c_clinit__U3e_() ()
at ../../../libjava/java/util/TimeZone.java:86
#8 0x0fc97e68 in java::lang::Class::initializeClass() (this=0xfef19b0)
at ../../../libjava/java/lang/natClass.cc:749
#9 0x0fe14484 in _Jv_InitClass (klass=0xfef19b0)
at ../../../libjava/java/lang/Class.h:248
#10 0x0fd1c8b0 in java.util.TimeZone.getTimeZone(java.lang.String) (
ID=0x1002ec80) at ../../../libjava/java/util/TimeZone.java:943
(gdb) p 0x10076fdc % 8
$5 = 4
Any ideas on how to fix that?
regards
Bryce.