[jira] [Commented] (SSHD-1032) java.lang.ArrayIndexOutOfBoundsException arraycopy

2020-07-24 Thread Evgeny Pasynkov (Jira)


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

Evgeny Pasynkov commented on SSHD-1032:
---

I'm unable to reproduce SSHD-1031 locally - it occurs on production under heavy 
load. 

> java.lang.ArrayIndexOutOfBoundsException arraycopy
> --
>
> Key: SSHD-1032
> URL: https://issues.apache.org/jira/browse/SSHD-1032
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.5.0
>Reporter: Evgeny Pasynkov
>Assignee: Guillaume Nodet
>Priority: Major
> Fix For: 2.6.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> When invoking writePacket, I quite often get the following exception:
> {noformat}
> Caused by: java.lang.ArrayIndexOutOfBoundsException arraycopy: last source 
> index 32768 out of bounds for byte[8192] 
> at java.base/java.lang.System.arraycopy(Native Method) 
> at 
> org.apache.sshd.common.util.buffer.ByteArrayBuffer.putRawBytes(ByteArrayBuffer.java:230)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.createSendBuffer(ChannelAsyncOutputStream.java:229)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.doWriteIfPossible(ChannelAsyncOutputStream.java:164)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.writePacket(ChannelAsyncOutputStream.java:70){noformat}
> This never happened in 2.4.0, so it is definitely a regression



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1032) java.lang.ArrayIndexOutOfBoundsException arraycopy

2020-07-24 Thread Lyor Goldstein (Jira)


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

Lyor Goldstein commented on SSHD-1032:
--

[~xvost] does it also solve SSHD-1031 ? I suspect these issues are related.

> java.lang.ArrayIndexOutOfBoundsException arraycopy
> --
>
> Key: SSHD-1032
> URL: https://issues.apache.org/jira/browse/SSHD-1032
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.5.0
>Reporter: Evgeny Pasynkov
>Assignee: Guillaume Nodet
>Priority: Major
> Fix For: 2.6.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> When invoking writePacket, I quite often get the following exception:
> {noformat}
> Caused by: java.lang.ArrayIndexOutOfBoundsException arraycopy: last source 
> index 32768 out of bounds for byte[8192] 
> at java.base/java.lang.System.arraycopy(Native Method) 
> at 
> org.apache.sshd.common.util.buffer.ByteArrayBuffer.putRawBytes(ByteArrayBuffer.java:230)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.createSendBuffer(ChannelAsyncOutputStream.java:229)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.doWriteIfPossible(ChannelAsyncOutputStream.java:164)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.writePacket(ChannelAsyncOutputStream.java:70){noformat}
> This never happened in 2.4.0, so it is definitely a regression



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1032) java.lang.ArrayIndexOutOfBoundsException arraycopy

2020-07-23 Thread Guillaume Nodet (Jira)


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

Guillaume Nodet commented on SSHD-1032:
---

[~xvost] awesome, the patch has been committed already.   Thx !

> java.lang.ArrayIndexOutOfBoundsException arraycopy
> --
>
> Key: SSHD-1032
> URL: https://issues.apache.org/jira/browse/SSHD-1032
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.5.0
>Reporter: Evgeny Pasynkov
>Assignee: Guillaume Nodet
>Priority: Major
> Fix For: 2.6.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> When invoking writePacket, I quite often get the following exception:
> {noformat}
> Caused by: java.lang.ArrayIndexOutOfBoundsException arraycopy: last source 
> index 32768 out of bounds for byte[8192] 
> at java.base/java.lang.System.arraycopy(Native Method) 
> at 
> org.apache.sshd.common.util.buffer.ByteArrayBuffer.putRawBytes(ByteArrayBuffer.java:230)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.createSendBuffer(ChannelAsyncOutputStream.java:229)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.doWriteIfPossible(ChannelAsyncOutputStream.java:164)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.writePacket(ChannelAsyncOutputStream.java:70){noformat}
> This never happened in 2.4.0, so it is definitely a regression



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1032) java.lang.ArrayIndexOutOfBoundsException arraycopy

2020-07-23 Thread Evgeny Pasynkov (Jira)


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

Evgeny Pasynkov commented on SSHD-1032:
---

I confirm the patch fixes the problem

> java.lang.ArrayIndexOutOfBoundsException arraycopy
> --
>
> Key: SSHD-1032
> URL: https://issues.apache.org/jira/browse/SSHD-1032
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.5.0
>Reporter: Evgeny Pasynkov
>Assignee: Guillaume Nodet
>Priority: Major
> Fix For: 2.6.0
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> When invoking writePacket, I quite often get the following exception:
> {noformat}
> Caused by: java.lang.ArrayIndexOutOfBoundsException arraycopy: last source 
> index 32768 out of bounds for byte[8192] 
> at java.base/java.lang.System.arraycopy(Native Method) 
> at 
> org.apache.sshd.common.util.buffer.ByteArrayBuffer.putRawBytes(ByteArrayBuffer.java:230)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.createSendBuffer(ChannelAsyncOutputStream.java:229)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.doWriteIfPossible(ChannelAsyncOutputStream.java:164)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.writePacket(ChannelAsyncOutputStream.java:70){noformat}
> This never happened in 2.4.0, so it is definitely a regression



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1032) java.lang.ArrayIndexOutOfBoundsException arraycopy

2020-07-21 Thread Guillaume Nodet (Jira)


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

Guillaume Nodet commented on SSHD-1032:
---

[~xvost] nice catch ! could you have a look at this fix and verify it works for 
you ? 
https://github.com/apache/mina-sshd/pull/147/commits/175d566a247e9b032cb6e88dd10d253a37e6f324

> java.lang.ArrayIndexOutOfBoundsException arraycopy
> --
>
> Key: SSHD-1032
> URL: https://issues.apache.org/jira/browse/SSHD-1032
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.5.0
>Reporter: Evgeny Pasynkov
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> When invoking writePacket, I quite often get the following exception:
> {noformat}
> Caused by: java.lang.ArrayIndexOutOfBoundsException arraycopy: last source 
> index 32768 out of bounds for byte[8192] 
> at java.base/java.lang.System.arraycopy(Native Method) 
> at 
> org.apache.sshd.common.util.buffer.ByteArrayBuffer.putRawBytes(ByteArrayBuffer.java:230)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.createSendBuffer(ChannelAsyncOutputStream.java:229)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.doWriteIfPossible(ChannelAsyncOutputStream.java:164)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.writePacket(ChannelAsyncOutputStream.java:70){noformat}
> This never happened in 2.4.0, so it is definitely a regression



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1032) java.lang.ArrayIndexOutOfBoundsException arraycopy

2020-07-21 Thread Evgeny Pasynkov (Jira)


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

Evgeny Pasynkov commented on SSHD-1032:
---

I've investigated the issue deeper and have an idea how this could happen, and 
this looks like a race in sshd code.

In ChannelAsyncOutputStream class in doWriteIfPossible method you have the code:
{code:java}
int total = buffer.available();
if (total > 0) {
Channel channel = getChannel();
Window remoteWindow = channel.getRemoteWindow();
long length;
if (total > remoteWindow.getSize()) {
// if we have a big message and there is enough space, send the next 
chunk
if (remoteWindow.getSize() >= remoteWindow.getPacketSize()) {
// send the first chunk as we have enough space in the window
length = remoteWindow.getPacketSize();

{code}
Looks like remoteWindow.getSize() is changes asynchronously, thus length get 
the packet size (in my case 32k), and then it fails to copy buffer since buffer 
length is 16k only.

 

I've proved this hypothesis by setting breakpoint on the "length = ..." line, 
and it was hit, and in that exact moment condition "total > 
remoteWindow.getSize()" is FALSE

> java.lang.ArrayIndexOutOfBoundsException arraycopy
> --
>
> Key: SSHD-1032
> URL: https://issues.apache.org/jira/browse/SSHD-1032
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.5.0
>Reporter: Evgeny Pasynkov
>Priority: Major
>
> When invoking writePacket, I quite often get the following exception:
> {noformat}
> Caused by: java.lang.ArrayIndexOutOfBoundsException arraycopy: last source 
> index 32768 out of bounds for byte[8192] 
> at java.base/java.lang.System.arraycopy(Native Method) 
> at 
> org.apache.sshd.common.util.buffer.ByteArrayBuffer.putRawBytes(ByteArrayBuffer.java:230)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.createSendBuffer(ChannelAsyncOutputStream.java:229)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.doWriteIfPossible(ChannelAsyncOutputStream.java:164)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.writePacket(ChannelAsyncOutputStream.java:70){noformat}
> This never happened in 2.4.0, so it is definitely a regression



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1032) java.lang.ArrayIndexOutOfBoundsException arraycopy

2020-07-21 Thread Evgeny Pasynkov (Jira)


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

Evgeny Pasynkov commented on SSHD-1032:
---

Ok, I can reproduce the problem locally quite easy. The problem usually occurs 
when a couple of GBs already sent into channel.

The only strange thing I see in logs that an exception is prepended by a number 
of SSH_MSG_CHANNEL_WINDOW_ADJUST messages without sending actual data frames
{code:java}
[2020-07-21 12:58:52,843]  DEBUG [   sshd-nio2-29]ssh-101   
 Mock User ssh.server.SSHChannelSessionEx - 
handleWindowAdjust(SSHChannelSessionEx[id=0, 
recipient=0]-SSHServerSessionEx[pasynkov@/0:0:0:0:0:0:0:1:57312]) 
SSH_MSG_CHANNEL_WINDOW_ADJUST window=65520
[2020-07-21 12:58:52,844]  DEBUG [4 @coroutine#11]ssh-101 
:1e:95:c1:93 .ssh.server.SSHServerSessionEx - 
encode(SSHServerSessionEx[pasynkov@/0:0:0:0:0:0:0:1:57312]) packet #138960 
sending command=94[SSH_MSG_CHANNEL_DATA] len=16393
[2020-07-21 12:58:52,844]  DEBUG [4 @coroutine#11]ssh-101 
:1e:95:c1:93 .ssh.server.SSHServerSessionEx - 
encode(SSHServerSessionEx[pasynkov@/0:0:0:0:0:0:0:1:57312]) packet #138961 
sending command=94[SSH_MSG_CHANNEL_DATA] len=16393
[2020-07-21 12:58:52,844]  DEBUG [4 @coroutine#11]ssh-101 
:1e:95:c1:93 .ssh.server.SSHServerSessionEx - 
encode(SSHServerSessionEx[pasynkov@/0:0:0:0:0:0:0:1:57312]) packet #138962 
sending command=94[SSH_MSG_CHANNEL_DATA] len=16393
[2020-07-21 12:58:52,844]  DEBUG [4 @coroutine#11]ssh-101 
:1e:95:c1:93 .ssh.server.SSHServerSessionEx - 
encode(SSHServerSessionEx[pasynkov@/0:0:0:0:0:0:0:1:57312]) packet #138963 
sending command=94[SSH_MSG_CHANNEL_DATA] len=16393
[2020-07-21 12:58:52,845]  DEBUG [   sshd-nio2-11]ssh-101   
 Mock User ssh.server.SSHChannelSessionEx - 
handleWindowAdjust(SSHChannelSessionEx[id=0, 
recipient=0]-SSHServerSessionEx[pasynkov@/0:0:0:0:0:0:0:1:57312]) 
SSH_MSG_CHANNEL_WINDOW_ADJUST window=65520
[2020-07-21 12:58:52,845]  DEBUG [   sshd-nio2-11]ssh-101   
 Mock User .ssh.server.SSHServerSessionEx - 
encode(SSHServerSessionEx[pasynkov@/0:0:0:0:0:0:0:1:57312]) packet #138964 
sending command=94[SSH_MSG_CHANNEL_DATA] len=16393
[2020-07-21 12:58:52,845]  DEBUG [2 @coroutine#11]ssh-101 
:1e:95:c1:93 .ssh.server.SSHServerSessionEx - 
encode(SSHServerSessionEx[pasynkov@/0:0:0:0:0:0:0:1:57312]) packet #138965 
sending command=94[SSH_MSG_CHANNEL_DATA] len=16393
[2020-07-21 12:58:52,846]  DEBUG [3 @coroutine#11]ssh-101 
:1e:95:c1:93 .ssh.server.SSHServerSessionEx - 
encode(SSHServerSessionEx[pasynkov@/0:0:0:0:0:0:0:1:57312]) packet #138966 
sending command=94[SSH_MSG_CHANNEL_DATA] len=16393
[2020-07-21 12:58:52,846]  DEBUG [9 @coroutine#11]ssh-101 
:1e:95:c1:93 .ssh.server.SSHServerSessionEx - 
encode(SSHServerSessionEx[pasynkov@/0:0:0:0:0:0:0:1:57312]) packet #138967 
sending command=94[SSH_MSG_CHANNEL_DATA] len=16393
[2020-07-21 12:58:52,847]  DEBUG [   sshd-nio2-26]ssh-101   
 Mock User ssh.server.SSHChannelSessionEx - 
handleWindowAdjust(SSHChannelSessionEx[id=0, 
recipient=0]-SSHServerSessionEx[pasynkov@/0:0:0:0:0:0:0:1:57312]) 
SSH_MSG_CHANNEL_WINDOW_ADJUST window=65520
[2020-07-21 12:58:52,847]  DEBUG [   sshd-nio2-26]ssh-101   
 Mock User .ssh.server.SSHServerSessionEx - 
encode(SSHServerSessionEx[pasynkov@/0:0:0:0:0:0:0:1:57312]) packet #138968 
sending command=94[SSH_MSG_CHANNEL_DATA] len=16393
[2020-07-21 12:58:52,848]  DEBUG [2 @coroutine#11]ssh-101 
:1e:95:c1:93 .ssh.server.SSHServerSessionEx - 
encode(SSHServerSessionEx[pasynkov@/0:0:0:0:0:0:0:1:57312]) packet #138969 
sending command=94[SSH_MSG_CHANNEL_DATA] len=16393
[2020-07-21 12:58:52,848]  DEBUG [3 @coroutine#11]ssh-101 
:1e:95:c1:93 .ssh.server.SSHServerSessionEx - 
encode(SSHServerSessionEx[pasynkov@/0:0:0:0:0:0:0:1:57312]) packet #138970 
sending command=94[SSH_MSG_CHANNEL_DATA] len=16393
[2020-07-21 12:58:52,848]  DEBUG [7 @coroutine#11]ssh-101 
:1e:95:c1:93 .ssh.server.SSHServerSessionEx - 
encode(SSHServerSessionEx[pasynkov@/0:0:0:0:0:0:0:1:57312]) packet #138971 
sending command=94[SSH_MSG_CHANNEL_DATA] len=16393
[2020-07-21 12:58:52,849]  DEBUG [   sshd-nio2-33]ssh-101   
 Mock User ssh.server.SSHChannelSessionEx - 
handleWindowAdjust(SSHChannelSessionEx[id=0, 
recipient=0]-SSHServerSessionEx[pasynkov@/0:0:0:0:0:0:0:1:57312]) 
SSH_MSG_CHANNEL_WINDOW_ADJUST window=65520
[2020-07-21 12:58:52,849]  DEBUG [   sshd-nio2-33]ssh-101   
 Mock User .ssh.server.SSHServerSessionEx - 
encode(SSHServerSessionEx[pasynkov@/0:0:0:0:0:0:0:1:57312]) packet #138972 
sending command=94[SSH_MSG_CHANNEL_DATA] len=16393
[2020-07-21 12:58:52,850]  DEBUG [

[jira] [Commented] (SSHD-1032) java.lang.ArrayIndexOutOfBoundsException arraycopy

2020-07-19 Thread Evgeny Pasynkov (Jira)


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

Evgeny Pasynkov commented on SSHD-1032:
---

Nope, the buffer is not reused. The write loop looks like this (in Kotlin): - 
it just reads data portion from pipe and sends it into SSH channel
{code:java}
do {
val buffer = ByteArray(8192)
val read = pipe.read(buffer)
if (read > 0) {
try {
ioOut.writePacket(ByteArrayBuffer(buffer, 0, read, 
true)).awaitWrite()
} catch (ex: Throwable) {
throw IOException("Error writing $read bytes. Channel: ${ioOut}", 
ex)
}
}
} while (read > 0)

{code}
I will do exhaustive testing tomorrow with debug logging enabled, and hopefully 
will provide logs with more details

> java.lang.ArrayIndexOutOfBoundsException arraycopy
> --
>
> Key: SSHD-1032
> URL: https://issues.apache.org/jira/browse/SSHD-1032
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.5.0
>Reporter: Evgeny Pasynkov
>Priority: Major
>
> When invoking writePacket, I quite often get the following exception:
> {noformat}
> Caused by: java.lang.ArrayIndexOutOfBoundsException arraycopy: last source 
> index 32768 out of bounds for byte[8192] 
> at java.base/java.lang.System.arraycopy(Native Method) 
> at 
> org.apache.sshd.common.util.buffer.ByteArrayBuffer.putRawBytes(ByteArrayBuffer.java:230)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.createSendBuffer(ChannelAsyncOutputStream.java:229)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.doWriteIfPossible(ChannelAsyncOutputStream.java:164)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.writePacket(ChannelAsyncOutputStream.java:70){noformat}
> This never happened in 2.4.0, so it is definitely a regression



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1032) java.lang.ArrayIndexOutOfBoundsException arraycopy

2020-07-19 Thread Guillaume Nodet (Jira)


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

Guillaume Nodet commented on SSHD-1032:
---

[~xvost] I suspect you are reusing the buffer passed to \{{writePacket}}.  
Could that be the case ?  

> java.lang.ArrayIndexOutOfBoundsException arraycopy
> --
>
> Key: SSHD-1032
> URL: https://issues.apache.org/jira/browse/SSHD-1032
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.5.0
>Reporter: Evgeny Pasynkov
>Priority: Major
>
> When invoking writePacket, I quite often get the following exception:
> {noformat}
> Caused by: java.lang.ArrayIndexOutOfBoundsException arraycopy: last source 
> index 32768 out of bounds for byte[8192] 
> at java.base/java.lang.System.arraycopy(Native Method) 
> at 
> org.apache.sshd.common.util.buffer.ByteArrayBuffer.putRawBytes(ByteArrayBuffer.java:230)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.createSendBuffer(ChannelAsyncOutputStream.java:229)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.doWriteIfPossible(ChannelAsyncOutputStream.java:164)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.writePacket(ChannelAsyncOutputStream.java:70){noformat}
> This never happened in 2.4.0, so it is definitely a regression



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1032) java.lang.ArrayIndexOutOfBoundsException arraycopy

2020-07-17 Thread Lyor Goldstein (Jira)


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

Lyor Goldstein commented on SSHD-1032:
--

I have tried to review the code and ran some tests but I cannot cause it to 
fail the way you describe. Can you enable the relevant log levels and see what 
happens when this occurs ?

> java.lang.ArrayIndexOutOfBoundsException arraycopy
> --
>
> Key: SSHD-1032
> URL: https://issues.apache.org/jira/browse/SSHD-1032
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.5.0
>Reporter: Evgeny Pasynkov
>Priority: Major
>
> When invoking writePacket, I quite often get the following exception:
> {noformat}
> Caused by: java.lang.ArrayIndexOutOfBoundsException arraycopy: last source 
> index 32768 out of bounds for byte[8192] 
> at java.base/java.lang.System.arraycopy(Native Method) 
> at 
> org.apache.sshd.common.util.buffer.ByteArrayBuffer.putRawBytes(ByteArrayBuffer.java:230)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.createSendBuffer(ChannelAsyncOutputStream.java:229)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.doWriteIfPossible(ChannelAsyncOutputStream.java:164)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.writePacket(ChannelAsyncOutputStream.java:70){noformat}
> This never happened in 2.4.0, so it is definitely a regression



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1032) java.lang.ArrayIndexOutOfBoundsException arraycopy

2020-07-10 Thread Lyor Goldstein (Jira)


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

Lyor Goldstein commented on SSHD-1032:
--

Thanks, this provides more information - I'll look into it.

> java.lang.ArrayIndexOutOfBoundsException arraycopy
> --
>
> Key: SSHD-1032
> URL: https://issues.apache.org/jira/browse/SSHD-1032
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.5.0
>Reporter: Evgeny Pasynkov
>Priority: Major
>
> When invoking writePacket, I quite often get the following exception:
> {noformat}
> Caused by: java.lang.ArrayIndexOutOfBoundsException arraycopy: last source 
> index 32768 out of bounds for byte[8192] 
> at java.base/java.lang.System.arraycopy(Native Method) 
> at 
> org.apache.sshd.common.util.buffer.ByteArrayBuffer.putRawBytes(ByteArrayBuffer.java:230)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.createSendBuffer(ChannelAsyncOutputStream.java:229)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.doWriteIfPossible(ChannelAsyncOutputStream.java:164)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.writePacket(ChannelAsyncOutputStream.java:70){noformat}
> This never happened in 2.4.0, so it is definitely a regression



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1032) java.lang.ArrayIndexOutOfBoundsException arraycopy

2020-07-09 Thread Evgeny Pasynkov (Jira)


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

Evgeny Pasynkov commented on SSHD-1032:
---

No, this is not related to SFTP code. The server application receives incoming 
SSH requests and handles the command execution by itself (Actually, the 
commands are domain specific for application).

 

The provided stacktrace are the only frames involving mina.sshd - all frames 
above are from my application. I do the following (Kotlin language):

 
{code:java}
val buffer = ByteArray(8192)
. fill buffer with actual data to send.
IoOutputStream.writePacket(ByteArrayBuffer(buffer, 0, min(length, 8192), true))
{code}
 

> java.lang.ArrayIndexOutOfBoundsException arraycopy
> --
>
> Key: SSHD-1032
> URL: https://issues.apache.org/jira/browse/SSHD-1032
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.5.0
>Reporter: Evgeny Pasynkov
>Priority: Major
>
> When invoking writePacket, I quite often get the following exception:
> {noformat}
> Caused by: java.lang.ArrayIndexOutOfBoundsException arraycopy: last source 
> index 32768 out of bounds for byte[8192] 
> at java.base/java.lang.System.arraycopy(Native Method) 
> at 
> org.apache.sshd.common.util.buffer.ByteArrayBuffer.putRawBytes(ByteArrayBuffer.java:230)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.createSendBuffer(ChannelAsyncOutputStream.java:229)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.doWriteIfPossible(ChannelAsyncOutputStream.java:164)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.writePacket(ChannelAsyncOutputStream.java:70){noformat}
> This never happened in 2.4.0, so it is definitely a regression



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-1032) java.lang.ArrayIndexOutOfBoundsException arraycopy

2020-07-09 Thread Lyor Goldstein (Jira)


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

Lyor Goldstein commented on SSHD-1032:
--

This may be related to some SFTP changes we added involving the use of async 
streams. Can you confirm that this is the use-case here ? Are you using SFTP 
when this occurs - if so what is the code trying to do - read/write/sth. else ? 

In any case, can you provide the full exception stack trace ?

> java.lang.ArrayIndexOutOfBoundsException arraycopy
> --
>
> Key: SSHD-1032
> URL: https://issues.apache.org/jira/browse/SSHD-1032
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.5.0
>Reporter: Evgeny Pasynkov
>Priority: Major
>
> When invoking writePacket, I quite often get the following exception:
> {noformat}
> Caused by: java.lang.ArrayIndexOutOfBoundsException arraycopy: last source 
> index 32768 out of bounds for byte[8192] 
> at java.base/java.lang.System.arraycopy(Native Method) 
> at 
> org.apache.sshd.common.util.buffer.ByteArrayBuffer.putRawBytes(ByteArrayBuffer.java:230)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.createSendBuffer(ChannelAsyncOutputStream.java:229)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.doWriteIfPossible(ChannelAsyncOutputStream.java:164)
>  
> at 
> org.apache.sshd.common.channel.ChannelAsyncOutputStream.writePacket(ChannelAsyncOutputStream.java:70){noformat}
> This never happened in 2.4.0, so it is definitely a regression



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org