usethesource / rascal-tutor

Markdown and Rascal processor that generates linked, up-to-date and checked documentation
BSD 2-Clause "Simplified" License
1 stars 1 forks source link

stackoverflow during pattern compilation #10

Closed jurgenvinju closed 1 year ago

jurgenvinju commented 1 year ago
[ERROR] Failed to execute goal org.rascalmpl:rascal-maven-plugin:0.12.3:tutor (default-cli) on project website: Execution default-cli of goal org.rascalmpl:rascal-maven-plugin:0.12.3:tutor failed: Stack overflow during pattern compilation near index 2
[ERROR] (?:(?<!\\)|(?<=\\\\))<([a-zA-Z0-9]+)(?:\s*:\s*((?:[^\\<>]|(?:\\[\\<>])|(?:\\)|(?:<[a-zA-Z0-9]+>))*))?>

This is on an input with many literal source locations (and so many \\\). Run mvn compile in rascal-website, branch local-courses to trigger the bug.

jurgenvinju commented 1 year ago

head of the stack trace:

java.lang.StackOverflowError
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
    at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
    at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:550)
    at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:458)
    at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:452)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:451)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:425)
    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
    at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:548)
    at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
    at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:782)
    at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:385)
    at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:326)
    at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:539)
    at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
    at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:782)
    at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:385)
    at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:326)
    at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:539)
    at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
    at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:782)
    at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:385)
    at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:326)
    at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:539)
    at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
    at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:782)
    at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:385)
    at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:326)
    at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:539)
    at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
    at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:782)
    at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:385)
    at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:326)
    at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:539)
    at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
    at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:782)
    at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:385)
    at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:326)
    at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:539)
    at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
    at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:782)
    at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:385)
    at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:326)
    at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:539)
    at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
    at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:782)
    at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:385)
    at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:326)
    at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:539)
    at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
    at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:782)
    at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:385)
    at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:326)
    at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:539)
    at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
    at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:782)
    at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.interpreter.result.RascalFunction.runBody(RascalFunction.java:385)
    at org.rascalmpl.interpreter.result.RascalFunction.call(RascalFunction.java:326)
    at org.rascalmpl.semantics.dynamic.Expression$CallOrTree.interpret(Expression.java:539)
    at org.rascalmpl.semantics.dynamic.Statement$Expression.interpret(Statement.java:365)
    at org.rascalmpl.semantics.dynamic.Statement$Return.interpret(Statement.java:782)
    at org.rascalmpl.semantics.dynamic.Statement$NonEmptyBlock.interpret(Statement.java:759)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.semantics.dynamic.Statement$IfThenElse.interpret(Statement.java:711)
    at org.rascalmpl.interpreter.result.RascalFunction.runBody(Ra
jurgenvinju commented 1 year ago

It was just a normal stackoverflow error during the execution of example code (fac(500)). Solved with -Xss256m

JJWTimmer commented 1 year ago

No java exception here in mvn compile, only these:

[INFO] Tutor is done, reporting errors now.
[ERROR]   Recipes.md:022:0: Ambiguous concept link: Recipes:Common resolves to all of these: /Recipes/demo/common/index.md /Recipes/Common/index.md
[ERROR]   Basic/Factorial/Factorial.md:063:0: Broken concept link: Patterns-Descandant
[ERROR]   Basic/Squares/Squares.md:051:0: Code execution failed
[ERROR]   Basic/Squares/Squares.md:056:0: Code execution failed
[ERROR]   Basic/Squares/Squares.md:063:0: Code execution failed
[ERROR]   Languages/Exp/Exp.md:031:0: Ambiguous concept link: Exp-Abstract resolves to all of these: /Recipes/demo/lang/Exp/Abstract/index.md /Recipes/Languages/Exp/Abstract/index.md
[ERROR]   Languages/Exp/Exp.md:032:0: Ambiguous concept link: Exp-Concrete resolves to all of these: /Recipes/demo/lang/Exp/Concrete/index.md /Recipes/Languages/Exp/Concrete/index.md
[ERROR]   Languages/Exp/Exp.md:033:0: Ambiguous concept link: Exp-Combined resolves to all of these: /Recipes/demo/lang/Exp/Combined/index.md /Recipes/Languages/Exp/Combined/index.md
[ERROR]   Languages/Exp/Exp.md:037:0: Ambiguous concept link: Exp resolves to all of these: /Recipes/demo/common/Derivative.md#demo-common-Derivative-Exp /Recipes/demo/lang/Exp/Abstract/Syntax.md#demo-lang-Exp-Abstract-Syntax-Exp /Recipes/Languages/Exp/index.md /Library/lang/rascal/tests/functionality/DataDeclaration.md#lang-rascal-tests-functionality-DataDeclaration-Exp /Recipes/demo/Mod17.md#demo-Mod17-Exp /Recipes/demo/lang/Func/AST.md#demo-lang-Func-AST-Exp /Library/lang/oil/Main.md#lang-oil-Main-Exp /Library/lang/rascal/tests/basic/SolvedIssues.md#lang-rascal-tests-basic-SolvedIssues-Exp /Recipes/demo/lang/Exp/index.md /Library/lang/rascal/\syntax/tests/ImplodeTests.md#lang-rascal-\syntax-tests-ImplodeTests-Exp
[ERROR]   Languages/Exp/Combined/Combined.md:026:0: Ambiguous concept link: Manual resolves to all of these: /Recipes/Languages/Exp/Combined/Manual/index.md /Recipes/demo/lang/Exp/Combined/Manual/index.md

[ERROR]   Languages/Exp/Combined/Combined.md:027:0: Ambiguous concept link: Automatic resolves to all of these: /Recipes/demo/lang/Exp/Combined/Automatic/index.md /Recipes/Languages/Exp/Combined/Automatic/index.md
[ERROR]   Languages/Exp/Combined/Automatic/Automatic.md:066:0: Ambiguous concept link: Exp-Abstract resolves to all of these: /Recipes/demo/lang/Exp/Abstract/index.md /Recipes/Languages/Exp/Abstract/index.md
[ERROR]   Languages/Exp/Concrete/Concrete.md:020:0: Ambiguous concept link: NoLayout resolves to all of these: /Recipes/Languages/Exp/Concrete/NoLayout/index.md /Recipes/demo/lang/Exp/Concrete/NoLayout/index.md
[ERROR]   Languages/Exp/Concrete/Concrete.md:021:0: Ambiguous concept link: WithLayout resolves to all of these: /Recipes/Languages/Exp/Concrete/WithLayout/index.md /Recipes/demo/lang/Exp/Concrete/WithLayout/index.md
ore
[WARNING] Languages/Pico/UseDef/UseDef.md:029:0: TODO: : should we not use locations more directly in our examples?
[ERROR]   Markup/SourceCodeMarkup/DocAnnotations/DocAnnotations.md:140:0: Code execution failed
[ERROR] More than zero errors!
jurgenvinju commented 1 year ago

I have the suspicion that the JVM on windows can scale up its stack size on demand while the JVM on Mac can't.