Closed rhysd closed 6 years ago
Hello @rhysd. Thank you very much for the detailed report on the crash 🙏 I will fix this issue.
I encountered this when writing a CI badge as following:
[![Mac and Linux Build Status][]][Travis CI]
<!-- snip... -->
[Mac and Linux Build Status]: https://travis-ci.org/rhysd/github-clone-all.svg?branch=master
[Travis CI]: https://travis-ci.org/rhysd/github-clone-all
And this does not occur with v1.9.0
I succeeded to reproduce the problem in my environments thanks to your report 🙏
➜ redpen git:(master) redpen -r json ~/tmp/foo.md
[2017-12-13 23:31:47.920][INFO ] cc.redpen.Main - Configuration file: /opt/brew/Cellar/redpen/1.10.0/libexec/conf/redpen-conf-en.xml
[2017-12-13 23:31:47.926][INFO ] cc.redpen.config.ConfigurationLoader - Loading config from specified config file: "/opt/brew/Cellar/redpen/1.10.0/libexec/conf/redpen-conf-en.xml"
[2017-12-13 23:31:47.945][INFO ] cc.redpen.config.ConfigurationLoader - Succeeded to load configuration file
[2017-12-13 23:31:47.945][INFO ] cc.redpen.config.ConfigurationLoader - Language is set to "en"
[2017-12-13 23:31:47.945][WARN ] cc.redpen.config.ConfigurationLoader - No variant configuration...
[2017-12-13 23:31:47.948][INFO ] cc.redpen.config.ConfigurationLoader - No "symbols" block found in the configuration
[2017-12-13 23:31:47.952][INFO ] cc.redpen.config.SymbolTable - Default symbol settings are loaded
[2017-12-13 23:31:47.959][INFO ] cc.redpen.parser.SentenceExtractor - "[., ?, !]" are added as a end of sentence characters
[2017-12-13 23:31:47.960][INFO ] cc.redpen.parser.SentenceExtractor - "[', "]" are added as a right quotation characters
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.parboiled.transform.AsmUtils (file:/opt/brew/Cellar/redpen/1.10.0/libexec/lib/parboiled-java-1.1.7.jar) to method java.lang.ClassLoader.findLoadedClass(java.lang.String)
WARNING: Please consider reporting this to the maintainers of org.parboiled.transform.AsmUtils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index -1 out-of-bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.base/java.util.Objects.checkIndex(Objects.java:372)
at java.base/java.util.ArrayList.get(ArrayList.java:440)
at cc.redpen.parser.markdown.ToFileContentSerializer.visit(ToFileContentSerializer.java:412)
at org.pegdown.ast.RefLinkNode.accept(RefLinkNode.java:33)
at cc.redpen.parser.markdown.ToFileContentSerializer.visitChildren(ToFileContentSerializer.java:74)
at cc.redpen.parser.markdown.ToFileContentSerializer.visit(ToFileContentSerializer.java:452)
at org.pegdown.ast.SuperNode.accept(SuperNode.java:43)
at cc.redpen.parser.markdown.ToFileContentSerializer.visitChildren(ToFileContentSerializer.java:74)
at cc.redpen.parser.markdown.ToFileContentSerializer.visit(ToFileContentSerializer.java:300)
at org.pegdown.ast.ParaNode.accept(ParaNode.java:35)
at cc.redpen.parser.markdown.ToFileContentSerializer.visitChildren(ToFileContentSerializer.java:74)
at cc.redpen.parser.markdown.ToFileContentSerializer.visit(ToFileContentSerializer.java:315)
at org.pegdown.ast.RootNode.accept(RootNode.java:51)
at cc.redpen.parser.markdown.ToFileContentSerializer.toFileContent(ToFileContentSerializer.java:90)
at cc.redpen.parser.MarkdownParser.parse(MarkdownParser.java:79)
at cc.redpen.parser.BaseDocumentParser.parse(BaseDocumentParser.java:58)
at cc.redpen.RedPen.parse(RedPen.java:131)
at cc.redpen.Main.getDocuments(Main.java:221)
at cc.redpen.Main.run(Main.java:196)
at cc.redpen.Main.main(Main.java:60)
Very sorry for making you wait. I made the hot fix for this problem in #818 Hopefully this fix work for your environment.
Hello @rhysd, I fix this issue since I confirmed the hotfix in #818 works. Please reopen this issue or create another one when you face the same problem.
I will release the new version of RedPen containing this hotfix soon.
I made the release containing the hotfix https://github.com/redpen-cc/redpen/releases/tag/redpen-1.10.1. The release is also applied to Homebrew at pr https://github.com/Homebrew/homebrew-core/pull/21759.
After upgrading redpen via Homebrew, it backs to work fine now. Thank you for your quick fix :+1:
How to repro
Save above doc as
tmp.md
and runredpen -r json tmp.md
Log
Environment
OS
macOS 10.12
redpen
v1.10.0 (installed via
brew install
)Java