You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Justin Bertram (Jira)" <ji...@apache.org> on 2024/06/19 16:04:00 UTC

[jira] [Updated] (ARTEMIS-4747) UNREACHABLE_CODE.EXCEPTION This statement in the source code is unreachable

     [ https://issues.apache.org/jira/browse/ARTEMIS-4747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Justin Bertram updated ARTEMIS-4747:
------------------------------------
    Description: 
In [class CompressedLargeMessageControllerImpl|[https://github.com/apache/activemq-artemis/blob/fb1b362b473cad51ae5d05a897be02b1fa8461d4/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/CompressedLargeMessageControllerImpl.java#L36]|https://github.com/apache/activemq-artemis/blob/fb1b362b473cad51ae5d05a897be02b1fa8461d4/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/CompressedLargeMessageControllerImpl.java#L36)]

this function is called in a number of other methods, but since there is an exception and no handler, it turns out that part of the code is unreachable

!image-2024-04-29-00-32-18-126.png!

The code is unreachable in these cases:

1) the line with  ```return 0``` in unreachable

  !image-2024-04-29-00-38-29-717.png!

2) the line with  ```return 0``` in unreachable

!image-2024-04-29-00-42-42-738.png!

3) the line with  ```return 0``` in unreachable

!image-2024-04-29-00-42-09-598.png!

4) the line with  ```return 0``` in unreachable

!image-2024-04-29-00-43-17-889.png!

5) the line with  ```return (short) (getByte(index) & 0xFF)``` in unreachable

!image-2024-04-29-00-45-35-605.png!

6) the line with  ```return getShort(index) & 0xFFFF``` in unreachable

!image-2024-04-29-00-46-36-280.png!

7) the line with  ```return getInt(index) & 0xFFFFFFFFL``` in unreachable

!image-2024-04-29-00-48-23-220.png!

8) the line with  ```dst[i] = getByte(index++)``` in unreachable

!image-2024-04-29-00-50-16-576.png!

9) the line with  ```dst.writerIndex(dst.writerIndex() + length)``` in unreachable

!image-2024-04-29-00-52-04-906.png!

10) the line with  ```return (char) getShort(index)``` in unreachable

!image-2024-04-29-00-54-09-929.png!

11) the line with  ```return Double.longBitsToDouble(getLong(index))``` in unreachable

!image-2024-04-29-00-55-27-169.png!

12) the line with  ```return Float.intBitsToFloat(getInt(index));``` in unreachable

!image-2024-04-29-00-57-19-800.png!

  was:
In [class CompressedLargeMessageControllerImpl|[https://github.com/apache/activemq-artemis/blob/fb1b362b473cad51ae5d05a897be02b1fa8461d4/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/CompressedLargeMessageControllerImpl.java#L36]|https://github.com/apache/activemq-artemis/blob/fb1b362b473cad51ae5d05a897be02b1fa8461d4/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/CompressedLargeMessageControllerImpl.java#L36)]

this function is called in a number of other methods, but since there is an exception and no handler, it turns out that part of the code is unreachable

!image-2024-04-29-00-32-18-126.png!

The code is unreachable in these cases:

1) the line with  ```return 0``` in unreachable

  !image-2024-04-29-00-38-29-717.png!

2) the line with  ```return 0``` in unreachable

!image-2024-04-29-00-42-42-738.png!

3) the line with  ```return 0``` in unreachable

!image-2024-04-29-00-42-09-598.png!

4) the line with  ```return 0``` in unreachable

!image-2024-04-29-00-43-17-889.png!

5) the line with  ```return (short) (getByte(index) & 0xFF)``` in unreachable

!image-2024-04-29-00-45-35-605.png!

6) the line with  ```return getShort(index) & 0xFFFF``` in unreachable

!image-2024-04-29-00-46-36-280.png!

7) the line with  ```return getInt(index) & 0xFFFFFFFFL``` in unreachable

!image-2024-04-29-00-48-23-220.png!

8) the line with  ```dst[i] = getByte(index++)``` in unreachable

!image-2024-04-29-00-50-16-576.png!

9) the line with  ```dst.writerIndex(dst.writerIndex() + length)``` in unreachable

!image-2024-04-29-00-52-04-906.png!

10) the line with  ```return (char) getShort(index)``` in unreachable

!image-2024-04-29-00-54-09-929.png!

11) the line with  ```return Double.longBitsToDouble(getLong(index))``` in unreachable

!image-2024-04-29-00-55-27-169.png!

12) the line with  ```return Float.intBitsToFloat(getInt(index));``` in unreachable

!image-2024-04-29-00-57-19-800.png!

 

Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.

Author: Firsov Vladimir, BMSTU (fvv22u102@student.bmstu.ru)


> UNREACHABLE_CODE.EXCEPTION This statement in the source code is unreachable
> ---------------------------------------------------------------------------
>
>                 Key: ARTEMIS-4747
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4747
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.25.0
>            Reporter: Andrey Slepykh
>            Priority: Major
>         Attachments: image-2024-04-29-00-32-18-126.png, image-2024-04-29-00-38-29-717.png, image-2024-04-29-00-40-51-302.png, image-2024-04-29-00-42-09-598.png, image-2024-04-29-00-42-42-738.png, image-2024-04-29-00-43-17-889.png, image-2024-04-29-00-45-35-605.png, image-2024-04-29-00-46-36-280.png, image-2024-04-29-00-48-23-220.png, image-2024-04-29-00-48-27-918.png, image-2024-04-29-00-50-16-576.png, image-2024-04-29-00-52-04-906.png, image-2024-04-29-00-54-09-929.png, image-2024-04-29-00-55-27-169.png, image-2024-04-29-00-57-19-800.png
>
>
> In [class CompressedLargeMessageControllerImpl|[https://github.com/apache/activemq-artemis/blob/fb1b362b473cad51ae5d05a897be02b1fa8461d4/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/CompressedLargeMessageControllerImpl.java#L36]|https://github.com/apache/activemq-artemis/blob/fb1b362b473cad51ae5d05a897be02b1fa8461d4/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/CompressedLargeMessageControllerImpl.java#L36)]
> this function is called in a number of other methods, but since there is an exception and no handler, it turns out that part of the code is unreachable
> !image-2024-04-29-00-32-18-126.png!
> The code is unreachable in these cases:
> 1) the line with  ```return 0``` in unreachable
>   !image-2024-04-29-00-38-29-717.png!
> 2) the line with  ```return 0``` in unreachable
> !image-2024-04-29-00-42-42-738.png!
> 3) the line with  ```return 0``` in unreachable
> !image-2024-04-29-00-42-09-598.png!
> 4) the line with  ```return 0``` in unreachable
> !image-2024-04-29-00-43-17-889.png!
> 5) the line with  ```return (short) (getByte(index) & 0xFF)``` in unreachable
> !image-2024-04-29-00-45-35-605.png!
> 6) the line with  ```return getShort(index) & 0xFFFF``` in unreachable
> !image-2024-04-29-00-46-36-280.png!
> 7) the line with  ```return getInt(index) & 0xFFFFFFFFL``` in unreachable
> !image-2024-04-29-00-48-23-220.png!
> 8) the line with  ```dst[i] = getByte(index++)``` in unreachable
> !image-2024-04-29-00-50-16-576.png!
> 9) the line with  ```dst.writerIndex(dst.writerIndex() + length)``` in unreachable
> !image-2024-04-29-00-52-04-906.png!
> 10) the line with  ```return (char) getShort(index)``` in unreachable
> !image-2024-04-29-00-54-09-929.png!
> 11) the line with  ```return Double.longBitsToDouble(getLong(index))``` in unreachable
> !image-2024-04-29-00-55-27-169.png!
> 12) the line with  ```return Float.intBitsToFloat(getInt(index));``` in unreachable
> !image-2024-04-29-00-57-19-800.png!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@activemq.apache.org
For additional commands, e-mail: issues-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact