Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building the executable jar package fails on intersectingRepetitions(org.saferegex.RegexTesterTest) #2

Open
sakura26 opened this issue Mar 27, 2020 · 3 comments

Comments

@sakura26
Copy link

Package build failed with error message below,
both Beta and Release version have this issue

OS: Ubuntu 16.04.6 LTS 64bit
Java: OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src)
command: $ ./mvnw clean package
result:

Results :

Failed tests:   intersectingRepetitions(org.saferegex.RegexTesterTest)

Tests run: 113, Failures: 1, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28:01 min
[INFO] Finished at: 2020-03-26T17:45:48+08:00
[INFO] Final Memory: 21M/72M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project saferegex: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/s2/saferegex/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
@sakura26
Copy link
Author

complete command output

$ ./mvnw clean package
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 1 modules...
[INFO] Installing Nexus Staging features:
[INFO]   ... total of 1 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building saferegex 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ saferegex ---
[INFO] Deleting /home/s2/saferegex/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ saferegex ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/s2/saferegex/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ saferegex ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 51 source files to /home/s2/saferegex/target/classes
[INFO] /home/s2/saferegex/src/main/java/org/apache/regexp/RE.java: Some input files use unchecked or unsafe operations.
[INFO] /home/s2/saferegex/src/main/java/org/apache/regexp/RE.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ saferegex ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /home/s2/saferegex/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ saferegex ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 20 source files to /home/s2/saferegex/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ saferegex ---
[INFO] Surefire report directory: /home/s2/saferegex/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.regexp.ReDoSTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.022 sec
Running org.saferegex.RegexTesterTest

Testing: (ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.a-zA-Z_]*[0-9a-zA-Z])*(:(0-9)*)?(\/?)([a-zA-Z0-9\-\.\?\,\:\'\/\\\+=&%\$#_]*)?
More than 10000 samples found.
*****************************************************************************************************************************************************************************************************************************************************************************************************************************************
Tests: 3297
Broken samples: 0
This expression is probably not vulnerable for sample sizes < 10000

Testing: a*[ab]*O
More than 10000 samples found.
******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
Tests: 6668
Broken samples: 0
This expression is probably not vulnerable for sample sizes < 10000

Testing: [a-z]+@[a-z]+([a-z\.]+\.)+[a-z]+
16 samples found.
************************************************************
This expression is vulnerable.
Sample input: kkkkkkkkkkkkkkkkkkkkkkkk@kkkkkkkkkkkkkkkkkkkkkkkk........................kkkkkkkkkkkkkkkkkkkkkkkk{

Testing: ^([a-z0-9]+([\-a-z0-9]*[a-z0-9]+)?\.){0,}([a-z0-9]+([\-a-z0-9]*[a-z0-9]+)?){1,63}(\.[a-z0-9]{2,7})+$
More than 10000 samples found.
***********
This expression is vulnerable.
Sample input: 3333zzz3333.eeeeaaaaeeee.eeeee{

Testing: ^\d*[0-9](|.\d*[0-9]|)*$
More than 10000 samples found.
***************
This expression is vulnerable.
Sample input: 0000000000000000189999999999999990a

Testing: ^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*\s+&lt;(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})&gt;$|^(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})$
More than 10000 samples found.
************************************
This expression is vulnerable.
Sample input: BBBBBBBB-szzzzzzz                                                                          &lt;[email protected]&gt;{

Testing: ab|c
2 samples found.

Tests: 2
Broken samples: 0
This expression is not vulnerable.

Testing: (a|a?)+
More than 10000 samples found.
*******
This expression is vulnerable.
Sample input: aaaaaaaaaaaaaaaaaaaaaaaab

Testing: (a|aa)*
More than 10000 samples found.
***
This expression is vulnerable.
Sample input: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab

Testing: (a+)+
More than 10000 samples found.
**
This expression is vulnerable.
Sample input: aaaaaaaaaaaaaaaaaaaaaaaaaab

Testing: ([a-zA-Z]+)*
More than 10000 samples found.
*****************************************************************************************************************************
This expression is vulnerable.
Sample input: AAAAAAAAAAAAAAAAAAAAAAAAA{

Testing: (.*a){12}
0 samples found.
*******************
This expression is vulnerable.
Sample input: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Testing: abc
This expression is not vulnerable.

Testing: [abc]
This expression is not vulnerable.

Testing: abc|def
2 samples found.

Tests: 2
Broken samples: 0
This expression is not vulnerable.

Testing: ^[.a-zA-Z_ ]{0,30}$
30 samples found.
*********************************************************************************************************************************************************************
Tests: 1651
Broken samples: 0
This expression is not vulnerable.

Testing: ^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$
386 samples found.
**********************************
Tests: 346
Broken samples: 6
This expression is not vulnerable.

Testing: ^(\d{4}[- ]?){3}\d{4}$
0 samples found.
***
Tests: 30
Broken samples: 0
This expression is not vulnerable.

Testing: ^([0-6]\d{2}|7([0-6]\d|7[012]))([ \-]?)\d\d([ \-]?)\d{4}$
65707 samples found.
**********************************************************************************************************************************************************************************************************************************
Tests: 2260
Broken samples: 70
This expression is not vulnerable.

Testing: (([a-z])+.)+[A-Z]([a-z])+
104 samples found.
********************************************
This expression is vulnerable.
Sample input: bbbbbbbbbbbbbbbbbbaBbbbbbbbbbbbbbbbbbb{

Testing: ^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*$
More than 10000 samples found.
*********************************************************
This expression is vulnerable.
Sample input: CCCCCCCCCCCC'oAAAAAAAAAAAA{

Testing: ([a-zA-Z0-9])(([\-.]|[_]+)?([a-zA-Z0-9]+))*(@){1}[a-z0-9]+[.]{1}(([a-z]{2,3})|([a-z]{2,3}[.]{1}[a-z]{2,3}))
More than 10000 samples found.
****************************************************************************************************************************
This expression is vulnerable.
Sample input: 1______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________000000000000000000000@qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq.ttt.ttt{
Tests run: 8, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1,546.139 sec <<< FAILURE!
intersectingRepetitions(org.saferegex.RegexTesterTest)  Time elapsed: 1,358.802 sec  <<< FAILURE!
java.lang.AssertionError
	at org.junit.Assert.fail(Assert.java:86)
	at org.junit.Assert.assertTrue(Assert.java:41)
	at org.junit.Assert.assertTrue(Assert.java:52)
	at org.saferegex.RegexTesterTest.intersectingRepetitions(RegexTesterTest.java:31)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:531)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:531)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Running org.saferegex.parser.RepetitionTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec
Running org.saferegex.parser.OptionAndGroupTest
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec
Running org.saferegex.parser.CharacterClassTest
Tests run: 16, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.019 sec
Running org.saferegex.parser.AtomTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Running org.saferegex.expressions.RepetitionTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec
Running org.saferegex.expressions.OptionalTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
Running org.saferegex.expressions.SequenceTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec
Running org.saferegex.expressions.CharacterClassTest
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec
Running org.saferegex.expressions.OptionTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Running org.saferegex.expressions.AtomTest
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Running org.saferegex.samples.SampleHashSetTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
Running org.saferegex.samples.ExhaustiveVaryingRepetitionTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
Running org.saferegex.samples.AtomSamplesTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Running org.saferegex.samples.CharacterSamplesTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Running org.saferegex.samples.ExhaustiveFixedRepetitionTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
Running org.saferegex.samples.LazySamplingStrategyTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec

Results :

Failed tests:   intersectingRepetitions(org.saferegex.RegexTesterTest)

Tests run: 113, Failures: 1, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25:50 min
[INFO] Finished at: 2020-03-26T19:39:47+08:00
[INFO] Final Memory: 18M/60M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project saferegex: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/s2/saferegex/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

@sakura26
Copy link
Author

~/saferegex/target/surefire-reports$ cat org.saferegex.RegexTesterTest.txt
-------------------------------------------------------------------------------
Test set: org.saferegex.RegexTesterTest
-------------------------------------------------------------------------------
Tests run: 8, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1,546.139 sec <<< FAILURE!
intersectingRepetitions(org.saferegex.RegexTesterTest)  Time elapsed: 1,358.802 sec  <<< FAILURE!
java.lang.AssertionError
	at org.junit.Assert.fail(Assert.java:86)
	at org.junit.Assert.assertTrue(Assert.java:41)
	at org.junit.Assert.assertTrue(Assert.java:52)
	at org.saferegex.RegexTesterTest.intersectingRepetitions(RegexTesterTest.java:31)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:531)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:531)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

@drod3763
Copy link

drod3763 commented Apr 2, 2020

Same here. Using OpenJDK 13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants