I am having trouble with the Object.clone() method while using Deuce
STM. My code is taking an array that is immutable and trying to make a
copy of it to a mutable version, though when I call the clone method
I've gotten two different errors.
The first error is a JVM crash:
java -javaagent:deuceAgent.jar -cp bin/ hashmapbenchmark.Main
AtomicPersistentHashMap 0 1 16384
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fdf3d9ce6f4, pid=19406,
tid=140596810057488
#
# JRE version: 6.0_18-b18
# Java VM: OpenJDK 64-Bit Server VM (16.0-b13 mixed mode linux-amd64 )
# Derivative: IcedTea6 1.8.1
# Distribution: Ubuntu 10.04 LTS, package 6b18-1.8.1-0ubuntu1
# Problematic frame:
# V [libjvm.so+0x3c26f4]
#
# An error report file with more information is saved as:
# /home/users/pdimarco/HashMapBenchmark/hs_err_pid19406.log
#
# If you would like to submit a bug report, please include
# instructions how to reproduce the bug and visit:
#
https://bugs.launchpad.net/ubuntu/+source/openjdk-6/
#
Aborted
The second is a NoSuchMethodError:
java -javaagent:deuceAgent.jar -cp bin/ hashmapbenchmark.Main
AtomicPersistentHashMap 0 1 16384
Exception in thread "main" java.lang.NoSuchMethodError:
[Ljava.lang.Object;.clone(Lorg/deuce/transaction/Context;)Ljava/lang/
Object;
at hashmapbenchmark.AtomicPersistentHashMap
$INode.cloneAndSet(AtomicPersistentHashMap.java:82)
at hashmapbenchmark.AtomicPersistentHashMap
$BitmapIndexedNode.put(AtomicPersistentHashMap.java:226)
at
hashmapbenchmark.AtomicPersistentHashMap.put(AtomicPersistentHashMap.java:
29)
at
hashmapbenchmark.AtomicPersistentHashMap.put(AtomicPersistentHashMap.java)
at hashmapbenchmark.Main.main(Main.java:48)
The second error lead me to the Object.clone() function as the root of
this problem. So I tried debugging it on another machine only to see
this:
Invalid memory access of location 0x3000000020 rip=0x1010b508b
So to avoid using the clone operation, I did a manual copy, which
seems to allievate the problem. But I figured I'd post this since I
did not see any related posts on the forums.