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/13 00:40:47 UTC

[jira] [Created] (CHUKWA-642) Unvalidated Regular Expression Usage

Eric Spishak created CHUKWA-642:
-----------------------------------

             Summary: Unvalidated Regular Expression Usage
                 Key: CHUKWA-642
                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
             Project: Chukwa
          Issue Type: Bug
            Reporter: Eric Spishak
         Attachments: CHUKWA-642.patch

There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.

The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.

I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
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-642) Unvalidated Regular Expression Usage

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

Eric Spishak updated CHUKWA-642:
--------------------------------

    Attachment: CHUKWA-642-1.patch
    
> Unvalidated Regular Expression Usage
> ------------------------------------
>
>                 Key: CHUKWA-642
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
>             Project: Chukwa
>          Issue Type: Bug
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>         Attachments: CHUKWA-642-1.patch, CHUKWA-642.patch
>
>
> There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.
> The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.
> I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CHUKWA-642) Unvalidated Regular Expression Usage

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

Eric Yang commented on CHUKWA-642:
----------------------------------

TableCreator.java, DataExpiration.java and MetricDataLoader.java are legacy artifact, and should be removed in Chukwa 0.6.0.  It is fine that this patch does not modify those files.  The patch should be fine as it is.  I will commit this week, if there is no objection.

                
> Unvalidated Regular Expression Usage
> ------------------------------------
>
>                 Key: CHUKWA-642
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
>             Project: Chukwa
>          Issue Type: Bug
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>         Attachments: CHUKWA-642-1.patch, CHUKWA-642-2.patch, CHUKWA-642.patch
>
>
> There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.
> The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.
> I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CHUKWA-642) Unvalidated Regular Expression Usage

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

Eric Spishak commented on CHUKWA-642:
-------------------------------------

Hi Eric, thanks for getting back to me. There's actually 7 bugs here. Would you like me to add a unit test for each of these? Or an end-to-end test case (for example, a command on the command line that generates a crash) for each?
                
> Unvalidated Regular Expression Usage
> ------------------------------------
>
>                 Key: CHUKWA-642
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
>             Project: Chukwa
>          Issue Type: Bug
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>         Attachments: CHUKWA-642-1.patch, CHUKWA-642.patch
>
>
> There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.
> The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.
> I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CHUKWA-642) Unvalidated Regular Expression Usage

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

Eric Yang updated CHUKWA-642:
-----------------------------

          Component/s: MR Data Processors
                       Data Collection
                       Build and Test Code
    Affects Version/s: 0.3.0
                       0.4.0
                       0.5.0
        Fix Version/s: 0.6.0
    
> Unvalidated Regular Expression Usage
> ------------------------------------
>
>                 Key: CHUKWA-642
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
>             Project: Chukwa
>          Issue Type: Bug
>          Components: Build and Test Code, Data Collection, MR Data Processors
>    Affects Versions: 0.3.0, 0.4.0, 0.5.0
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>             Fix For: 0.6.0
>
>         Attachments: CHUKWA-642-1.patch, CHUKWA-642-2.patch, CHUKWA-642.patch
>
>
> There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.
> The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.
> I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CHUKWA-642) Unvalidated Regular Expression Usage

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

Eric Yang updated CHUKWA-642:
-----------------------------

    Status: Patch Available  (was: Open)
    
> Unvalidated Regular Expression Usage
> ------------------------------------
>
>                 Key: CHUKWA-642
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
>             Project: Chukwa
>          Issue Type: Bug
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>         Attachments: CHUKWA-642-1.patch, CHUKWA-642-2.patch, CHUKWA-642.patch
>
>
> There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.
> The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.
> I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CHUKWA-642) Unvalidated Regular Expression Usage

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

Eric Spishak updated CHUKWA-642:
--------------------------------

    Attachment: CHUKWA-642-1.patch
    
> Unvalidated Regular Expression Usage
> ------------------------------------
>
>                 Key: CHUKWA-642
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
>             Project: Chukwa
>          Issue Type: Bug
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>         Attachments: CHUKWA-642-1.patch, CHUKWA-642.patch
>
>
> There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.
> The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.
> I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CHUKWA-642) Unvalidated Regular Expression Usage

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

Hudson commented on CHUKWA-642:
-------------------------------

Integrated in Chukwa-trunk #460 (See [https://builds.apache.org/job/Chukwa-trunk/460/])
    CHUKWA-642. Added regular expression validation. (Eric Spishak via Eric Yang) (Revision 1411833)
CHUKWA-642. Added regular expression validation. (Eric Spishak via Eric Yang) (Revision 1411813)

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

eyang : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1411813
Files : 
* /incubator/chukwa/trunk/CHANGES.txt
* /incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/database/DataExpiration.java
* /incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/database/TableCreator.java
* /incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/datacollection/writer/SocketTeeWriter.java
* /incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java
* /incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TsProcessor.java
* /incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/inputtools/ChukwaInputFormat.java
* /incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/util/DumpChunks.java
* /incubator/chukwa/trunk/src/main/java/org/apache/hadoop/chukwa/util/Filter.java
* /incubator/chukwa/trunk/src/test/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/TestTsProcessor.java
* /incubator/chukwa/trunk/src/test/java/org/apache/hadoop/chukwa/inputtools/TestInputFormat.java
* /incubator/chukwa/trunk/src/test/java/org/apache/hadoop/chukwa/util/TestDumpChunks.java
* /incubator/chukwa/trunk/src/test/java/org/apache/hadoop/chukwa/util/TestFilter.java

                
> Unvalidated Regular Expression Usage
> ------------------------------------
>
>                 Key: CHUKWA-642
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
>             Project: Chukwa
>          Issue Type: Bug
>          Components: Build and Test Code, Data Collection, MR Data Processors
>    Affects Versions: 0.3.0, 0.4.0, 0.5.0
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>             Fix For: 0.6.0
>
>         Attachments: CHUKWA-642-1.patch, CHUKWA-642-2.patch, CHUKWA-642.patch
>
>
> There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.
> The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.
> I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (CHUKWA-642) Unvalidated Regular Expression Usage

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

Eric Yang reassigned CHUKWA-642:
--------------------------------

    Assignee: Eric Spishak
    
> Unvalidated Regular Expression Usage
> ------------------------------------
>
>                 Key: CHUKWA-642
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
>             Project: Chukwa
>          Issue Type: Bug
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>         Attachments: CHUKWA-642.patch
>
>
> There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.
> The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.
> I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
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-642) Unvalidated Regular Expression Usage

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

Eric Spishak updated CHUKWA-642:
--------------------------------

    Attachment: CHUKWA-642.patch
    
> Unvalidated Regular Expression Usage
> ------------------------------------
>
>                 Key: CHUKWA-642
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
>             Project: Chukwa
>          Issue Type: Bug
>            Reporter: Eric Spishak
>         Attachments: CHUKWA-642.patch
>
>
> There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.
> The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.
> I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
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-642) Unvalidated Regular Expression Usage

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

Eric Yang commented on CHUKWA-642:
----------------------------------

Could you add a test case?  Thanks
                
> Unvalidated Regular Expression Usage
> ------------------------------------
>
>                 Key: CHUKWA-642
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
>             Project: Chukwa
>          Issue Type: Bug
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>         Attachments: CHUKWA-642-1.patch, CHUKWA-642.patch
>
>
> There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.
> The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.
> I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CHUKWA-642) Unvalidated Regular Expression Usage

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

Eric Yang commented on CHUKWA-642:
----------------------------------

Unit test case for each of the 7 bugs would help.  Thanks
                
> Unvalidated Regular Expression Usage
> ------------------------------------
>
>                 Key: CHUKWA-642
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
>             Project: Chukwa
>          Issue Type: Bug
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>         Attachments: CHUKWA-642-1.patch, CHUKWA-642.patch
>
>
> There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.
> The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.
> I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CHUKWA-642) Unvalidated Regular Expression Usage

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

Eric Spishak commented on CHUKWA-642:
-------------------------------------

I just attached a new patch with unit tests added.

I was not able to add tests for the changes in org/apache/hadoop/chukwa/database/TableCreator.java, org/apache/hadoop/chukwa/database/DataExpiration.java and org/apache/hadoop/chukwa/dataloader/MetricDataLoader.java because these rely on the existence of a jdbc.conf file, which does not come with Chukwa. I also noticed that the tests for these classes were excluded from the Maven test task.

And I was not able to add tests for org/apache/hadoop/chukwa/datacollection/writer/SocketTeeWriter.java because the modified code runs in a different thread than the test, so I had trouble figuring out how to verify the correct behavior.

If you have suggestions for how to get around these problems I will gladly add additional test cases.
                
> Unvalidated Regular Expression Usage
> ------------------------------------
>
>                 Key: CHUKWA-642
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
>             Project: Chukwa
>          Issue Type: Bug
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>         Attachments: CHUKWA-642-1.patch, CHUKWA-642-2.patch, CHUKWA-642.patch
>
>
> There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.
> The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.
> I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CHUKWA-642) Unvalidated Regular Expression Usage

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

Eric Spishak commented on CHUKWA-642:
-------------------------------------

Sorry about the delay in getting back to you. I've updated the patch to handle errors more nicely. Please let me know if I should make any more changes.
                
> Unvalidated Regular Expression Usage
> ------------------------------------
>
>                 Key: CHUKWA-642
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
>             Project: Chukwa
>          Issue Type: Bug
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>         Attachments: CHUKWA-642-1.patch, CHUKWA-642.patch
>
>
> There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.
> The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.
> I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CHUKWA-642) Unvalidated Regular Expression Usage

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

Eric Spishak updated CHUKWA-642:
--------------------------------

    Attachment: CHUKWA-642-2.patch
    
> Unvalidated Regular Expression Usage
> ------------------------------------
>
>                 Key: CHUKWA-642
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
>             Project: Chukwa
>          Issue Type: Bug
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>         Attachments: CHUKWA-642-1.patch, CHUKWA-642-2.patch, CHUKWA-642.patch
>
>
> There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.
> The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.
> I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CHUKWA-642) Unvalidated Regular Expression Usage

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

Eric Yang updated CHUKWA-642:
-----------------------------

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

I just committed this, thanks Eric.
                
> Unvalidated Regular Expression Usage
> ------------------------------------
>
>                 Key: CHUKWA-642
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
>             Project: Chukwa
>          Issue Type: Bug
>          Components: Build and Test Code, Data Collection, MR Data Processors
>    Affects Versions: 0.3.0, 0.4.0, 0.5.0
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>             Fix For: 0.6.0
>
>         Attachments: CHUKWA-642-1.patch, CHUKWA-642-2.patch, CHUKWA-642.patch
>
>
> There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.
> The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.
> I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CHUKWA-642) Unvalidated Regular Expression Usage

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

Eric Spishak updated CHUKWA-642:
--------------------------------

    Attachment:     (was: CHUKWA-642-1.patch)
    
> Unvalidated Regular Expression Usage
> ------------------------------------
>
>                 Key: CHUKWA-642
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
>             Project: Chukwa
>          Issue Type: Bug
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>         Attachments: CHUKWA-642-1.patch, CHUKWA-642.patch
>
>
> There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.
> The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.
> I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CHUKWA-642) Unvalidated Regular Expression Usage

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

Eric Yang commented on CHUKWA-642:
----------------------------------

It might be too harsh to call System.exit on regular expression errors.  It would be nice if the logging is changed to warning, and skip to next operation.
                
> Unvalidated Regular Expression Usage
> ------------------------------------
>
>                 Key: CHUKWA-642
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-642
>             Project: Chukwa
>          Issue Type: Bug
>            Reporter: Eric Spishak
>            Assignee: Eric Spishak
>         Attachments: CHUKWA-642.patch
>
>
> There are seven additional places in Chukwa where regular expressions are used without first being validated as syntactically valid regular expressions. These could lead to unhelpful PatternSyntaxException strack traces instead of useful error messages. Unfortunately, I was not able to produce test conditions to highlight any of these issues.
> The attached patch fixes the issues. Note that the patch adds a small RegexUtil class with helper methods to determine whether a String is a valid regular expression and to generate error messages for invalid regular expressions. I feel that these helper methods are more readable than catching the PatternSyntaxException. Furthermore, they allow simpler re-use if needed elsewhere.
> I discovered these bugs using a tool named the Regex Checker ([http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#regex-checker]). If you periodically run it on your codebase, then you will learn of other errors like this as soon as they appear.  If you are interested, I can share my annotations for Chukwa, which will enable you to run the Regex Checker yourself without any additional effort.

--
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