problems with Deuce STM

37 views
Skip to first unread message

Guy Korland

unread,
Oct 15, 2009, 2:58:54 AM10/15/09
to Deuce-STM developers
Hi Guy,

(BTW, the "sup...@deucestm.org" e-mail address does not work.)

I'm trying to make the STMBench7 benchmark run with Deuce STM, and I
have (so far) two main issues. It would be great if you knew how to
solve those.

1. java.* classes

STMBench7 uses several classes from java.*, e.g., java.util.Random and
various collections. Deuce STM does not seem to instrument those (I
get
exceptions about missing methods/fields). Is there any workaround that
does not require re-implementing all those standard classes?

2. Enumerations

Doing something like the following:

switch(e) {
A: ...
B: ...
C: ...
}

does not work if "e" is an Enum. The suggested workaraound (from the
mailing list):

switch(((Enum)e).ordinal()) {
0: ...
1: ...
2: ...
}

works but is ugly, because I have to replace labels by the
corresponding
numbers. Is there another way? I'd really like to avoid changing all
the
"switch" statements in the benchmark.

Best,

Michal

Guy Korland

unread,
Oct 15, 2009, 2:59:16 AM10/15/09
to Deuce-STM developers
>1. java.* classes
The upcoming version 1.1 should solve it, providing offline
instrumentation to the java.* classes.
The current solution can be adding the classes to the exclude, e.g.
-Dorg.deuce.exclude="java.*,sun.*,org.eclipse.*,org.junit.*,junit.*"
see: http://www.deucestm.org/documentation/writing-your-own-stm-algorithm

>2. Enumerations
I'm still working on this bug and I hope I'll fix it soon, but I'm not
sure it will be soon, sorry...

Guy

On Oct 15, 8:58 am, Guy Korland <gkorl...@gmail.com> wrote:
> Hi Guy,
>
> (BTW, the "supp...@deucestm.org" e-mail address does not work.)

Guy Korland

unread,
Oct 15, 2009, 2:59:52 AM10/15/09
to Deuce-STM developers
Thanks for the answers. One more question: if I put, say,
java.util.TreeMap in the exclude list, then I won't be able to safely
access it from concurrent transactions, will I?

Michal

Guy Korland

unread,
Oct 15, 2009, 3:00:11 AM10/15/09
to Deuce-STM developers
Correct.
The current version in the SVN already support full offline
instrumentation.
Meaning if instrument the rt.jar and your jars it should work fine.

Guy

Guy Korland

unread,
Oct 15, 2009, 3:00:34 AM10/15/09
to Deuce-STM developers
Great, I'll try the SVN version. Is there any particular option to use
for the off-line instrumentation of rt.jar?

Guy Korland

unread,
Oct 15, 2009, 3:01:06 AM10/15/09
to Deuce-STM developers
Great, I'll try the SVN version. Is there any particular option to use
for the off-line instrumentation of rt.jar?

Guy Korland

unread,
Oct 15, 2009, 3:03:20 AM10/15/09
to Deuce-STM developers, Michal Kapalka
No, all you have to do is to run it with the rt.jar as its input.

Guy

Guy Korland

unread,
Oct 15, 2009, 3:04:16 AM10/15/09
to Deuce-STM developers, Michal Kapalka
No, all you have to do is to run it with the rt.jar as its input.

Guy

Guy Korland

unread,
Oct 15, 2009, 3:05:07 AM10/15/09
to Deuce-STM developers, Michal Kapalka
No, all you have to do is to run it with the rt.jar as its input.

Guy

Michal Kapalka

unread,
Oct 15, 2009, 8:46:34 AM10/15/09
to Deuce-STM developers, Guy Korland
I tried the SVN version, but when I run it:

java -Dorg.deuce.exclude="" -javaagent:deuceAgent.jar stmbench7.Benchmark

I get the exception:

java.lang.NoSuchFieldError: err__ADDRESS__

when the benchmark executes System.err.println. Am I missing some
important command-line option here?

Michal

Guy Korland

unread,
Oct 16, 2009, 6:28:21 AM10/16/09
to Michal Kapalka, Deuce-STM developers
What I meant is that you need to take the version from the SVN and use
it offline instrument the rt.jar and your jars.

See: http://www.deucestm.org/documentation/getting-started

Guy

--
Guy Korland

Michal Kapalka

unread,
Oct 16, 2009, 7:49:31 AM10/16/09
to Guy Korland, Deuce-STM developers
Thanks! (Somehow I didn't see the section on off-line instrumentation
before on the "getting started" page...)

I still have a few problems, though. I pushed calls to System.err out of
transactions (where is their place, in fact), and instrumented off-line
both rt.jar and the jar of the benchmark. But I get errors, depending on
the value of org.deuce.exclude.

1. org.deuce.exclude=""

=============== DEBUG MESSAGE: Bad state ================

Error occurred during initialization of VM
java.lang.ExceptionInInitializerError
Caused by: java.lang.NullPointerException
at java.lang.String.charAt(String.java:689)
at java.security.BasicPermission.init(BasicPermission.java:93)
at java.security.BasicPermission.<init>(BasicPermission.java:129)
at java.lang.RuntimePermission.<init>(RuntimePermission.java:335)
at java.lang.Thread.<clinit>(Thread.java:1493)

2. org.deuce.exclude="java.lang.*"

Error occurred during initialization of VM
java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:394)
at java.lang.System.initProperties(Native Method)
at java.lang.System.initializeSystemClass(System.java:1072)

3. default org.deuce.exclude

Obviously, this leads to a NoSuchMethodError exception within the first
transaction.

Any hints would be welcome.

Best,

Michal

Guy Korland

unread,
Oct 17, 2009, 1:58:44 AM10/17/09
to Michal Kapalka, Deuce-STM developers
Yes I got it too, it seems like the trunk is not stable, I'm trying to
fix it as soon as possible.

Guy

--
Guy Korland

Guy Korland

unread,
Oct 17, 2009, 6:19:45 PM10/17/09
to Michal Kapalka, Deuce-STM developers
Can you please try the new v1.1?
It seems like this version fixes these issues.

Guy

--
Guy Korland

Michal Kapalka

unread,
Oct 19, 2009, 4:57:33 AM10/19/09
to Guy Korland, Deuce-STM developers
Thanks, the new version works much better. However, there are still some
problems:

1. I have to put "sun.*" in the exclude list; otherwise, the benchmark
does not even start (no messages; it just hangs when starting the VM).

2. With "sun.*" in the exclude list I get the following exception:

Exception in thread "Thread-1" java.lang.IncompatibleClassChangeError:
Expecting non-static method
java.lang.Thread.currentThread()Ljava/lang/Thread;
at java.lang.Thread.currentThread(Thread.java)
at java.lang.ThreadLocal.get(ThreadLocal.java:124)
(...)

Any idea why this happens?

Note that I cannot put "java.lang.*" in the exclude list, because I
need, e.g., the Iterable interface to get instrumented -- otherwise I
get NoSuchMethodError exceptions in the benchmark.

Best,

Michal

Guy Korland

unread,
Oct 20, 2009, 4:06:08 PM10/20/09
to Michal Kapalka, Deuce-STM developers
Can you try add the java.lang.Thread to the exclude list?
Add it both to the offline instrumentation and the runtime.

Guy
--
Guy Korland

Michal Kapalka

unread,
Oct 22, 2009, 9:11:25 AM10/22/09
to Guy Korland, Deuce-STM developers
I have tried that and I got another exception:

Exception in thread "Thread-1" java.lang.NoSuchFieldError: values__ADDRESS__
at java.util.TreeMap.values(TreeMap.java:817)
(...)

Maybe I am doing something wrong. Here are the commands that I use to
instrument and run the benchmark:

java -cp deuceAgent-1.1.0.jar \
-Dorg.deuce.exclude='sun.*,java.lang.Thread' \
org.deuce.transform.asm.Agent \
rt.jar deuce_rt.jar

java -cp deuceAgent-1.1.0.jar \
-Dorg.deuce.exclude='sun.*,java.lang.Thread' \
org.deuce.transform.asm.Agent \
stmbench7.jar deuce_bench.jar

java -Dorg.deuce.exclude='sun.*,java.lang.Thread' \
-cp deuceAgent-1.1.0.jar:deuce_bench.jar \
-Xbootclasspath/p:deuce_rt.jar:deuceAgent-1.1.0.jar \
stmbench7.Benchmark \
-g stm \
-s stmbench7.impl.deucestm.DeuceSTMInitializer

Guy Korland

unread,
Oct 22, 2009, 6:17:57 PM10/22/09
to Michal Kapalka, Deuce-STM developers
Thanks I'll check it.
BTW, a fix for the Enum.ordinal() was just committed to the trunk.

See: http://code.google.com/p/deuce/issues/detail?id=40

Guy
--
Guy Korland

Guy Korland

unread,
Oct 24, 2009, 5:58:10 PM10/24/09
to Michal Kapalka, Deuce-STM developers
I'll try to reproduce it.
Which version of stmbench7 are you using?
Can you send me a link to the jar?

Guy
--
Guy Korland

Guy Korland

unread,
Oct 31, 2009, 8:38:31 AM10/31/09
to Deuce-STM developers, Michal Kapalka
Hi,

I think I found the problem I'm still verifing it.
Can you please try the new 1.2m2? http://www.deucestm.org/download/deuceAgent-1.2.0m1.jar

I ran it for now with:
-Dorg.deuce.exclude="java.lang.Enum,sun.*"

Thanks,
Guy

On Oct 24, 11:58 pm, Guy Korland <gkorl...@gmail.com> wrote:
> I'll try to reproduce it.
> Which version of stmbench7 are you using?
> Can you send me a link to the jar?
>
> Guy
>

Michal Kapalka

unread,
Nov 3, 2009, 5:07:55 AM11/3/09
to Guy Korland, Deuce-STM developers
Hi,

Thanks for the new version. Now the benchmark finishes; however, it
reports consistency (invariants) violations. More precisely, it seems
that at some point during the benchmark run the non-final String
attribute "type" gets cut in some objects. This attribute must be of the
form "type #(num)" where (num) is an integer number, but it becomes
"type #". The strange thing is that there is no operation that modifies
attribute "type" -- it could have been declared "final".

If you want to reproduce the result, run the benchmark and look for
exceptions above the "Detailed results" section of the benchmark output.
Or redirect stdout to /dev/null (all errors are sent to stderr).

Guy Korland

unread,
Nov 3, 2009, 5:17:22 AM11/3/09
to Michal Kapalka, Deuce-STM developers
Can you please send me the input arguments? and how to run the benchmark?

Guy
--
Guy Korland

Michal Kapalka

unread,
Nov 3, 2009, 5:25:01 AM11/3/09
to deuce-stm-...@googlegroups.com
> Can you please send me the input arguments? and how to run the benchmark?

Here is the command:

java '-Dorg.deuce.exclude=java.lang.Enum,sun.*' \
-cp deuceAgent-1.2.0m1.jar:deuce_bench.jar \
-Xbootclasspath/p:deuce_rt.jar:deuceAgent-1.2.0m1.jar \
stmbench7.Benchmark -g stm \
-s stmbench7.impl.deucestm.DeuceSTMInitializer

Michal

>
> Guy
>
> <mailto:gkorl...@gmail.com>> wrote:
>
> I'll try to reproduce it.
> Which version of stmbench7 are you using?
> Can you send me a link to the jar?
>
> Guy
>
> On Thu, Oct 22, 2009 at 3:11 PM, Michal Kapalka
> <michal.kapa...@epfl.ch <mailto:michal.kapa...@epfl.ch>>wrote:
> <mailto:michal.kapa...@epfl.ch><mailto:

Guy Korland

unread,
Nov 14, 2009, 7:57:48 AM11/14/09
to deuce-stm-...@googlegroups.com
Hi,

Sorry for taking me so long to get to your test.
But I just ran it and got the following:

Exception in thread "Thread-4" stmbench7.core.RuntimeError: Invariant violated! Object stmbench7.impl.core.BaseAssemblyImpl with id = 731: attribute type --> expected value = type #(num), found = type #
at stmbench7.correctness.invariants.InvariantTest.reportError(InvariantTest.java:17)
at stmbench7.correctness.invariants.InvariantTest.reportError(InvariantTest.java:32)
at stmbench7.correctness.invariants.DesignObjTest.checkInvariants(DesignObjTest.java:20)
at stmbench7.correctness.invariants.AssemblyTest.checkInvariants(AssemblyTest.java:20)
at stmbench7.correctness.invariants.BaseAssemblyTest.checkInvariants(BaseAssemblyTest.java:23)
at stmbench7.correctness.invariants.ComplexAssemblyTest.checkInvariants(ComplexAssemblyTest.java:38)
at stmbench7.correctness.invariants.ComplexAssemblyTest.checkInvariants(ComplexAssemblyTest.java:33)
at stmbench7.correctness.invariants.ComplexAssemblyTest.checkInvariants(ComplexAssemblyTest.java:33)
at stmbench7.correctness.invariants.ComplexAssemblyTest.checkInvariants(ComplexAssemblyTest.java:33)
at stmbench7.correctness.invariants.ComplexAssemblyTest.checkInvariants(ComplexAssemblyTest.java:33)
at stmbench7.correctness.invariants.ComplexAssemblyTest.checkInvariants(ComplexAssemblyTest.java:33)
at stmbench7.correctness.invariants.ModuleTest.checkInvariants(ModuleTest.java:28)
at stmbench7.correctness.invariants.CheckInvariantsOperation.performOperation(CheckInvariantsOperation.java:32)
at stmbench7.impl.DefaultOperationExecutor.execute(DefaultOperationExecutor.java:24)
at stmbench7.OperationExecutorFactory$1.run(OperationExecutorFactory.java:30)
at java.lang.Thread.run(Thread.java:619)

Doesn't that meant that the Deuce's code isn't running but instead the Default version is running?

Guy


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Deuce-STM developers" group.
To post to this group, send email to deuce-stm-...@googlegroups.com
To unsubscribe from this group, send email to deuce-stm-develo...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/deuce-stm-developers?hl=en
-~----------~----~----~----~------~----~------~--~---




--
Guy Korland

Michal Kapalka

unread,
Nov 16, 2009, 2:50:19 AM11/16/09
to deuce-stm-...@googlegroups.com
Hi,

Yes, invariants check is executed without any transaction. But it's done
by a single thread, after the core benchmark code finishes, so I thought
it shouldn't be a problem. Initially, the invariants were checked inside
a transaction, but then I had problems with "System.err.println" giving
errors (see one of my first e-mails in this thread).

So here is what happens in the benchmark:

1. The data structure is set up and the invariants are checked: this is
done by a single thread, no transactions.

2. A number of threads execute transactions on the data structure.

3. Invariants are checked again by a single thread, no transactions.

The benchmark works well if I use locking instead of DeuceSTM in step 2
-- the same jar file, but different command-line parameters.

Is it a problem that the same data is accessed inside and outside of
transactions?

Thanks,

Michal

Guy Korland wrote:
> Hi,
>
> *at
> stmbench7.impl.DefaultOperationExecutor.execute(DefaultOperationExecutor.java:24)*
> * **at
> stmbench7.OperationExecutorFactory$1.run(OperationExecutorFactory.java:30)*
> at java.lang.Thread.run(Thread.java:619)
>
> Doesn't that meant that the Deuce's code isn't running but instead the
> Default version is running?
>
> Guy
>
>
> On Tue, Nov 3, 2009 at 12:25 PM, Michal Kapalka <michal....@epfl.ch
> <mailto:michal....@epfl.ch>> wrote:
>
>
> > Can you please send me the input arguments? and how to run the
> benchmark?
>
> Here is the command:
>
> java '-Dorg.deuce.exclude=java.lang.Enum,sun.*' \
> -cp deuceAgent-1.2.0m1.jar:deuce_bench.jar \
> -Xbootclasspath/p:deuce_rt.jar:deuceAgent-1.2.0m1.jar \
> stmbench7.Benchmark -g stm \
> -s stmbench7.impl.deucestm.DeuceSTMInitializer
>
> Michal
>
> >
> > Guy
> >
> > On Tue, Nov 3, 2009 at 12:07 PM, Michal Kapalka
> <michal....@epfl.ch <mailto:michal....@epfl.ch>
> > <mailto:michal....@epfl.ch <mailto:michal....@epfl.ch>>>
> > <mailto:gkorl...@gmail.com <mailto:gkorl...@gmail.com>>>
> wrote:
> >
> > I'll try to reproduce it.
> > Which version of stmbench7 are you using?
> > Can you send me a link to the jar?
> >
> > Guy
> >
> > On Thu, Oct 22, 2009 at 3:11 PM, Michal Kapalka
> > <michal.kapa...@epfl.ch
> <mailto:michal.kapa...@epfl.ch>><mailto:
> <mailto:deuce-stm-...@googlegroups.com>
> To unsubscribe from this group, send email to
> deuce-stm-develo...@googlegroups.com
> <mailto:deuce-stm-developers%2Bunsu...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/deuce-stm-developers?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
>
>
>
> --
> Guy Korland
>
> --
>
> You received this message because you are subscribed to the Google
> Groups "Deuce-STM developers" group.
> To post to this group, send email to deuce-stm-...@googlegroups.com.
> To unsubscribe from this group, send email to
> deuce-stm-develo...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/deuce-stm-developers?hl=.
Reply all
Reply to author
Forward
0 new messages