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

preserve-line-breaks causes StackOverFlow when consumed 2000 empty lines. #101

Open
GoogleCodeExporter opened this issue Aug 20, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. yes "" | head -n2000 > manylines
2. java -jar Downloads\htmlcompressor-1.5.3.jar --preserve-line-breaks manylines
3. crashes by StackOverFlow exception

What is the expected output? What do you see instead?
expected output is compressed html
instead I see fatal error.

What version of the product are you using? On what operating system?
htmlcompressor 1.5.3

java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

Windows 8.1 64bit

Please provide any additional information below.
I attached full stack trace by adding -XX:MaxJavaStackTraceDepth=1000000 option.

I think the last quantifier of lineBreakPattern in HtmlCompressor.java should 
use '++' instead of '+'.

Original issue reported on code.google.com by Hideki.Y...@gmail.com on 31 Jan 2015 at 12:11

Attachments:

@GoogleCodeExporter
Copy link
Author

Hi, 

I'm also running into this error on 1.5.2. Setting --preserve-line-breaks to 
false doesn't fix it, and neither does manually stripping out newlines in the 
html before running it through the compressor.

Original comment by g.sas...@gmail.com on 7 Apr 2015 at 12:52

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

No branches or pull requests

1 participant