You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/12/18 15:34:00 UTC

[jira] [Updated] (GROOVY-2072) eachFileRecurse crashes when descending a directory with circular symbolic links

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

Eric Milles updated GROOVY-2072:
--------------------------------
    Labels: StackOverflowError  (was: )

> eachFileRecurse crashes when descending a directory with circular symbolic links
> --------------------------------------------------------------------------------
>
>                 Key: GROOVY-2072
>                 URL: https://issues.apache.org/jira/browse/GROOVY-2072
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-jdk
>    Affects Versions: 1.1-beta-2
>         Environment: redhat fc5, sun java 5 or 6, ubuntu feisty, sun java 5 or 6
>            Reporter: Phil Walker
>            Priority: Major
>              Labels: StackOverflowError
>
> The following script will quickly stack overflow on linux if the IllegalArgumentException line is commented out.
> #!/usr/bin/env groovy
> def ff = new File("/sys/block/md0/subsystem");
> def isSymlink(ff){
>     return ff.getAbsolutePath()!=ff.getCanonicalPath() ;
> }
> ff.eachFileRecurse {
>     printf("%s\n",it);
>     if( isSymlink(it) ){
>         throw new IllegalArgumentException("circular symlinks");
>     }
> }



--
This message was sent by Atlassian Jira
(v8.20.1#820001)