[ 
https://issues.apache.org/jira/browse/SSHD-178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13715672#comment-13715672
 ] 

Guillaume Nodet commented on SSHD-178:
--------------------------------------

Reproduced deadlock
{code}
NioProcessor-12@1142, prio=5, in group 'main', status: 'MONITOR'
         blocks main@1
         waiting for main@1 to release lock on <0x536> (a 
org.apache.sshd.common.channel.ChannelOutputStream)
          at 
org.apache.sshd.common.channel.ChannelOutputStream.close(ChannelOutputStream.java:146)
          at org.apache.sshd.common.util.IoUtils.closeQuietly(IoUtils.java:35)
          at 
org.apache.sshd.client.channel.AbstractClientChannel.doClose(AbstractClientChannel.java:130)
          at 
org.apache.sshd.client.channel.ChannelSession.doClose(ChannelSession.java:80)
          at 
org.apache.sshd.common.channel.AbstractChannel$1.operationComplete(AbstractChannel.java:112)
          at 
org.apache.sshd.common.channel.AbstractChannel$1.operationComplete(AbstractChannel.java:106)
          at 
org.apache.mina.core.future.DefaultIoFuture.notifyListener(DefaultIoFuture.java:377)
          at 
org.apache.mina.core.future.DefaultIoFuture.notifyListeners(DefaultIoFuture.java:362)
          at 
org.apache.mina.core.future.DefaultIoFuture.setValue(DefaultIoFuture.java:290)
          at 
org.apache.mina.core.future.DefaultWriteFuture.setWritten(DefaultWriteFuture.java:86)
          at 
org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageSent(DefaultIoFilterChain.java:445)
          at 
org.apache.mina.core.polling.AbstractPollingIoProcessor.fireMessageSent(AbstractPollingIoProcessor.java:975)
          at 
org.apache.mina.core.polling.AbstractPollingIoProcessor.writeBuffer(AbstractPollingIoProcessor.java:934)
          at 
org.apache.mina.core.polling.AbstractPollingIoProcessor.flushNow(AbstractPollingIoProcessor.java:848)
          at 
org.apache.mina.core.polling.AbstractPollingIoProcessor.flush(AbstractPollingIoProcessor.java:776)
          at 
org.apache.mina.core.polling.AbstractPollingIoProcessor.access$700(AbstractPollingIoProcessor.java:67)
          at 
org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1116)
          at 
org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
          at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
          at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
          at java.lang.Thread.run(Thread.java:722)

main@1, prio=5, in group 'main', status: 'MONITOR'
         blocks NioProcessor-12@1142
         waiting for NioProcessor-12@1142 to release lock on <0x53e> (a 
java.lang.Object)
          at 
org.apache.sshd.common.channel.AbstractChannel.writePacket(AbstractChannel.java:147)
          at 
org.apache.sshd.common.channel.ChannelOutputStream.flush(ChannelOutputStream.java:132)
          at org.apache.sshd.ClientTest.testCommand(ClientTest.java:103)
          at 
sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-1)
          at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:601)
          at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
          at 
org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
          at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
          at 
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
          at 
org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
          at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
          at 
org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
          at 
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
          at 
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
          at 
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
          at 
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
          at 
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
          at org.junit.runner.JUnitCore.run(JUnitCore.java:130)
          at 
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77)
          at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
          at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
{code}
                
> client lockup when getting SSH_MSG_DISCONNECT on invalid channel
> ----------------------------------------------------------------
>
>                 Key: SSHD-178
>                 URL: https://issues.apache.org/jira/browse/SSHD-178
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 0.7.0
>         Environment: java version "1.7.0_05"
> OpenJDK Runtime Environment (IcedTea7 2.2.1) (Gentoo build 1.7.0_05-b21)
> OpenJDK 64-Bit Server VM (build 23.0-b21, mixed mode)
>            Reporter: Alon Bar-Lev
>
> In some cases the channel closes before the last message is sent (or so I 
> understand from the log)
> I can reproduce this easily when running very short commands.
> ---
> 6265 [NioProcessor-20] INFO org.apache.sshd.client.channel.ChannelExec - Send 
> SSH_MSG_CHANNEL_REQUEST exec
> 6373 [NioProcessor-20] INFO org.apache.sshd.client.channel.ChannelExec - 
> Received SSH_MSG_CHANNEL_REQUEST on channel 0
> 6374 [main] INFO org.apache.sshd.client.channel.ChannelExec - Send 
> SSH_MSG_CHANNEL_OPEN on channel 1
> 7374 [NioProcessor-20] INFO org.apache.sshd.client.session.ClientSessionImpl 
> - Received SSH_MSG_DISCONNECT (reason=2, msg=Received data for nonexistent 
> channel 0.)
> ---
> When getting this SSH_MSG_DISCONNECT message the client is timed out waiting 
> for CLOSED/EOF.
> Not sure where the problem is, but it seems like the client is closed and the 
> program is not notified, or the message on the closed channel alter the 
> behaviour.
> If add some debug messages it happens less frequent, so  I guess this is 
> race/synchronization issue.
> I will happy to provide any additional required information.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to