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

fansi fails with IllegalArgumentException #11526

Closed
Akirathan opened this issue Nov 11, 2024 · 1 comment · Fixed by #11662
Closed

fansi fails with IllegalArgumentException #11526

Akirathan opened this issue Nov 11, 2024 · 1 comment · Fixed by #11662
Assignees
Labels

Comments

@Akirathan
Copy link
Member

Running the following code:

foreign js js_date = """
    return new Date();
"""

fails with:

Exception in thread "main" org.graalvm.polyglot.PolyglotException: java.lang.IllegalArgumentException: requirement failed: end:4 must be less than or equal to length:3
	at [email protected]/scala.Predef$.require(Predef.scala:337)
	at org.enso.fansi.wrapper/fansi.Str.$anonfun$overlayAll$2(Fansi.scala:187)
	at org.enso.fansi.wrapper/fansi.Str.$anonfun$overlayAll$2$adapted(Fansi.scala:179)
	at [email protected]/scala.collection.IterableOnceOps.foreach(IterableOnce.scala:576)
	at [email protected]/scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:574)
	at [email protected]/scala.collection.AbstractIterable.foreach(Iterable.scala:933)
	at [email protected]/scala.collection.IterableOps$WithFilter.foreach(Iterable.scala:903)
	at org.enso.fansi.wrapper/fansi.Str.overlayAll(Fansi.scala:179)
	at org.enso.fansi.wrapper/fansi.Str.overlay(Fansi.scala:167)
	at org.enso.runtime/org.enso.interpreter.runtime.util.DiagnosticFormatter.oneLineFromSourceColored(DiagnosticFormatter.scala:174)
	at org.enso.runtime/org.enso.interpreter.runtime.util.DiagnosticFormatter.textAndLocation(DiagnosticFormatter.scala:86)
	at org.enso.runtime/org.enso.interpreter.runtime.util.DiagnosticFormatter.both$lzycompute(DiagnosticFormatter.scala:31)
	at org.enso.runtime/org.enso.interpreter.runtime.util.DiagnosticFormatter.both(DiagnosticFormatter.scala:31)
	at org.enso.runtime/org.enso.interpreter.runtime.util.DiagnosticFormatter.format(DiagnosticFormatter.scala:33)
	at org.enso.runtime/org.enso.interpreter.runtime.TruffleCompilerContext.formatDiagnostic(TruffleCompilerContext.java:304)
	at org.enso.runtime/org.enso.interpreter.runtime.TruffleCompilerContext.formatDiagnostic(TruffleCompilerContext.java:53)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.$anonfun$reportDiagnostics$2(Compiler.scala:983)
	at [email protected]/scala.collection.immutable.List.flatMap(List.scala:293)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.reportDiagnostics(Compiler.scala:981)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.$anonfun$reportDiagnostics$1(Compiler.scala:961)
	at [email protected]/scala.collection.immutable.List.flatMap(List.scala:293)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.reportDiagnostics(Compiler.scala:959)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.runErrorHandling(Compiler.scala:865)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.runCompilerPipeline(Compiler.scala:361)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.go$1(Compiler.scala:229)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.runInternal(Compiler.scala:236)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.run(Compiler.scala:127)
	at org.enso.runtime/org.enso.interpreter.runtime.Module.compile(Module.java:418)
	at org.enso.runtime/org.enso.interpreter.runtime.Module.compileScope(Module.java:354)
	at org.enso.runtime/org.enso.interpreter.node.ProgramRootNode.execute(ProgramRootNode.java:73)
	at <enso> null(Unknown)
	at org.graalvm.polyglot/org.graalvm.polyglot.Context.eval(Context.java:402)
	at org.enso.polyglot.api/org.enso.polyglot.PolyglotContext.evalModule(PolyglotContext.scala:32)
	at org.enso.runner/org.enso.runner.Main.runSingleFile(Main.java:862)
	at org.enso.runner/org.enso.runner.Main.handleRun(Main.java:759)
	at org.enso.runner/org.enso.runner.Main.mainEntry(Main.java:1135)
	at org.enso.runner/org.enso.runner.Main.lambda$launch$22(Main.java:1479)
	at org.enso.runner/org.enso.runner.Main.withProfiling(Main.java:1225)
	at org.enso.runner/org.enso.runner.Main.launch(Main.java:1475)
	at org.enso.runner/org.enso.runner.Main.launch(Main.java:1426)
	at org.enso.runner/org.enso.runner.Main.main(Main.java:1041)
Original Internal Error: 
java.lang.IllegalArgumentException: requirement failed: end:4 must be less than or equal to length:3
	at [email protected]/scala.Predef$.require(Predef.scala:337)
	at org.enso.fansi.wrapper/fansi.Str.$anonfun$overlayAll$2(Fansi.scala:187)
	at org.enso.fansi.wrapper/fansi.Str.$anonfun$overlayAll$2$adapted(Fansi.scala:179)
	at [email protected]/scala.collection.IterableOnceOps.foreach(IterableOnce.scala:576)
	at [email protected]/scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:574)
	at [email protected]/scala.collection.AbstractIterable.foreach(Iterable.scala:933)
	at [email protected]/scala.collection.IterableOps$WithFilter.foreach(Iterable.scala:903)
	at org.enso.fansi.wrapper/fansi.Str.overlayAll(Fansi.scala:179)
	at org.enso.fansi.wrapper/fansi.Str.overlay(Fansi.scala:167)
	at org.enso.runtime/org.enso.interpreter.runtime.util.DiagnosticFormatter.oneLineFromSourceColored(DiagnosticFormatter.scala:174)
	at org.enso.runtime/org.enso.interpreter.runtime.util.DiagnosticFormatter.textAndLocation(DiagnosticFormatter.scala:86)
	at org.enso.runtime/org.enso.interpreter.runtime.util.DiagnosticFormatter.both$lzycompute(DiagnosticFormatter.scala:31)
	at org.enso.runtime/org.enso.interpreter.runtime.util.DiagnosticFormatter.both(DiagnosticFormatter.scala:31)
	at org.enso.runtime/org.enso.interpreter.runtime.util.DiagnosticFormatter.format(DiagnosticFormatter.scala:33)
	at org.enso.runtime/org.enso.interpreter.runtime.TruffleCompilerContext.formatDiagnostic(TruffleCompilerContext.java:304)
	at org.enso.runtime/org.enso.interpreter.runtime.TruffleCompilerContext.formatDiagnostic(TruffleCompilerContext.java:53)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.$anonfun$reportDiagnostics$2(Compiler.scala:983)
	at [email protected]/scala.collection.immutable.List.flatMap(List.scala:293)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.reportDiagnostics(Compiler.scala:981)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.$anonfun$reportDiagnostics$1(Compiler.scala:961)
	at [email protected]/scala.collection.immutable.List.flatMap(List.scala:293)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.reportDiagnostics(Compiler.scala:959)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.runErrorHandling(Compiler.scala:865)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.runCompilerPipeline(Compiler.scala:361)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.go$1(Compiler.scala:229)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.runInternal(Compiler.scala:236)
	at org.enso.runtime.compiler/org.enso.compiler.Compiler.run(Compiler.scala:127)
	at org.enso.runtime/org.enso.interpreter.runtime.Module.compile(Module.java:418)
	at org.enso.runtime/org.enso.interpreter.runtime.Module.compileScope(Module.java:354)
	at org.enso.runtime/org.enso.interpreter.node.ProgramRootNode.execute(ProgramRootNode.java:73)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:745)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:669)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:602)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:586)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.callIndirect(OptimizedCallTarget.java:519)
	at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedCallTarget.call(OptimizedCallTarget.java:500)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.eval(PolyglotContextImpl.java:1683)
	at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextDispatch.eval(PolyglotContextDispatch.java:60)
	at org.graalvm.polyglot/org.graalvm.polyglot.Context.eval(Context.java:402)
	at org.enso.polyglot.api/org.enso.polyglot.PolyglotContext.evalModule(PolyglotContext.scala:32)
	at org.enso.runner/org.enso.runner.Main.runSingleFile(Main.java:862)
	at org.enso.runner/org.enso.runner.Main.handleRun(Main.java:759)
	at org.enso.runner/org.enso.runner.Main.mainEntry(Main.java:1135)
	at org.enso.runner/org.enso.runner.Main.lambda$launch$22(Main.java:1479)
	at org.enso.runner/org.enso.runner.Main.withProfiling(Main.java:1225)
	at org.enso.runner/org.enso.runner.Main.launch(Main.java:1475)
	at org.enso.runner/org.enso.runner.Main.launch(Main.java:1426)
	at org.enso.runner/org.enso.runner.Main.main(Main.java:1041)
	Suppressed: Attached Guest Language Frames (1)

Happens on 5f52547

@Akirathan Akirathan self-assigned this Nov 11, 2024
@JaroslavTulach JaroslavTulach moved this from 📤 Backlog to 👁️ Code review in Issues Board Nov 26, 2024
@github-project-automation github-project-automation bot moved this from 👁️ Code review to 🟢 Accepted in Issues Board Nov 26, 2024
@enso-bot
Copy link

enso-bot bot commented Nov 27, 2024

Jaroslav Tulach reports a new STANDUP for yesterday (2024-11-26):

Progress: .

Discord
Discord is great for playing games and chilling with friends, or even building a worldwide community. Customize your own space to talk, play, and hang out.
Discord
Discord is great for playing games and chilling with friends, or even building a worldwide community. Customize your own space to talk, play, and hang out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🟢 Accepted
Development

Successfully merging a pull request may close this issue.

2 participants