Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.eclipsesource.json.Json.parse(String strInput) get stuck in Infinite Loop #77

Closed
mharisce opened this issue Jan 11, 2017 · 21 comments
Closed
Labels

Comments

@mharisce
Copy link

Hi,
I have observed a behavior that com.eclipsesource.json.Json.parse(String strInput) gets stuck in an infinite loop. Usually it happens at app-server (wildfly-10.1.0.Final) startup hence it blocks my web-service. Once it is stuck it would keep getting stuck on further web-services calls unless i reboot my app-server. Sometimes rebooting the app-server doesn't resolve this and re-trying a few times resolve this issue. Kindly help me with the issue. I would add details once i get concrete steps to reproduce it. I have witnessed this issue more than 30 times since i started using this jar (almost a month back).

Maven dependency which i am using:

<dependency>
  <groupId>com.eclipsesource.minimal-json</groupId>
  <artifactId>minimal-json</artifactId>
  <version>0.9.4</version>
</dependency>
@mharisce
Copy link
Author

Can you please push 0.9.5 to maven repo?

@bernardosulzbach
Copy link
Contributor

@mharisce care to give a minimal reproducible example? I don't see where the issue could be.

@dvdme
Copy link

dvdme commented Jan 11, 2017

Pushing the latest to maven would be nice

@mharisce
Copy link
Author

Please push the latest to maven

@ralfstx ralfstx added the bug label Jan 13, 2017
@ralfstx
Copy link
Owner

ralfstx commented Jan 13, 2017

We absolutely need a piece of example code to reproduce. A thread dump would also help.

Yes, we can release 0.9.5 if it fixes this issue. Do you have an indication that this problem does not occur with master?

@sbernard31
Copy link

sbernard31 commented Dec 6, 2017

I face a problem which looks like this.
We have switch recently from Gson to minimal-json for eclipse/leshan and sometime our unit tests (launched with maven) get stuck...

This happened almost all the time in our hudson instance.
I succeed to reproduce it in local, by running tests again and again until it get stuck.

maven output
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] leshan
[INFO] leshan - core
[INFO] leshan - core californium
[INFO] leshan - server core
[INFO] leshan - server californium
[INFO] leshan - server cluster
[INFO] leshan - client core
[INFO] leshan - client californium
[INFO] leshan - integration tests
[INFO] leshan - server demo
[INFO] leshan - client demo
[INFO] leshan - bootstrap server demo
[INFO] leshan - all
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building leshan 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ leshan ---
[INFO] Deleting /jobs/genie.leshan/leshan-hudson-test/workspace/target
[INFO] 
[INFO] >>> maven-source-plugin:2.4:jar (attach-sources) @ leshan >>>
[INFO] 
[INFO] <<< maven-source-plugin:2.4:jar (attach-sources) @ leshan <<<
[INFO] 
[INFO] --- maven-source-plugin:2.4:jar (attach-sources) @ leshan ---
[INFO] 
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ leshan ---
[INFO] Installing /jobs/genie.leshan/leshan-hudson-test/workspace/pom.xml to /opt/public/hipp/homes/genie.leshan/.m2/repository/org/eclipse/leshan/leshan/1.0.0-SNAPSHOT/leshan-1.0.0-SNAPSHOT.pom
[INFO] 
[INFO] >>> maven-javadoc-plugin:2.10.3:javadoc (default-cli) @ leshan >>>
[INFO] 
[INFO] <<< maven-javadoc-plugin:2.10.3:javadoc (default-cli) @ leshan <<<
[INFO] 
[INFO] --- maven-javadoc-plugin:2.10.3:javadoc (default-cli) @ leshan ---
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building leshan - core 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ leshan-core ---
[INFO] Deleting /jobs/genie.leshan/leshan-hudson-test/workspace/leshan-core/target
[INFO] 
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ leshan-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 8 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ leshan-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 110 source files to /jobs/genie.leshan/leshan-hudson-test/workspace/leshan-core/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) @ leshan-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ leshan-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 11 source files to /jobs/genie.leshan/leshan-hudson-test/workspace/leshan-core/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.19:test (default-test) @ leshan-core ---

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
SLF4J: A number (55) of logging calls during the initialization phase have been intercepted and are
SLF4J: now being replayed. These are subject to the filtering rules of the underlying logging system.
SLF4J: See also http://www.slf4j.org/codes.html#replay

I almost sure this happened since we migrate to minimal-json (I launched tests before and after several time and I never succeed to get stuck it before the migration)

I get a thread dump when tests are stucked
"pool-1-thread-11" #21 daemon prio=5 os_prio=0 tid=0x00007f8e5843f000 nid=0x3f09 in Object.wait() [0x00007f8e39f43000]
   java.lang.Thread.State: RUNNABLE
        at org.eclipse.leshan.json.ObjectModelSerDesTest.des_ser_must_be_equals(ObjectModelSerDesTest.java:49)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at org.apache.maven.surefire.junitcore.pc.InvokerStrategy.schedule(InvokerStrategy.java:54)
        at org.apache.maven.surefire.junitcore.pc.Scheduler.schedule(Scheduler.java:346)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.junit.runners.Suite.runChild(Suite.java:127)
        at org.junit.runners.Suite.runChild(Suite.java:26)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - <0x0000000770e98b80> (a java.util.concurrent.ThreadPoolExecutor$Worker)

"pool-1-thread-10" #20 daemon prio=5 os_prio=0 tid=0x00007f8e5843d000 nid=0x3f08 in Object.wait() [0x00007f8e3a044000]
   java.lang.Thread.State: RUNNABLE
        at com.eclipsesource.json.Json.<clinit>(Json.java:63)
        at org.eclipse.leshan.json.LwM2mJson.fromJsonLwM2m(LwM2mJson.java:34)
        at org.eclipse.leshan.json.JsonDeserializerTest.deserialize_device_object(JsonDeserializerTest.java:52)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at org.apache.maven.surefire.junitcore.pc.InvokerStrategy.schedule(InvokerStrategy.java:54)
        at org.apache.maven.surefire.junitcore.pc.Scheduler.schedule(Scheduler.java:346)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.junit.runners.Suite.runChild(Suite.java:127)
        at org.junit.runners.Suite.runChild(Suite.java:26)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - <0x0000000770f5c738> (a java.util.concurrent.ThreadPoolExecutor$Worker)

"pool-1-thread-9" #19 daemon prio=5 os_prio=0 tid=0x00007f8e5843b800 nid=0x3f07 in Object.wait() [0x00007f8e3a145000]
   java.lang.Thread.State: RUNNABLE
        at com.eclipsesource.json.JsonValue.<clinit>(JsonValue.java:71)
        at org.eclipse.leshan.json.JsonRootObjectSerDes.jSerialize(JsonRootObjectSerDes.java:30)
        at org.eclipse.leshan.json.JsonRootObjectSerDes.jSerialize(JsonRootObjectSerDes.java:24)
        at org.eclipse.leshan.core.model.json.JsonSerDes.sSerialize(JsonSerDes.java:31)
        at org.eclipse.leshan.json.LwM2mJson.toJsonLwM2m(LwM2mJson.java:30)
        at org.eclipse.leshan.json.JsonSerializerTest.serialize_device_object(JsonSerializerTest.java:97)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at org.apache.maven.surefire.junitcore.pc.InvokerStrategy.schedule(InvokerStrategy.java:54)
        at org.apache.maven.surefire.junitcore.pc.Scheduler.schedule(Scheduler.java:346)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.junit.runners.Suite.runChild(Suite.java:127)
        at org.junit.runners.Suite.runChild(Suite.java:26)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - <0x0000000770e909c0> (a java.util.concurrent.ThreadPoolExecutor$Worker)

"pool-1-thread-8" #18 daemon prio=5 os_prio=0 tid=0x00007f8e5843a000 nid=0x3f06 waiting on condition [0x00007f8e3a247000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000770e98c48> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - None

"pool-1-thread-7" #17 daemon prio=5 os_prio=0 tid=0x00007f8e58438000 nid=0x3f05 waiting on condition [0x00007f8e3a348000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000770e98c48> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - None

"pool-1-thread-6" #16 daemon prio=5 os_prio=0 tid=0x00007f8e58436800 nid=0x3f04 waiting on condition [0x00007f8e3a449000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000770e98c48> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - None

"pool-1-thread-5" #15 daemon prio=5 os_prio=0 tid=0x00007f8e58435000 nid=0x3f03 waiting on condition [0x00007f8e3a54a000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000770e98c48> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - None

"pool-1-thread-4" #14 daemon prio=5 os_prio=0 tid=0x00007f8e58433800 nid=0x3f02 in Object.wait() [0x00007f8e3a64a000]
   java.lang.Thread.State: RUNNABLE
        at org.eclipse.leshan.json.LwM2mJson.fromJsonLwM2m(LwM2mJson.java:34)
        at org.eclipse.leshan.core.node.codec.json.LwM2mNodeJsonDecoder.decode(LwM2mNodeJsonDecoder.java:59)
        at org.eclipse.leshan.core.node.codec.DefaultLwM2mNodeDecoder.decode(DefaultLwM2mNodeDecoder.java:72)
        at org.eclipse.leshan.core.node.codec.DefaultLwM2mNodeDecoder.decode(DefaultLwM2mNodeDecoder.java:46)
        at org.eclipse.leshan.core.node.codec.LwM2mNodeDecoderTest.json_device_object_instance0_with_root_basename(LwM2mNodeDecoderTest.java:325)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at org.apache.maven.surefire.junitcore.pc.InvokerStrategy.schedule(InvokerStrategy.java:54)
        at org.apache.maven.surefire.junitcore.pc.Scheduler.schedule(Scheduler.java:346)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.junit.runners.Suite.runChild(Suite.java:127)
        at org.junit.runners.Suite.runChild(Suite.java:26)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - <0x0000000770f25368> (a java.util.concurrent.ThreadPoolExecutor$Worker)

"pool-1-thread-3" #13 daemon prio=5 os_prio=0 tid=0x00007f8e58432800 nid=0x3f01 waiting on condition [0x00007f8e3a74c000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000770e98c48> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - None

"pool-1-thread-2" #12 daemon prio=5 os_prio=0 tid=0x00007f8e5842e800 nid=0x3f00 in Object.wait() [0x00007f8e3a84c000]
   java.lang.Thread.State: RUNNABLE
        at org.eclipse.leshan.json.JsonRootObjectSerDes.jSerialize(JsonRootObjectSerDes.java:30)
        at org.eclipse.leshan.json.JsonRootObjectSerDes.jSerialize(JsonRootObjectSerDes.java:24)
        at org.eclipse.leshan.core.model.json.JsonSerDes.sSerialize(JsonSerDes.java:31)
        at org.eclipse.leshan.json.LwM2mJson.toJsonLwM2m(LwM2mJson.java:30)
        at org.eclipse.leshan.core.node.codec.json.LwM2mNodeJsonEncoder.encodeTimestampedData(LwM2mNodeJsonEncoder.java:86)
        at org.eclipse.leshan.core.node.codec.DefaultLwM2mNodeEncoder.encodeTimestampedData(DefaultLwM2mNodeEncoder.java:94)
        at org.eclipse.leshan.core.node.codec.LwM2mNodeEncoderTest.json_encode_timestamped_resources(LwM2mNodeEncoderTest.java:207)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at org.apache.maven.surefire.junitcore.pc.InvokerStrategy.schedule(InvokerStrategy.java:54)
        at org.apache.maven.surefire.junitcore.pc.Scheduler.schedule(Scheduler.java:346)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.junit.runners.Suite.runChild(Suite.java:127)
        at org.junit.runners.Suite.runChild(Suite.java:26)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - <0x0000000770edc370> (a java.util.concurrent.ThreadPoolExecutor$Worker)

"pool-1-thread-1" #11 daemon prio=5 os_prio=0 tid=0x00007f8e5842e000 nid=0x3eff waiting on condition [0x00007f8e3a94e000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000770e98c48> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - None

Most of the thread are blocked in JSON.parse() or a minimal-json class "clinit".

Any idea of what could happened ? I looked at this deeply and can find a good explanation for now ...

@sbernard31
Copy link

sbernard31 commented Dec 6, 2017

I test it with 0.9.5-SNAPSHOT (building it locally) and I was not able to reproduce it.
This let me know that 0.9.5 version fix this issue.
To be sure I could double check with hudson as it failed almost all the time but your snapshot repository seems to be malformed.

@sbernard31
Copy link

To be honest, I looked at the code since 0.9.4 version and I didn't see what could fix this issue ...

@ralfstx
Copy link
Owner

ralfstx commented Dec 6, 2017

@sbernard31 Thanks for the thread dump, that's helpful. As far as I can see, the minimal-json classes Json and JsonValue are loaded concurrently by two different threads, both of which holding a lock (<clinit> is the static initialization of a class and its static fields).

  • pool-1-thread-10 at com.eclipsesource.json.Json.<clinit> (Json.java:63)
  • pool-1-thread-9 at com.eclipsesource.json.JsonValue.<clinit> (JsonValue.java:71)

Since the initialization of JsonValue.TRUE depends on the initialization of Json.TRUE, this seems to lead to some kind of deadlock situation.

If this is true, the static fields in JsonValue, which are only meant for compatibility are causing trouble and should be removed. Since this is a breaking change, it would require a 1.0.0.

@arcticicestudio
Copy link

Sounds like a good fix to prevent a deadlock.
Just my opinion about the version: Should be fine to package a 0.9.5 instead of 1.0.0 since this means the library leaves the development state (major of 0) and enters the production level. In development anything may change any time which also includes the API.

SemVer rule 4:

  1. Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable.

@sbernard31
Copy link

It sounds to be a well known JVM behavior : https://www.farside.org.uk/201510/deadlocks_in_java_class_initialisation.

I agree about versioning : API break are allowed with major of 0.
So if you don't feel ready for a 1.0.0 version, 0.9.5 is possible even with this API break.

Is it possible to have a SNAPSHOT version with this fix in a maven repository soon ? (like sonatype)
Did you plan to deliver a new version in maven central quickly ?

Thx

@bernardosulzbach
Copy link
Contributor

Is there any reason not to copy the constructor calls from Json to JsonValue? This would lead to some code duplication but it would not break anything as far as I can see it.

@ralfstx
Copy link
Owner

ralfstx commented Dec 7, 2017

@arcticicestudio Good point! Thanks.

@sbernard31 I think our case here is a bit more tricky no instance of Json is required on initializing JsonValue. However, it actually seems to cause a deadlock anyway and its probably something to be generally avoided. Yes, I'm looking into it and try to provide a fix soon.

@mafagafogigante Yeah, I thought about that too. But since it's a long time since 0.9.4, it seems like a good time to get rid of the compatibility code, isn't it?

@sbernard31
Copy link

@mafagafogigante : that's already the case in master since PR #60. And the only "con" I see is that we will have 2 instances of each constant (null, false, true) in memory. (not a big deal...)

This could explain why I can not reproduce it locally with a 0.9.5-SNAPSHOT. I would like to test it on the leshan hudson instance but there is not maven repository where I can get this snapshot. This could be a better test as the build fails most of the time on this hudson instance.
@ralfstx Could you easily provide/fix a repository with a 0.9.5-SNAPSHOT version ?

@bernardosulzbach
Copy link
Contributor

bernardosulzbach commented Dec 7, 2017

@ralfstx I don't know. This is a JSON parser. I don't see JSON ever changing, so there should be almost no need for the parser to change.

However, I agree that keeping all that deprecated stuff isn't good and the impact of simply removing it altogether should be fairly small.

@sbernard31 You are right. I didn't notice that.

ralfstx added a commit that referenced this issue Dec 9, 2017
As reported in #77, the reference from the static fields in `JsonValue`
to static fields in `Json` can lead to deadlocks during class
initialization.

Since this API has only been added for compatibility, the easiest fix
seems to be to remove the deprecated fields in `JsonValue`.

Use this opportunity to remove all deprecated API for 0.9.5.

This commit should fix #77.
ralfstx added a commit that referenced this issue Dec 9, 2017
As reported in #77, the reference from the static fields in `JsonValue`
to static fields in `Json` can lead to deadlocks during class
initialization.

Since this API has only been added for compatibility, the easiest fix
seems to be to remove the deprecated fields in `JsonValue`.

Use this opportunity to remove all deprecated API for 0.9.5.

This commit should fix #77.
ralfstx added a commit that referenced this issue Dec 9, 2017
As reported in #77, the reference from the static fields in `JsonValue`
to static fields in `Json` can lead to deadlocks during class
initialization.

Since this API has only been added for compatibility, the easiest fix
seems to be to remove the deprecated fields in `JsonValue`.

Use this opportunity to remove all deprecated API for 0.9.5.

This commit should fix #77.
ralfstx added a commit that referenced this issue Dec 9, 2017
As reported in #77, the reference from the static fields in `JsonValue`
to static fields in `Json` can lead to deadlocks during class
initialization.

Since this API has only been added for compatibility, the easiest fix
seems to be to remove the deprecated fields in `JsonValue`.

Use this opportunity to remove all deprecated API for 0.9.5.

This commit should fix #77.
@ralfstx
Copy link
Owner

ralfstx commented Dec 9, 2017

Considering the amount of breakage even in our own code (still using deprecated API in the performancetest project), I suppose that removing all deprecated API in 0.9.5 would likely break too many projects out there.

So I'd favor @mafagafogigante's proposal to copy the constructor calls for now. Interestingly, it turns out this change has already been made back in d62f55e. So it seems all that's left to do is releasing 0.9.5.

@ralfstx
Copy link
Owner

ralfstx commented Dec 9, 2017

I have released 0.9.5. Since d62f55e is not included in 0.9.4, I'm confident that this issue will be fixed in 0.9.5.
Thanks everyone for your help and apologies for this long period of idleness on my side.

@ralfstx ralfstx closed this as completed Dec 9, 2017
@sbernard31
Copy link

I try with the v0.9.5 and the hudson build is ok now.
This seems to be fixed.
Thx a lot @ralfstx !

@sbernard31
Copy link

sbernard31 commented Mar 8, 2018

The v0.9.5 behaves better but I still face faces deadlock when I'm building my project.
It seems to be more or less for the same reason than before.

I get a thread dump when tests are stucked
"pool-1-thread-11" #21 daemon prio=5 os_prio=0 tid=0x00007ff840403000 nid=0x16da in Object.wait() [0x00007ff80eb4f000]
   java.lang.Thread.State: RUNNABLE
        at com.eclipsesource.json.Json.<clinit>(Json.java:63)
        at org.eclipse.leshan.json.ObjectModelSerDesTest.des_ser_must_be_equals(ObjectModelSerDesTest.java:49)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at org.apache.maven.surefire.junitcore.pc.InvokerStrategy.schedule(InvokerStrategy.java:54)
        at org.apache.maven.surefire.junitcore.pc.Scheduler.schedule(Scheduler.java:346)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.junit.runners.Suite.runChild(Suite.java:127)
        at org.junit.runners.Suite.runChild(Suite.java:26)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - <0x000000076dd38ca0> (a java.util.concurrent.ThreadPoolExecutor$Worker)

"pool-1-thread-10" #20 daemon prio=5 os_prio=0 tid=0x00007ff840401000 nid=0x16d9 in Object.wait() [0x00007ff80ec50000]
   java.lang.Thread.State: RUNNABLE
        at org.eclipse.leshan.json.LwM2mJson.fromJsonLwM2m(LwM2mJson.java:34)
        at org.eclipse.leshan.json.JsonDeserializerTest.deserialize_device_object(JsonDeserializerTest.java:52)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at org.apache.maven.surefire.junitcore.pc.InvokerStrategy.schedule(InvokerStrategy.java:54)
        at org.apache.maven.surefire.junitcore.pc.Scheduler.schedule(Scheduler.java:346)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.junit.runners.Suite.runChild(Suite.java:127)
        at org.junit.runners.Suite.runChild(Suite.java:26)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - <0x000000076dd38910> (a java.util.concurrent.ThreadPoolExecutor$Worker)

"pool-1-thread-9" #19 daemon prio=5 os_prio=0 tid=0x00007ff8403ff000 nid=0x16d8 in Object.wait() [0x00007ff80ed51000]
   java.lang.Thread.State: RUNNABLE
        at com.eclipsesource.json.JsonValue.<clinit>(JsonValue.java:71)
        at org.eclipse.leshan.json.JsonRootObjectSerDes.jSerialize(JsonRootObjectSerDes.java:30)
        at org.eclipse.leshan.json.JsonRootObjectSerDes.jSerialize(JsonRootObjectSerDes.java:24)
        at org.eclipse.leshan.core.model.json.JsonSerDes.sSerialize(JsonSerDes.java:31)
        at org.eclipse.leshan.json.LwM2mJson.toJsonLwM2m(LwM2mJson.java:30)
        at org.eclipse.leshan.json.JsonSerializerTest.serialize_device_object(JsonSerializerTest.java:97)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at org.apache.maven.surefire.junitcore.pc.InvokerStrategy.schedule(InvokerStrategy.java:54)
        at org.apache.maven.surefire.junitcore.pc.Scheduler.schedule(Scheduler.java:346)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.junit.runners.Suite.runChild(Suite.java:127)
        at org.junit.runners.Suite.runChild(Suite.java:26)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - <0x000000076dd38580> (a java.util.concurrent.ThreadPoolExecutor$Worker)


"pool-1-thread-4" #14 daemon prio=5 os_prio=0 tid=0x00007ff8403f5000 nid=0x16d3 in Object.wait() [0x00007ff80f256000]
   java.lang.Thread.State: RUNNABLE
        at org.eclipse.leshan.json.LwM2mJson.fromJsonLwM2m(LwM2mJson.java:34)
        at org.eclipse.leshan.core.node.codec.json.LwM2mNodeJsonDecoder.decode(LwM2mNodeJsonDecoder.java:59)
        at org.eclipse.leshan.core.node.codec.DefaultLwM2mNodeDecoder.decode(DefaultLwM2mNodeDecoder.java:72)
        at org.eclipse.leshan.core.node.codec.DefaultLwM2mNodeDecoder.decode(DefaultLwM2mNodeDecoder.java:46)
        at org.eclipse.leshan.core.node.codec.LwM2mNodeDecoderTest.json_device_object_instance0_with_root_basename(LwM2mNodeDecoderTest.java:448)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at org.apache.maven.surefire.junitcore.pc.InvokerStrategy.schedule(InvokerStrategy.java:54)
        at org.apache.maven.surefire.junitcore.pc.Scheduler.schedule(Scheduler.java:346)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.junit.runners.Suite.runChild(Suite.java:127)
        at org.junit.runners.Suite.runChild(Suite.java:26)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - <0x000000076dd37360> (a java.util.concurrent.ThreadPoolExecutor$Worker)

"pool-1-thread-2" #12 daemon prio=5 os_prio=0 tid=0x00007ff8403f1800 nid=0x16d1 in Object.wait() [0x00007ff80f458000]
   java.lang.Thread.State: RUNNABLE
        at org.eclipse.leshan.json.JsonRootObjectSerDes.jSerialize(JsonRootObjectSerDes.java:30)
        at org.eclipse.leshan.json.JsonRootObjectSerDes.jSerialize(JsonRootObjectSerDes.java:24)
        at org.eclipse.leshan.core.model.json.JsonSerDes.sSerialize(JsonSerDes.java:31)
        at org.eclipse.leshan.json.LwM2mJson.toJsonLwM2m(LwM2mJson.java:30)
        at org.eclipse.leshan.core.node.codec.json.LwM2mNodeJsonEncoder.encodeTimestampedData(LwM2mNodeJsonEncoder.java:86)
        at org.eclipse.leshan.core.node.codec.DefaultLwM2mNodeEncoder.encodeTimestampedData(DefaultLwM2mNodeEncoder.java:94)
        at org.eclipse.leshan.core.node.codec.LwM2mNodeEncoderTest.json_encode_timestamped_resources(LwM2mNodeEncoderTest.java:211)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at org.apache.maven.surefire.junitcore.pc.InvokerStrategy.schedule(InvokerStrategy.java:54)
        at org.apache.maven.surefire.junitcore.pc.Scheduler.schedule(Scheduler.java:346)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.junit.runners.Suite.runChild(Suite.java:127)
        at org.junit.runners.Suite.runChild(Suite.java:26)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.apache.maven.surefire.junitcore.pc.Scheduler$1.run(Scheduler.java:387)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
        - <0x000000076dd36c10> (a java.util.concurrent.ThreadPoolExecutor$Worker)


But this times this could be more difficult to fix as this is clearly no easy to reproduce...
Should we reopen this bug ? or Should we create a new one ?

@ralfstx
Copy link
Owner

ralfstx commented Mar 9, 2018

@sbernard31 I'd prefer to open a new bug. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants
@ralfstx @sbernard31 @mharisce @dvdme @arcticicestudio @bernardosulzbach and others