RE: [deuce-stm-developers] Re: Possible instrumentation problem with DeuceSTM

39 views
Skip to first unread message

gkor...@gmail.com

unread,
Sep 21, 2012, 3:01:51 AM9/21/12
to deuce-stm-...@googlegroups.com
Thanks, I managed to run it. From a quick look it seems like you might have uninstrumented code. e.g. java.util.Map as reference. BTW, why don't you let Deuce instrument in runtime?




Sent from Orange email services


Guy Korland wrote:

Hi Guy,

here I am again with another little DeuceSTM issue ;-). This time it involves much less code than the last time (7 simple classes only) and is easy to reproduce. I've upload the code to my homepage: http://www.objectscape.org/candide-standalone.zip. The zip contains a little ant script named build.xml. You only need to run it and then you can see the problem:


     [java] Exception in thread "Thread-4" java.lang.NullPointerException
     [java]     at org.objectscape.candide.standalone.CandideMap.get(CandideMap.java:116)
     [java]     at org.objectscape.candide.standalone.test.CandideStandaloneTest$3.run(CandideStandaloneTest.java:182)
     [java]     at org.objectscape.candide.standalone.test.CandideStandaloneTest$3.run(CandideStandaloneTest.java)
     [java]     at java.lang.Thread.run(Thread.java:619)
     [java] Exception in thread "Thread-3" java.lang.NullPointerException
     [java]     at org.objectscape.candide.standalone.CandideMap.get(CandideMap.java:116)
     [java]     at org.objectscape.candide.standalone.test.CandideStandaloneTest$2.run(CandideStandaloneTest.java:142)
     [java]     at org.objectscape.candide.standalone.test.CandideStandaloneTest$2.run(CandideStandaloneTest.java)
     [java]     at java.lang.Thread.run(Thread.java:619)


The point is that there is no reason for a NullPointerException. I wrote all involved variables and arguments to the console and they don't appear to be null. FastMap is also not to be blamed. If I replace it with HashMap, the NullPointerException still occurs. However, if I don't instrument the standalone-test.jar, the problem disappears. You can turn off instrumentation to verify this by including the non-instrumented standalone-test.jar instead of the inst_standalone-test.jar in build.xml at the target "runTestCases".

I'd be thankful if you could have a look into the case.
Thanks a lot, Oliver Plohmann

On Tuesday, August 28, 2012 6:06:04 PM UTC+3, Guy Korland wrote:
I have a little problem using DeuceSTM. I spent quite a while finding the problem myself in order not to bother you. Finally, I'd be glad if you could spare a little time to look into the issue.

It's about a getter method returning null although the instance variable it returns is not null. The problem does not occur when my jars are not instrumented. The current workaround I apply is to call the getter in a loop as long as it no longer returns null. Made me think whether it's some cashing problem.

I have uploaded my little project onto my homepage:

www.objectscape.org/candide/message_getid_null.html

There you can find a more detailed description of the problem and the project files (several maven modules) including build file and everything to reproduce the problem. It may look like a lot of code and hence a lot of work, but I have a test case you only need to run to see the problem. This should make things quite effortless for you to get into the issue, I hope ;-).

My DeuceSTM application is a system that provides distributed transactional maps (much like Hazelcast), but uses DeuceSTM to implement a lock-free and deadlock-free thread-safe solution. Thanks a lot if you could have a look into the issue :-). Please, let me know in case you have any problems or need more information.

Kind regards, Oliver Plohmann

--
You received this message because you are subscribed to the Google Groups "Deuce-STM developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/deuce-stm-developers/-/Zj31NHg9x0sJ.
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.

Oliver Plohmann

unread,
Sep 22, 2012, 1:33:22 AM9/22/12
to deuce-stm-...@googlegroups.com
Hi Guy,

you mean:

private Map<K, V> internalMap = new FastMap<K, V>();

in class CandideMap? I changed this to:

private FastMap<K, V> internalMap = new FastMap<K, V>();

Unhappily, it still happens... That CandideMap implements Map cannot be the problem, I guess. I will try.

Cheers, Oliver

Guy Korland

unread,
Sep 22, 2012, 4:22:10 AM9/22/12
to deuce-stm-...@googlegroups.com
Yes, this is one of the places.
I found another:

Map<String, String> map = CandideLocalScape.getMapNamed("/test/candide/concurrentModification");

I guess there're couple more probably in the Javolution lib.
I'll need to check.

Guy

On Saturday, September 22, 2012, Oliver Plohmann wrote:
Hi Guy,

you mean:

private Map<K, V> internalMap = new FastMap<K, V>();

in class CandideMap? I changed this to:

private FastMap<K, V> internalMap = new FastMap<K, V>();

Unhappily, it still happens... That CandideMap implements Map cannot be the problem, I guess. I will try.

Cheers, Oliver



On 21.09.2012 09:01, gkor...@gmail.com wrote:
Thanks, I managed to run it. From a quick look it seems like you might have uninstrumented code. e.g. java.util.Map as reference. BTW, why don't you let Deuce instrument in runtime?




Sent from Orange email services


Guy Korland wrote:

Hi Guy,

here I am again with another little DeuceSTM issue ;-). This time it involves much less code than the last time (7 simple classes only) and is easy to reproduce. I've upload the code to my homepage: http://www.objectscape.org/candide-standalone.zip. The zip contains a little ant script named build.xml. You only need to run it and then you can see the problem:


     [java] Exception in thread "Thread-4" java.lang.NullPointerException
     [java]     at org.objectscape.candide.standalone.CandideMap.get(CandideMap.java:116)
     [java]     at org.objectscape.candide.standalone.test.CandideStandaloneTest$3.run(CandideStandaloneTest.java:182)
     [java]     at org.objectscape.candide.standalone.test.CandideStandaloneTest$3.run(CandideStandaloneTest.java)

--
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.


--
Regards,
Guy Korland

Guy Korland

unread,
Sep 22, 2012, 4:47:18 AM9/22/12
to deuce-stm-...@googlegroups.com
It seems like if you change these "java.util.Map" you won't get any NPE (3 places).
But, the test won't pass since it catches the exception in the wrong place.
you shouldn't mark the "run()" method as @Atomic but create another @Atomic method that the run() method will call in loop.

--
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.


--
Regards,
Guy Korland


--
Regards,
Guy Korland

Oliver Plohmann

unread,
Oct 10, 2012, 4:42:29 PM10/10/12
to deuce-stm-...@googlegroups.com
Hi Guy,

this did it! Didn't understand things don't get instrumented when programming to an interface. The NPEs are gone and I get my dearly awaited TransactionException where it should happen.

Thanks, Oliver


On 22.09.2012 10:47, Guy Korland wrote:
Reply all
Reply to author
Forward
0 new messages