[jira] [Work logged] (ARTEMIS-4340) ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in else condition
[ https://issues.apache.org/jira/browse/ARTEMIS-4340?focusedWorklogId=869846&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-869846 ] ASF GitHub Bot logged work on ARTEMIS-4340: --- Author: ASF GitHub Bot Created on: 07/Jul/23 16:41 Start Date: 07/Jul/23 16:41 Worklog Time Spent: 10m Work Description: clebertsuconic merged PR #4533: URL: https://github.com/apache/activemq-artemis/pull/4533 Issue Time Tracking --- Worklog Id: (was: 869846) Time Spent: 1h 20m (was: 1h 10m) > ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in else condition > -- > > Key: ARTEMIS-4340 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4340 > Project: ActiveMQ Artemis > Issue Type: Bug >Affects Versions: 2.22.0 > Environment: Windows 10, Linux >Reporter: David Hoffer >Assignee: Robbie Gemmell >Priority: Major > Time Spent: 1h 20m > Remaining Estimate: 0h > > In artemis-commons: > ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in the else part of > the method. > The code in the else part is looping through number of bytes specified by > bytes input parameter which is often provided by buffer.capacity(), but then > the code at > buffer.put(i + offset, zero) where buffer is of DirectByteBuffer type calls > checkIndex(int i) and it throws if i is >= limit. > But limit is not the same as capacity in a Buffer. In our case capacity is > 4096 and limit is 16 so method always throws IndexOutOfBoundsException if the > else case is executed as soon as i ==16. > This code is called when Artemis is launched and it validates/creates the > various bindings files. This causes Artemis to fail to load properly. > Note I believe all versions of artemis-commons has this bug but I currently > am testing with 2.22.0. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4340) ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in else condition
[ https://issues.apache.org/jira/browse/ARTEMIS-4340?focusedWorklogId=869845&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-869845 ] ASF GitHub Bot logged work on ARTEMIS-4340: --- Author: ASF GitHub Bot Created on: 07/Jul/23 16:41 Start Date: 07/Jul/23 16:41 Worklog Time Spent: 10m Work Description: clebertsuconic commented on PR #4533: URL: https://github.com/apache/activemq-artemis/pull/4533#issuecomment-1625672952 we are doing a release early next week. Issue Time Tracking --- Worklog Id: (was: 869845) Time Spent: 1h 10m (was: 1h) > ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in else condition > -- > > Key: ARTEMIS-4340 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4340 > Project: ActiveMQ Artemis > Issue Type: Bug >Affects Versions: 2.22.0 > Environment: Windows 10, Linux >Reporter: David Hoffer >Assignee: Robbie Gemmell >Priority: Major > Time Spent: 1h 10m > Remaining Estimate: 0h > > In artemis-commons: > ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in the else part of > the method. > The code in the else part is looping through number of bytes specified by > bytes input parameter which is often provided by buffer.capacity(), but then > the code at > buffer.put(i + offset, zero) where buffer is of DirectByteBuffer type calls > checkIndex(int i) and it throws if i is >= limit. > But limit is not the same as capacity in a Buffer. In our case capacity is > 4096 and limit is 16 so method always throws IndexOutOfBoundsException if the > else case is executed as soon as i ==16. > This code is called when Artemis is launched and it validates/creates the > various bindings files. This causes Artemis to fail to load properly. > Note I believe all versions of artemis-commons has this bug but I currently > am testing with 2.22.0. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4340) ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in else condition
[ https://issues.apache.org/jira/browse/ARTEMIS-4340?focusedWorklogId=869618&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-869618 ] ASF GitHub Bot logged work on ARTEMIS-4340: --- Author: ASF GitHub Bot Created on: 06/Jul/23 16:19 Start Date: 06/Jul/23 16:19 Worklog Time Spent: 10m Work Description: tabish121 commented on PR #4533: URL: https://github.com/apache/activemq-artemis/pull/4533#issuecomment-1623959294 LGTM Issue Time Tracking --- Worklog Id: (was: 869618) Time Spent: 1h (was: 50m) > ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in else condition > -- > > Key: ARTEMIS-4340 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4340 > Project: ActiveMQ Artemis > Issue Type: Bug >Affects Versions: 2.22.0 > Environment: Windows 10, Linux >Reporter: David Hoffer >Assignee: Robbie Gemmell >Priority: Major > Time Spent: 1h > Remaining Estimate: 0h > > In artemis-commons: > ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in the else part of > the method. > The code in the else part is looping through number of bytes specified by > bytes input parameter which is often provided by buffer.capacity(), but then > the code at > buffer.put(i + offset, zero) where buffer is of DirectByteBuffer type calls > checkIndex(int i) and it throws if i is >= limit. > But limit is not the same as capacity in a Buffer. In our case capacity is > 4096 and limit is 16 so method always throws IndexOutOfBoundsException if the > else case is executed as soon as i ==16. > This code is called when Artemis is launched and it validates/creates the > various bindings files. This causes Artemis to fail to load properly. > Note I believe all versions of artemis-commons has this bug but I currently > am testing with 2.22.0. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4340) ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in else condition
[ https://issues.apache.org/jira/browse/ARTEMIS-4340?focusedWorklogId=869354&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-869354 ] ASF GitHub Bot logged work on ARTEMIS-4340: --- Author: ASF GitHub Bot Created on: 05/Jul/23 14:59 Start Date: 05/Jul/23 14:59 Worklog Time Spent: 10m Work Description: jbertram commented on PR #4533: URL: https://github.com/apache/activemq-artemis/pull/4533#issuecomment-1621940979 As far as I'm aware ActiveMQ has never done a "service pack." We've done micro releases, especially on the "Classic" broker. However, in this case we'll just do a normal minor release. If there's an older version where you really need the fix immediately while you prepare for an upgrade you can cherry-pick this fix on top of that version's tag, rebuild it, and deploy the new `artemis-journal` jar. Issue Time Tracking --- Worklog Id: (was: 869354) Time Spent: 50m (was: 40m) > ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in else condition > -- > > Key: ARTEMIS-4340 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4340 > Project: ActiveMQ Artemis > Issue Type: Bug > Components: ActiveMQ-Artemis-Native >Affects Versions: 2.22.0 > Environment: Windows 10, Linux >Reporter: David Hoffer >Assignee: Robbie Gemmell >Priority: Major > Time Spent: 50m > Remaining Estimate: 0h > > In artemis-commons: > ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in the else part of > the method. > The code in the else part is looping through number of bytes specified by > bytes input parameter which is often provided by buffer.capacity(), but then > the code at > buffer.put(i + offset, zero) where buffer is of DirectByteBuffer type calls > checkIndex(int i) and it throws if i is >= limit. > But limit is not the same as capacity in a Buffer. In our case capacity is > 4096 and limit is 16 so method always throws IndexOutOfBoundsException if the > else case is executed as soon as i ==16. > This code is called when Artemis is launched and it validates/creates the > various bindings files. This causes Artemis to fail to load properly. > Note I believe all versions of artemis-commons has this bug but I currently > am testing with 2.22.0. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4340) ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in else condition
[ https://issues.apache.org/jira/browse/ARTEMIS-4340?focusedWorklogId=869336&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-869336 ] ASF GitHub Bot logged work on ARTEMIS-4340: --- Author: ASF GitHub Bot Created on: 05/Jul/23 14:12 Start Date: 05/Jul/23 14:12 Worklog Time Spent: 10m Work Description: gemmellr commented on PR #4533: URL: https://github.com/apache/activemq-artemis/pull/4533#issuecomment-1621845215 Whatever the next release is, most likely 2.30.0. Issue Time Tracking --- Worklog Id: (was: 869336) Time Spent: 40m (was: 0.5h) > ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in else condition > -- > > Key: ARTEMIS-4340 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4340 > Project: ActiveMQ Artemis > Issue Type: Bug > Components: ActiveMQ-Artemis-Native >Affects Versions: 2.22.0 > Environment: Windows 10, Linux >Reporter: David Hoffer >Assignee: Robbie Gemmell >Priority: Major > Time Spent: 40m > Remaining Estimate: 0h > > In artemis-commons: > ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in the else part of > the method. > The code in the else part is looping through number of bytes specified by > bytes input parameter which is often provided by buffer.capacity(), but then > the code at > buffer.put(i + offset, zero) where buffer is of DirectByteBuffer type calls > checkIndex(int i) and it throws if i is >= limit. > But limit is not the same as capacity in a Buffer. In our case capacity is > 4096 and limit is 16 so method always throws IndexOutOfBoundsException if the > else case is executed as soon as i ==16. > This code is called when Artemis is launched and it validates/creates the > various bindings files. This causes Artemis to fail to load properly. > Note I believe all versions of artemis-commons has this bug but I currently > am testing with 2.22.0. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4340) ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in else condition
[ https://issues.apache.org/jira/browse/ARTEMIS-4340?focusedWorklogId=869334&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-869334 ] ASF GitHub Bot logged work on ARTEMIS-4340: --- Author: ASF GitHub Bot Created on: 05/Jul/23 14:03 Start Date: 05/Jul/23 14:03 Worklog Time Spent: 10m Work Description: dhoffer commented on PR #4533: URL: https://github.com/apache/activemq-artemis/pull/4533#issuecomment-1621826437 What version of Atremis is this planned for? Since it affects all versions, would this be a service pack fix on several/all versions? Or is this just going to go into the baseline for the next minor release? Or preference would be service packs on the last few versions so we have more flexibility on which versions we could use. Issue Time Tracking --- Worklog Id: (was: 869334) Time Spent: 0.5h (was: 20m) > ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in else condition > -- > > Key: ARTEMIS-4340 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4340 > Project: ActiveMQ Artemis > Issue Type: Bug > Components: ActiveMQ-Artemis-Native >Affects Versions: 2.22.0 > Environment: Windows 10, Linux >Reporter: David Hoffer >Assignee: Robbie Gemmell >Priority: Major > Time Spent: 0.5h > Remaining Estimate: 0h > > In artemis-commons: > ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in the else part of > the method. > The code in the else part is looping through number of bytes specified by > bytes input parameter which is often provided by buffer.capacity(), but then > the code at > buffer.put(i + offset, zero) where buffer is of DirectByteBuffer type calls > checkIndex(int i) and it throws if i is >= limit. > But limit is not the same as capacity in a Buffer. In our case capacity is > 4096 and limit is 16 so method always throws IndexOutOfBoundsException if the > else case is executed as soon as i ==16. > This code is called when Artemis is launched and it validates/creates the > various bindings files. This causes Artemis to fail to load properly. > Note I believe all versions of artemis-commons has this bug but I currently > am testing with 2.22.0. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4340) ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in else condition
[ https://issues.apache.org/jira/browse/ARTEMIS-4340?focusedWorklogId=868950&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-868950 ] ASF GitHub Bot logged work on ARTEMIS-4340: --- Author: ASF GitHub Bot Created on: 03/Jul/23 16:45 Start Date: 03/Jul/23 16:45 Worklog Time Spent: 10m Work Description: gemmellr commented on code in PR #4533: URL: https://github.com/apache/activemq-artemis/pull/4533#discussion_r1251107981 ## artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/util/ThreadLocalByteBufferPool.java: ## @@ -44,6 +44,7 @@ public ByteBuffer borrow(final int size, boolean zeroed) { } else { bytesPool.set(null); if (zeroed) { +byteBuffer.clear(); Review Comment: An alternative could be moving this before the if, and replacing the call present after the if already..but its probably safer just to leave both for all it actually does (sets a few ints). Issue Time Tracking --- Worklog Id: (was: 868950) Time Spent: 20m (was: 10m) > ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in else condition > -- > > Key: ARTEMIS-4340 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4340 > Project: ActiveMQ Artemis > Issue Type: Bug > Components: ActiveMQ-Artemis-Native >Affects Versions: 2.22.0 > Environment: Windows 10, Linux >Reporter: David Hoffer >Assignee: Clebert Suconic >Priority: Major > Time Spent: 20m > Remaining Estimate: 0h > > In artemis-commons: > ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in the else part of > the method. > The code in the else part is looping through number of bytes specified by > bytes input parameter which is often provided by buffer.capacity(), but then > the code at > buffer.put(i + offset, zero) where buffer is of DirectByteBuffer type calls > checkIndex(int i) and it throws if i is >= limit. > But limit is not the same as capacity in a Buffer. In our case capacity is > 4096 and limit is 16 so method always throws IndexOutOfBoundsException if the > else case is executed as soon as i ==16. > This code is called when Artemis is launched and it validates/creates the > various bindings files. This causes Artemis to fail to load properly. > Note I believe all versions of artemis-commons has this bug but I currently > am testing with 2.22.0. -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Work logged] (ARTEMIS-4340) ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in else condition
[ https://issues.apache.org/jira/browse/ARTEMIS-4340?focusedWorklogId=868948&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-868948 ] ASF GitHub Bot logged work on ARTEMIS-4340: --- Author: ASF GitHub Bot Created on: 03/Jul/23 16:42 Start Date: 03/Jul/23 16:42 Worklog Time Spent: 10m Work Description: gemmellr opened a new pull request, #4533: URL: https://github.com/apache/activemq-artemis/pull/4533 The report for ARTEMIS-4340 was raised about ByteUtil.uncheckedZeros throwing IndexOutOfBoundsException. Though some of ByteUtil's behaviour can perhaps be questioned around its consistency with different buffer types, in this case the problem ultimately starts earlier in the call tree with org.apache.activemq.artemis.core.io.util.ThreadLocalByteBufferPool.borrow(int, boolean) passing it invalid arguments. It passes in a buffer for zeroing, with its limit still set below the requested size to be zero'd, leading to the IndexOutOfBoundsException in this case when tryign to write beyond the limit. The reason this seemingly long-standing bug has perhaps not been hit so far is that it occurs in a less typical case where the buffer isnt direct, but also doesnt have an array. ThreadLocalByteBufferPool should clear position+limit before zeroing the buffer. Issue Time Tracking --- Worklog Id: (was: 868948) Remaining Estimate: 0h Time Spent: 10m > ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in else condition > -- > > Key: ARTEMIS-4340 > URL: https://issues.apache.org/jira/browse/ARTEMIS-4340 > Project: ActiveMQ Artemis > Issue Type: Bug > Components: ActiveMQ-Artemis-Native >Affects Versions: 2.22.0 > Environment: Windows 10, Linux >Reporter: David Hoffer >Assignee: Clebert Suconic >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > In artemis-commons: > ByteUtil.uncheckedZeros throws IndexOutOfBoundsException in the else part of > the method. > The code in the else part is looping through number of bytes specified by > bytes input parameter which is often provided by buffer.capacity(), but then > the code at > buffer.put(i + offset, zero) where buffer is of DirectByteBuffer type calls > checkIndex(int i) and it throws if i is >= limit. > But limit is not the same as capacity in a Buffer. In our case capacity is > 4096 and limit is 16 so method always throws IndexOutOfBoundsException if the > else case is executed as soon as i ==16. > This code is called when Artemis is launched and it validates/creates the > various bindings files. This causes Artemis to fail to load properly. > Note I believe all versions of artemis-commons has this bug but I currently > am testing with 2.22.0. -- This message was sent by Atlassian Jira (v8.20.10#820010)