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

Supporting fibers using puniverse/quasar has issues from instrumentation and quasar-core implementation #2546

Closed
doctorpangloss opened this issue Jun 5, 2020 · 2 comments
Assignees

Comments

@doctorpangloss
Copy link

doctorpangloss commented Jun 5, 2020

Describe the issue
The bytecode emitted by puniverse/quasar fiber and coroutines instrumentation cannot be compiled by native-image. Includes reproduction with a carefully embedded quasar-core and instrumentation script to make it very easy for you to investigate a fix.

Fixing this issue would fix #477 and could give you a path to support fibers in dynamic languages today without Loom.

This is also related to #955 because quasar-core uses VarHandle / MethodHandle.

A useful fibers implementation would not need to be able to instrument at runtime so maybe some changes to quasar-core would be possible to Just Work on GraalVM.

Steps to reproduce the issue

https://github.com/hiddenswitch/quasar-fibers-bytecodes-graal

git clone [email protected]:hiddenswitch/quasar-fibers-bytecodes-graal.git
cd quasar-fibers-bytecodes-graal
gu install native-image
./gradlew testapp:shadowJar
native-image -jar testapp/build/libs/testapp-all.jar -H:+ReportExceptionStackTraces --no-fallback --native-image-info --verbose &>output.log

output.log

These errors are related to the implementation of quasar-core rather than the instrumentation:

./gradlew uninstrumentedtestapp:shadowJar
native-image -jar uninstrumentedtestapp/build/libs/uninstrumentedtestapp-all.jar -H:+ReportExceptionStackTraces --no-fallback --native-image-info --verbose &>output2.log

output2.log

Environment

GraalVM version:

openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02)
OpenJDK 64-Bit Server VM GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02, mixed mode, sharing)
  • JDK major version: 11
  • OS: macOS Catalina
  • Architecture: AMD64
@doctorpangloss doctorpangloss changed the title Supporting fibers using puniverse/quasar incurs a variety of issues due to instrumentation and quasar-core implementation Supporting fibers using puniverse/quasar has issues from instrumentation and quasar-core implementation Jun 9, 2020
@cstancu
Copy link
Member

cstancu commented Sep 22, 2020

The underlying issue here is incomplete MethodHandle support. That is under development and is being tracked by #2761.

@cstancu cstancu closed this as completed Sep 22, 2020
@doctorpangloss
Copy link
Author

doctorpangloss commented Oct 30, 2020

@cstancu Can you reopen this and try the reproduction to resolve it once it's actually fixed? It is disappointed to build a pretty sophisticated and easy to use reproduction only to have it disposed. Otherwise what's the motivation of authoring good reproducers.

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

3 participants