You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tamas Cservenak (Jira)" <ji...@apache.org> on 2023/07/19 15:44:00 UTC

[jira] [Closed] (MNG-7846) endless loop in DefaultExceptionHandler.getMessage()

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

Tamas Cservenak closed MNG-7846.
--------------------------------
    Resolution: Fixed

> endless loop in DefaultExceptionHandler.getMessage()
> ----------------------------------------------------
>
>                 Key: MNG-7846
>                 URL: https://issues.apache.org/jira/browse/MNG-7846
>             Project: Maven
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 3.9.3
>            Reporter: Michael Keppler
>            Assignee: Tamas Cservenak
>            Priority: Major
>             Fix For: 3.9.4, 4.0.0-alpha-8, 4.0.0
>
>         Attachments: image-2023-07-19-13-59-02-398.png
>
>
> The default exception handler iterates all nested exceptions in a loop that's only left when exception.cause == null
> See [https://github.com/apache/maven/blob/4a5b6c5f2b662fbf356f86ffe44d99d3d52f9fa9/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java#L228C56-L228C64]
> Unfortunately there can be exceptions where the cause is a reference to the containing exception, e.g. exception.cause == exception. That code then becomes an endless loop. I just experienced such an endless loop and was able to find a JRubyException pointing to itself in the heap dump of the thread:
> !image-2023-07-19-13-59-02-398.png!
> The loop cancelation condition should therefore be changed to 
> {code:java}
> t != null && t != t.getCause(){code}



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