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

Using the dummy camera with no network results in a delay during preinitialize() and initialize() #14

Open
cxbrooks opened this issue Sep 25, 2017 · 1 comment

Comments

@cxbrooks
Copy link
Member

Note: the issue was created automatically with bugzilla2github tool

Original bug ID: BZ#14
From: @cxbrooks
Reported version: unspecified
CC: accessors-devel@terraswarm.org

@cxbrooks
Copy link
Member Author

Edward wrote:

"The Random demo, if I select the dummy camera and have wifi turned off
(not sure whether that is relevant) takes a very long time to
preinitialize and initialize. Not sure why... Maybe related to the
getResource() issues that you have encountered."

Disconnecting from the network and then running

java -classpath '.:./lib/*' ptolemy.vergil.VergilApplication ./ptolemy/actor/lib/jjs/modules/imageFilters/demo/ImageFilters/Random.xml

and then running jstack on the java pid shows that the process is hanging while trying to get discover the camera:

Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.101-b13 mixed mode):

"webcam-discovery-service" BZ#35 daemon prio=1 os_prio=31 tid=0x00007fff4db24800 nid=0x10c2b in Object.wait() [0x000070000558d000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at com.github.sarxos.webcam.WebcamDiscoveryService.run(WebcamDiscoveryService.java:257)
- locked <0x00000007792426e8> (a java.lang.Object)
at java.lang.Thread.run(Thread.java:745)

"Random" BZ#30 prio=1 os_prio=31 tid=0x00007fff4e8a3000 nid=0x13a77 in Object.wait() [0x00007000063ef000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.lang.Thread.join(Thread.java:1245)
- locked <0x0000000779242570> (a java.lang.Thread)
at java.lang.Thread.join(Thread.java:1319)
at com.github.sarxos.webcam.WebcamDiscoveryService.stop(WebcamDiscoveryService.java:314)
at com.github.sarxos.webcam.WebcamDiscoveryService.shutdown(WebcamDiscoveryService.java:382)
at com.github.sarxos.webcam.Webcam.resetDriver(Webcam.java:1036)
at com.github.sarxos.webcam.Webcam.setDriver(Webcam.java:992)
at ptolemy.actor.lib.jjs.modules.cameras.CameraHelper.(CameraHelper.java:136)
at java.lang.invoke.LambdaForm$DMH/1901118561.newInvokeSpecial_L3_L(LambdaForm$DMH)
at java.lang.invoke.LambdaForm$BMH/1472481487.reinvoke(LambdaForm$BMH)
at java.lang.invoke.LambdaForm$MH/2069048820.exactInvoker(LambdaForm$MH)
at java.lang.invoke.LambdaForm$MH/1472119832.linkToCallSite(LambdaForm$MH)
at jdk.nashorn.internal.scripts.Script$Recompilation$499$4590A$require.L:1$Camera(/Users/cxh/src/ptII11.0.devel/ptolemy/actor/lib/jjs/ext
ernal/require.js#401:30:109)
at java.lang.invoke.LambdaForm$DMH/895328852.invokeStatic_L3_L(LambdaForm$DMH)
at java.lang.invoke.LambdaForm$BMH/1947857091.reinvoke(LambdaForm$BMH)
at java.lang.invoke.LambdaForm$BMH/1653494421.reinvoke(LambdaForm$BMH)
at java.lang.invoke.LambdaForm$MH/689815922.exactInvoker(LambdaForm$MH)
at java.lang.invoke.LambdaForm$MH/736147259.linkToCallSite(LambdaForm$MH)
at jdk.nashorn.internal.scripts.Script$Recompilation$487$3275$^function_.L:1$setup(:83)
at java.lang.invoke.LambdaForm$DMH/723074861.invokeStatic_LL_L(LambdaForm$DMH)
at java.lang.invoke.LambdaForm$BMH/1804661649.reinvoke(LambdaForm$BMH)
at java.lang.invoke.LambdaForm$MH/128853523.exactInvoker(LambdaForm$MH)
at java.lang.invoke.LambdaForm$MH/1970553451.linkToCallSite(LambdaForm$MH)
at jdk.nashorn.internal.scripts.Script$Recompilation$477$18417AAAAAA$require.L:1$Accessor(/Users/cxh/src/ptII11.0.devel/ptolemy/actor/lib
/jjs/external/require.js#401:30:586)
at java.lang.invoke.LambdaForm$DMH/951007336.invokeStatic_L8_L(LambdaForm$DMH)
at java.lang.invoke.LambdaForm$BMH/1525193662.reinvoke(LambdaForm$BMH)
at java.lang.invoke.LambdaForm$BMH/177973284.reinvoke(LambdaForm$BMH)
at java.lang.invoke.LambdaForm$MH/1118239097.exactInvoker(LambdaForm$MH)
at java.lang.invoke.LambdaForm$MH/837155914.linkToCallSite(LambdaForm$MH)
at jdk.nashorn.internal.scripts.Script$Recompilation$476$2615AA$^eval_.evaluateCode(:88)
at java.lang.invoke.LambdaForm$DMH/603742814.invokeStatic_L4_L(LambdaForm$DMH)
at java.lang.invoke.LambdaForm$MH/829824402.invokeExact_MT(LambdaForm$MH)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:641)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
at jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectMirror.java:199)
at jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:383)

---end---

The sources are at https://github.com/sarxos/webcam-capture/blob/master/webcam-capture/src/main/java/com/github/sarxos/webcam/WebcamDiscoveryService.java

This looks like a bug the Webcam package, we would need to track it down there.

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

No branches or pull requests

1 participant