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

Native IORuntime.global causes RPCCore$ClosedException when used for munitExecutionContext #3827

Closed
armanbilge opened this issue Sep 14, 2023 · 1 comment
Labels

Comments

@armanbilge
Copy link
Member

//> using dep org.scalameta::munit::1.0.0-M9
//> using dep org.typelevel::cats-effect::3.5.1
//> using nativeVersion 0.4.15

import cats.effect.*
import scala.concurrent.duration.*
import scala.concurrent.*

class MySuite extends munit.FunSuite:
  override implicit def munitExecutionContext = unsafe.IORuntime.global.compute

  test("boo"):
    val p = Promise[Unit]()
    unsafe.IORuntime.global.scheduler.sleep(1.second, () => p.success(()))
    p.future
MySuite:
  + boo 1.00s
Test runner interrupted by fatal signal 9
Error: scala.scalanative.testinterface.common.RPCCore$ClosedException: scala.scalanative.testinterface.NativeRunnerRPC$RunTerminatedException
For more details, please see '/workspace/sandbox/.scala-build/stacktraces/1694716393-3064312251356976367.log'
scala.scalanative.testinterface.common.RPCCore$ClosedException: scala.scalanative.testinterface.NativeRunnerRPC$RunTerminatedException
  scala.scalanative.testinterface.common.RPCCore.helpClose(RPCCore.scala:213)
  scala.scalanative.testinterface.common.RPCCore.close(RPCCore.scala:204)
  scala.scalanative.testinterface.NativeRunnerRPC.close(NativeRunnerRPC.scala:54)
  scala.scalanative.testinterface.NativeRunnerRPC.$init$$$anonfun$2(NativeRunnerRPC.scala:43)
  scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
  scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
  scala.concurrent.impl.Promise$Transformation.run(Promise.scala:484)
  java.base@17.0.6/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
  java.base@17.0.6/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
  java.base@17.0.6/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
  java.base@17.0.6/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
  java.base@17.0.6/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
  java.base@17.0.6/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
  com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
  com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)
scala.scalanative.testinterface.NativeRunnerRPC$RunTerminatedException
  scala.scalanative.testinterface.NativeRunnerRPC$RunTerminatedException$.apply(NativeRunnerRPC.scala:61)
  scala.scalanative.testinterface.NativeRunnerRPC.$init$$$anonfun$2(NativeRunnerRPC.scala:43)
  scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
  scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
  scala.concurrent.impl.Promise$Transformation.run(Promise.scala:484)
  java.base@17.0.6/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
  java.base@17.0.6/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
  java.base@17.0.6/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
  java.base@17.0.6/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
  java.base@17.0.6/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
  java.base@17.0.6/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
  com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
  com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)
java.lang.IllegalStateException: Unknown opcode: 4
  scala.scalanative.testinterface.common.RPCCore.handleMessage$$anonfun$1(RPCCore.scala:94)
  scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
  scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
  scala.scalanative.testinterface.common.Serializer$.withInputStream(Serializer.scala:52)
  scala.scalanative.testinterface.common.RPCCore.handleMessage(RPCCore.scala:114)
  scala.scalanative.testinterface.NativeRunnerRPC.$init$$$anonfun$1(NativeRunnerRPC.scala:31)
  scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
  scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
  scala.scalanative.testinterface.ComRunner$$anon$1.run(ComRunner.scala:61)
  com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
  com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)
@armanbilge
Copy link
Member Author

@armanbilge armanbilge closed this as not planned Won't fix, can't repro, duplicate, stale Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant