You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chukwa.apache.org by "Eric Spishak (JIRA)" <ji...@apache.org> on 2012/05/09 02:45:50 UTC

[jira] [Created] (CHUKWA-641) PatternSyntaxException Crash from Unvalidated Regular Expression Usage

Eric Spishak created CHUKWA-641:
-----------------------------------

             Summary: PatternSyntaxException Crash from Unvalidated Regular Expression Usage
                 Key: CHUKWA-641
                 URL: https://issues.apache.org/jira/browse/CHUKWA-641
             Project: Chukwa
          Issue Type: Bug
    Affects Versions: 0.5.0
            Reporter: Eric Spishak


Chukwa sometimes crashes with an unhelpful stack trace.  In particular, a PatternSyntaxException is thrown when an invalid regular expression is passed to the dumpChunk command. This exception isn't useful to users to diagnose the error. I think it would be better to report a detailed error message. The attached patch makes this change.

Steps to reproduce:

# Run 'bin/chukwa dumpChunk "tags.=(" file'
# dumpChunk command fails to start
# See exception:

{code}
Exception in thread "main" java.util.regex.PatternSyntaxException:
Unclosed group near index 1
(
 ^
       at java.util.regex.Pattern.error(Pattern.java:1713)
       at java.util.regex.Pattern.accept(Pattern.java:1571)
       at java.util.regex.Pattern.group0(Pattern.java:2533)
       at java.util.regex.Pattern.sequence(Pattern.java:1806)
       at java.util.regex.Pattern.expr(Pattern.java:1752)
       at java.util.regex.Pattern.compile(Pattern.java:1460)
       at java.util.regex.Pattern.<init>(Pattern.java:1133)
       at java.util.regex.Pattern.compile(Pattern.java:847)
       at org.apache.hadoop.chukwa.util.Filter.<init>(Filter.java:94)
       at org.apache.hadoop.chukwa.util.DumpChunks.dump(DumpChunks.java:88)
       at org.apache.hadoop.chukwa.util.DumpChunks.main(DumpChunks.java:53)
{code}

After applying the supplied patch the output is:

{code}
Error parsing "tags" regular expression: Unclosed group near index 1
(
 ^
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CHUKWA-641) PatternSyntaxException Crash from Unvalidated Regular Expression Usage

Posted by "Eric Spishak (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CHUKWA-641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Spishak updated CHUKWA-641:
--------------------------------

    Attachment: CHUKWA-641.patch
    
> PatternSyntaxException Crash from Unvalidated Regular Expression Usage
> ----------------------------------------------------------------------
>
>                 Key: CHUKWA-641
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-641
>             Project: Chukwa
>          Issue Type: Bug
>    Affects Versions: 0.5.0
>            Reporter: Eric Spishak
>         Attachments: CHUKWA-641.patch
>
>
> Chukwa sometimes crashes with an unhelpful stack trace.  In particular, a PatternSyntaxException is thrown when an invalid regular expression is passed to the dumpChunk command. This exception isn't useful to users to diagnose the error. I think it would be better to report a detailed error message. The attached patch makes this change.
> Steps to reproduce:
> # Run 'bin/chukwa dumpChunk "tags.=(" file'
> # dumpChunk command fails to start
> # See exception:
> {code}
> Exception in thread "main" java.util.regex.PatternSyntaxException:
> Unclosed group near index 1
> (
>  ^
>        at java.util.regex.Pattern.error(Pattern.java:1713)
>        at java.util.regex.Pattern.accept(Pattern.java:1571)
>        at java.util.regex.Pattern.group0(Pattern.java:2533)
>        at java.util.regex.Pattern.sequence(Pattern.java:1806)
>        at java.util.regex.Pattern.expr(Pattern.java:1752)
>        at java.util.regex.Pattern.compile(Pattern.java:1460)
>        at java.util.regex.Pattern.<init>(Pattern.java:1133)
>        at java.util.regex.Pattern.compile(Pattern.java:847)
>        at org.apache.hadoop.chukwa.util.Filter.<init>(Filter.java:94)
>        at org.apache.hadoop.chukwa.util.DumpChunks.dump(DumpChunks.java:88)
>        at org.apache.hadoop.chukwa.util.DumpChunks.main(DumpChunks.java:53)
> {code}
> After applying the supplied patch the output is:
> {code}
> Error parsing "tags" regular expression: Unclosed group near index 1
> (
>  ^
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CHUKWA-641) PatternSyntaxException Crash from Unvalidated Regular Expression Usage

Posted by "Eric Spishak (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CHUKWA-641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Spishak updated CHUKWA-641:
--------------------------------

    Attachment: CHUKWA-641.patch
    
> PatternSyntaxException Crash from Unvalidated Regular Expression Usage
> ----------------------------------------------------------------------
>
>                 Key: CHUKWA-641
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-641
>             Project: Chukwa
>          Issue Type: Bug
>    Affects Versions: 0.5.0
>            Reporter: Eric Spishak
>         Attachments: CHUKWA-641.patch, CHUKWA-641.patch
>
>
> Chukwa sometimes crashes with an unhelpful stack trace.  In particular, a PatternSyntaxException is thrown when an invalid regular expression is passed to the dumpChunk command. This exception isn't useful to users to diagnose the error. I think it would be better to report a detailed error message. The attached patch makes this change.
> Steps to reproduce:
> # Run 'bin/chukwa dumpChunk "tags.=(" file'
> # dumpChunk command fails to start
> # See exception:
> {code}
> Exception in thread "main" java.util.regex.PatternSyntaxException:
> Unclosed group near index 1
> (
>  ^
>        at java.util.regex.Pattern.error(Pattern.java:1713)
>        at java.util.regex.Pattern.accept(Pattern.java:1571)
>        at java.util.regex.Pattern.group0(Pattern.java:2533)
>        at java.util.regex.Pattern.sequence(Pattern.java:1806)
>        at java.util.regex.Pattern.expr(Pattern.java:1752)
>        at java.util.regex.Pattern.compile(Pattern.java:1460)
>        at java.util.regex.Pattern.<init>(Pattern.java:1133)
>        at java.util.regex.Pattern.compile(Pattern.java:847)
>        at org.apache.hadoop.chukwa.util.Filter.<init>(Filter.java:94)
>        at org.apache.hadoop.chukwa.util.DumpChunks.dump(DumpChunks.java:88)
>        at org.apache.hadoop.chukwa.util.DumpChunks.main(DumpChunks.java:53)
> {code}
> After applying the supplied patch the output is:
> {code}
> Error parsing "tags" regular expression: Unclosed group near index 1
> (
>  ^
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CHUKWA-641) PatternSyntaxException Crash from Unvalidated Regular Expression Usage

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CHUKWA-641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13272080#comment-13272080 ] 

Hudson commented on CHUKWA-641:
-------------------------------

Integrated in Chukwa-trunk #444 (See [https://builds.apache.org/job/Chukwa-trunk/444/])
    CHUKWA-641. Fix stack trace for dumpChunk command when invalid regular expression is specified. (Eric Spishak via Eric Yang) (Revision 1336479)

     Result = SUCCESS
eyang : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1336479
Files : 
* /incubator/chukwa/trunk/CHANGES.txt
* /incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/util/DumpChunks.java

                
> PatternSyntaxException Crash from Unvalidated Regular Expression Usage
> ----------------------------------------------------------------------
>
>                 Key: CHUKWA-641
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-641
>             Project: Chukwa
>          Issue Type: Bug
>    Affects Versions: 0.5.0
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>         Attachments: CHUKWA-641.patch
>
>
> Chukwa sometimes crashes with an unhelpful stack trace.  In particular, a PatternSyntaxException is thrown when an invalid regular expression is passed to the dumpChunk command. This exception isn't useful to users to diagnose the error. I think it would be better to report a detailed error message. The attached patch makes this change.
> Steps to reproduce:
> # Run 'bin/chukwa dumpChunk "tags.=(" file'
> # dumpChunk command fails to start
> # See exception:
> {code}
> Exception in thread "main" java.util.regex.PatternSyntaxException:
> Unclosed group near index 1
> (
>  ^
>        at java.util.regex.Pattern.error(Pattern.java:1713)
>        at java.util.regex.Pattern.accept(Pattern.java:1571)
>        at java.util.regex.Pattern.group0(Pattern.java:2533)
>        at java.util.regex.Pattern.sequence(Pattern.java:1806)
>        at java.util.regex.Pattern.expr(Pattern.java:1752)
>        at java.util.regex.Pattern.compile(Pattern.java:1460)
>        at java.util.regex.Pattern.<init>(Pattern.java:1133)
>        at java.util.regex.Pattern.compile(Pattern.java:847)
>        at org.apache.hadoop.chukwa.util.Filter.<init>(Filter.java:94)
>        at org.apache.hadoop.chukwa.util.DumpChunks.dump(DumpChunks.java:88)
>        at org.apache.hadoop.chukwa.util.DumpChunks.main(DumpChunks.java:53)
> {code}
> After applying the supplied patch the output is:
> {code}
> Error parsing "tags" regular expression: Unclosed group near index 1
> (
>  ^
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (CHUKWA-641) PatternSyntaxException Crash from Unvalidated Regular Expression Usage

Posted by "Eric Yang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CHUKWA-641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Yang reassigned CHUKWA-641:
--------------------------------

    Assignee: Eric Spishak
    
> PatternSyntaxException Crash from Unvalidated Regular Expression Usage
> ----------------------------------------------------------------------
>
>                 Key: CHUKWA-641
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-641
>             Project: Chukwa
>          Issue Type: Bug
>    Affects Versions: 0.5.0
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>         Attachments: CHUKWA-641.patch
>
>
> Chukwa sometimes crashes with an unhelpful stack trace.  In particular, a PatternSyntaxException is thrown when an invalid regular expression is passed to the dumpChunk command. This exception isn't useful to users to diagnose the error. I think it would be better to report a detailed error message. The attached patch makes this change.
> Steps to reproduce:
> # Run 'bin/chukwa dumpChunk "tags.=(" file'
> # dumpChunk command fails to start
> # See exception:
> {code}
> Exception in thread "main" java.util.regex.PatternSyntaxException:
> Unclosed group near index 1
> (
>  ^
>        at java.util.regex.Pattern.error(Pattern.java:1713)
>        at java.util.regex.Pattern.accept(Pattern.java:1571)
>        at java.util.regex.Pattern.group0(Pattern.java:2533)
>        at java.util.regex.Pattern.sequence(Pattern.java:1806)
>        at java.util.regex.Pattern.expr(Pattern.java:1752)
>        at java.util.regex.Pattern.compile(Pattern.java:1460)
>        at java.util.regex.Pattern.<init>(Pattern.java:1133)
>        at java.util.regex.Pattern.compile(Pattern.java:847)
>        at org.apache.hadoop.chukwa.util.Filter.<init>(Filter.java:94)
>        at org.apache.hadoop.chukwa.util.DumpChunks.dump(DumpChunks.java:88)
>        at org.apache.hadoop.chukwa.util.DumpChunks.main(DumpChunks.java:53)
> {code}
> After applying the supplied patch the output is:
> {code}
> Error parsing "tags" regular expression: Unclosed group near index 1
> (
>  ^
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CHUKWA-641) PatternSyntaxException Crash from Unvalidated Regular Expression Usage

Posted by "Eric Spishak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CHUKWA-641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13271819#comment-13271819 ] 

Eric Spishak commented on CHUKWA-641:
-------------------------------------

I've updated the patch to print to stderr.
                
> PatternSyntaxException Crash from Unvalidated Regular Expression Usage
> ----------------------------------------------------------------------
>
>                 Key: CHUKWA-641
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-641
>             Project: Chukwa
>          Issue Type: Bug
>    Affects Versions: 0.5.0
>            Reporter: Eric Spishak
>         Attachments: CHUKWA-641.patch
>
>
> Chukwa sometimes crashes with an unhelpful stack trace.  In particular, a PatternSyntaxException is thrown when an invalid regular expression is passed to the dumpChunk command. This exception isn't useful to users to diagnose the error. I think it would be better to report a detailed error message. The attached patch makes this change.
> Steps to reproduce:
> # Run 'bin/chukwa dumpChunk "tags.=(" file'
> # dumpChunk command fails to start
> # See exception:
> {code}
> Exception in thread "main" java.util.regex.PatternSyntaxException:
> Unclosed group near index 1
> (
>  ^
>        at java.util.regex.Pattern.error(Pattern.java:1713)
>        at java.util.regex.Pattern.accept(Pattern.java:1571)
>        at java.util.regex.Pattern.group0(Pattern.java:2533)
>        at java.util.regex.Pattern.sequence(Pattern.java:1806)
>        at java.util.regex.Pattern.expr(Pattern.java:1752)
>        at java.util.regex.Pattern.compile(Pattern.java:1460)
>        at java.util.regex.Pattern.<init>(Pattern.java:1133)
>        at java.util.regex.Pattern.compile(Pattern.java:847)
>        at org.apache.hadoop.chukwa.util.Filter.<init>(Filter.java:94)
>        at org.apache.hadoop.chukwa.util.DumpChunks.dump(DumpChunks.java:88)
>        at org.apache.hadoop.chukwa.util.DumpChunks.main(DumpChunks.java:53)
> {code}
> After applying the supplied patch the output is:
> {code}
> Error parsing "tags" regular expression: Unclosed group near index 1
> (
>  ^
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CHUKWA-641) PatternSyntaxException Crash from Unvalidated Regular Expression Usage

Posted by "Eric Yang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CHUKWA-641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13271078#comment-13271078 ] 

Eric Yang commented on CHUKWA-641:
----------------------------------

Exception message is printed to stdout.  Should it be stderr?
                
> PatternSyntaxException Crash from Unvalidated Regular Expression Usage
> ----------------------------------------------------------------------
>
>                 Key: CHUKWA-641
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-641
>             Project: Chukwa
>          Issue Type: Bug
>    Affects Versions: 0.5.0
>            Reporter: Eric Spishak
>         Attachments: CHUKWA-641.patch
>
>
> Chukwa sometimes crashes with an unhelpful stack trace.  In particular, a PatternSyntaxException is thrown when an invalid regular expression is passed to the dumpChunk command. This exception isn't useful to users to diagnose the error. I think it would be better to report a detailed error message. The attached patch makes this change.
> Steps to reproduce:
> # Run 'bin/chukwa dumpChunk "tags.=(" file'
> # dumpChunk command fails to start
> # See exception:
> {code}
> Exception in thread "main" java.util.regex.PatternSyntaxException:
> Unclosed group near index 1
> (
>  ^
>        at java.util.regex.Pattern.error(Pattern.java:1713)
>        at java.util.regex.Pattern.accept(Pattern.java:1571)
>        at java.util.regex.Pattern.group0(Pattern.java:2533)
>        at java.util.regex.Pattern.sequence(Pattern.java:1806)
>        at java.util.regex.Pattern.expr(Pattern.java:1752)
>        at java.util.regex.Pattern.compile(Pattern.java:1460)
>        at java.util.regex.Pattern.<init>(Pattern.java:1133)
>        at java.util.regex.Pattern.compile(Pattern.java:847)
>        at org.apache.hadoop.chukwa.util.Filter.<init>(Filter.java:94)
>        at org.apache.hadoop.chukwa.util.DumpChunks.dump(DumpChunks.java:88)
>        at org.apache.hadoop.chukwa.util.DumpChunks.main(DumpChunks.java:53)
> {code}
> After applying the supplied patch the output is:
> {code}
> Error parsing "tags" regular expression: Unclosed group near index 1
> (
>  ^
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CHUKWA-641) PatternSyntaxException Crash from Unvalidated Regular Expression Usage

Posted by "Eric Yang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CHUKWA-641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Yang updated CHUKWA-641:
-----------------------------

    Status: Patch Available  (was: Open)
    
> PatternSyntaxException Crash from Unvalidated Regular Expression Usage
> ----------------------------------------------------------------------
>
>                 Key: CHUKWA-641
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-641
>             Project: Chukwa
>          Issue Type: Bug
>    Affects Versions: 0.5.0
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>         Attachments: CHUKWA-641.patch
>
>
> Chukwa sometimes crashes with an unhelpful stack trace.  In particular, a PatternSyntaxException is thrown when an invalid regular expression is passed to the dumpChunk command. This exception isn't useful to users to diagnose the error. I think it would be better to report a detailed error message. The attached patch makes this change.
> Steps to reproduce:
> # Run 'bin/chukwa dumpChunk "tags.=(" file'
> # dumpChunk command fails to start
> # See exception:
> {code}
> Exception in thread "main" java.util.regex.PatternSyntaxException:
> Unclosed group near index 1
> (
>  ^
>        at java.util.regex.Pattern.error(Pattern.java:1713)
>        at java.util.regex.Pattern.accept(Pattern.java:1571)
>        at java.util.regex.Pattern.group0(Pattern.java:2533)
>        at java.util.regex.Pattern.sequence(Pattern.java:1806)
>        at java.util.regex.Pattern.expr(Pattern.java:1752)
>        at java.util.regex.Pattern.compile(Pattern.java:1460)
>        at java.util.regex.Pattern.<init>(Pattern.java:1133)
>        at java.util.regex.Pattern.compile(Pattern.java:847)
>        at org.apache.hadoop.chukwa.util.Filter.<init>(Filter.java:94)
>        at org.apache.hadoop.chukwa.util.DumpChunks.dump(DumpChunks.java:88)
>        at org.apache.hadoop.chukwa.util.DumpChunks.main(DumpChunks.java:53)
> {code}
> After applying the supplied patch the output is:
> {code}
> Error parsing "tags" regular expression: Unclosed group near index 1
> (
>  ^
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CHUKWA-641) PatternSyntaxException Crash from Unvalidated Regular Expression Usage

Posted by "Eric Spishak (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CHUKWA-641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Spishak updated CHUKWA-641:
--------------------------------

    Attachment:     (was: CHUKWA-641.patch)
    
> PatternSyntaxException Crash from Unvalidated Regular Expression Usage
> ----------------------------------------------------------------------
>
>                 Key: CHUKWA-641
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-641
>             Project: Chukwa
>          Issue Type: Bug
>    Affects Versions: 0.5.0
>            Reporter: Eric Spishak
>         Attachments: CHUKWA-641.patch
>
>
> Chukwa sometimes crashes with an unhelpful stack trace.  In particular, a PatternSyntaxException is thrown when an invalid regular expression is passed to the dumpChunk command. This exception isn't useful to users to diagnose the error. I think it would be better to report a detailed error message. The attached patch makes this change.
> Steps to reproduce:
> # Run 'bin/chukwa dumpChunk "tags.=(" file'
> # dumpChunk command fails to start
> # See exception:
> {code}
> Exception in thread "main" java.util.regex.PatternSyntaxException:
> Unclosed group near index 1
> (
>  ^
>        at java.util.regex.Pattern.error(Pattern.java:1713)
>        at java.util.regex.Pattern.accept(Pattern.java:1571)
>        at java.util.regex.Pattern.group0(Pattern.java:2533)
>        at java.util.regex.Pattern.sequence(Pattern.java:1806)
>        at java.util.regex.Pattern.expr(Pattern.java:1752)
>        at java.util.regex.Pattern.compile(Pattern.java:1460)
>        at java.util.regex.Pattern.<init>(Pattern.java:1133)
>        at java.util.regex.Pattern.compile(Pattern.java:847)
>        at org.apache.hadoop.chukwa.util.Filter.<init>(Filter.java:94)
>        at org.apache.hadoop.chukwa.util.DumpChunks.dump(DumpChunks.java:88)
>        at org.apache.hadoop.chukwa.util.DumpChunks.main(DumpChunks.java:53)
> {code}
> After applying the supplied patch the output is:
> {code}
> Error parsing "tags" regular expression: Unclosed group near index 1
> (
>  ^
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CHUKWA-641) PatternSyntaxException Crash from Unvalidated Regular Expression Usage

Posted by "Eric Yang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CHUKWA-641?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Yang updated CHUKWA-641:
-----------------------------

    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

+1 Thanks Eric, I just committed this.
                
> PatternSyntaxException Crash from Unvalidated Regular Expression Usage
> ----------------------------------------------------------------------
>
>                 Key: CHUKWA-641
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-641
>             Project: Chukwa
>          Issue Type: Bug
>    Affects Versions: 0.5.0
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>         Attachments: CHUKWA-641.patch
>
>
> Chukwa sometimes crashes with an unhelpful stack trace.  In particular, a PatternSyntaxException is thrown when an invalid regular expression is passed to the dumpChunk command. This exception isn't useful to users to diagnose the error. I think it would be better to report a detailed error message. The attached patch makes this change.
> Steps to reproduce:
> # Run 'bin/chukwa dumpChunk "tags.=(" file'
> # dumpChunk command fails to start
> # See exception:
> {code}
> Exception in thread "main" java.util.regex.PatternSyntaxException:
> Unclosed group near index 1
> (
>  ^
>        at java.util.regex.Pattern.error(Pattern.java:1713)
>        at java.util.regex.Pattern.accept(Pattern.java:1571)
>        at java.util.regex.Pattern.group0(Pattern.java:2533)
>        at java.util.regex.Pattern.sequence(Pattern.java:1806)
>        at java.util.regex.Pattern.expr(Pattern.java:1752)
>        at java.util.regex.Pattern.compile(Pattern.java:1460)
>        at java.util.regex.Pattern.<init>(Pattern.java:1133)
>        at java.util.regex.Pattern.compile(Pattern.java:847)
>        at org.apache.hadoop.chukwa.util.Filter.<init>(Filter.java:94)
>        at org.apache.hadoop.chukwa.util.DumpChunks.dump(DumpChunks.java:88)
>        at org.apache.hadoop.chukwa.util.DumpChunks.main(DumpChunks.java:53)
> {code}
> After applying the supplied patch the output is:
> {code}
> Error parsing "tags" regular expression: Unclosed group near index 1
> (
>  ^
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira