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

JDK 11 - Class sun.reflect.CallerSensitive not found - continuing with a stub. #11679

Open
Sciss opened this issue Aug 13, 2019 · 4 comments

Comments

@Sciss
Copy link

commented Aug 13, 2019

I am building a project with "-release", "8", compiling with sbt under OpenJDK 11. For both cross Scala versions 2.12.9 and 2.13.0, this fails at several places with errors like

[error] /home/hhrutz/Documents/devel/SoundProcesses/core/src/main/scala/de/sciss/synth/proc/SynthGraphObj.scala:166:27: Class sun.reflect.CallerSensitive not found - continuing with a stub.
[error]           val companion = Class.forName(s"$className").getField("MODULE$").get(null)
[error]                           ^

or

[error] /home/hhrutz/Documents/devel/SoundProcesses/core/src/main/scala/de/sciss/synth/proc/impl/MemoryClassLoader.scala:20:39: Class sun.reflect.CallerSensitive not found - continuing with a stub.
[error] final class MemoryClassLoader extends ClassLoader {
[error]                                       ^

Unfortunately it's not easy to isolate the code that breaks (I tried simple reductions but they don't crash the compiler). It's on a project that runs on multiple snapshot dependencies, so the heavy way to reproduce is

java -version
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+11-post-Debian-1deb10u1)
OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Debian-1deb10u1, mixed mode, sharing)

(i.e. use JDK 11)

git clone https://github.com/Sciss/Lucre.git
cd Lucre
git checkout -b debug 53c779f0edfbf6bf0fc8f276d946290c145d85e3
sbt update
sbt publishLocal
cd ..
git clone https://github.com/Sciss/LucreSwing.git
cd LucreSwing
git checkout -b debug e6b50892553e765a3e840ea68c4bf5e5e0879fd9
sbt update
sbt publishLocal
cd ..
git clone https://github.com/Sciss/SoundProcesses.git
cd SoundProcesses
git checkout -b debug f25d534f5f74b80c3cc52abbec5fcbbed3958e9d
sbt update
sbt compile

This should be reproducible and yield

[error] /data/temp/bla/SoundProcesses/core/src/main/scala/de/sciss/synth/proc/SynthGraphObj.scala:166:27: Class sun.reflect.CallerSensitive not found - continuing with a stub.
[error]           val companion = Class.forName(className).getField("MODULE$").get(null)
[error]                           ^

Perhaps related to #10817 . The only place that CallerSensitive appears in seems to be https://github.com/scala/scala/blob/3027652cab884c88f5cc20f710e351a0730c5ba2/src/compiler/scala/tools/nsc/backend/jvm/opt/BytecodeUtils.scala#L132

@SethTisue SethTisue added the jdk11 label Aug 21, 2019

@SethTisue

This comment has been minimized.

Copy link
Member

commented Aug 21, 2019

@lrytz this one might interest you

@SethTisue SethTisue added this to the Backlog milestone Aug 21, 2019

@lrytz

This comment has been minimized.

Copy link
Member

commented Aug 23, 2019

git clone https://github.com/Sciss/Lucre.git
cd Lucre
git checkout -b debug 53c779f0edfbf6bf0fc8f276d946290c145d85e3
sbt update

failed already for me

[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	::          UNRESOLVED DEPENDENCIES         ::
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	:: com.sleepycat#je;6.4.25: not found
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] 	Note: Unresolved dependencies path:
[warn] 		com.sleepycat:je:6.4.25 (/Users/luc/Downloads/tmp/Lucre/build.sbt#L171)
[warn] 		  +- de.sciss:lucre-bdb6_2.12:3.14.0-SNAPSHOT
[error] sbt.librarymanagement.ResolveException: unresolved dependency: com.sleepycat#je;7.4.5: not found

I don't think it's related to the code in the backend that you refer to, as we're not loading any symbols at this point.

It's probably some other entity that carries the @CallerSensitive annotation causing the symbol to be loaded.

It's quite certainly related to the use of -release. Since CallerSensitive is part of sun.reflect, does it actually exists in the ct.sym file? cc @retronym.

@Sciss

This comment has been minimized.

Copy link
Author

commented Aug 23, 2019

failed already for me

Oh great, Oracle is doing its best to tear down all their Java related resources (https://download.oracle.com/maven - 404). It will take me a moment to see where that repository went.

@Sciss

This comment has been minimized.

Copy link
Author

commented Aug 23, 2019

Hmmm, no, download works fine for me (and Travis CI also builds without complaining); perhaps you are behind a strange firewall?

...
[info] downloading http://download.oracle.com/maven/com/sleepycat/je/6.4.25/je-6.4.25.jar ...
[info] 	[SUCCESSFUL ] com.sleepycat#je;6.4.25!je.jar (4266ms)
[info] Done updating.
[info] downloading https://repo1.maven.org/maven2/de/sciss/fileutil_2.12/1.1.3/fileutil_2.12-1.1.3.jar ...
[info] downloading https://repo1.maven.org/maven2/de/sciss/model_2.12/0.3.4/model_2.12-0.3.4.jar ...
[info] downloading https://repo1.maven.org/maven2/de/sciss/span_2.12/1.4.2/span_2.12-1.4.2.jar ...
[info] 	[SUCCESSFUL ] de.sciss#fileutil_2.12;1.1.3!fileutil_2.12.jar (286ms)
[info] 	[SUCCESSFUL ] de.sciss#model_2.12;0.3.4!model_2.12.jar (286ms)
[info] 	[SUCCESSFUL ] de.sciss#span_2.12;1.4.2!span_2.12.jar (463ms)
[info] Done updating.
[info] downloading http://download.oracle.com/maven/com/sleepycat/je/5.0.104/je-5.0.104.jar ...
[info] 	[SUCCESSFUL ] com.sleepycat#je;5.0.104!je.jar (3239ms)
[info] Done updating.
[info] downloading http://download.oracle.com/maven/com/sleepycat/je/7.4.5/je-7.4.5.jar ...
[info] 	[SUCCESSFUL ] com.sleepycat#je;7.4.5!je.jar (4582ms)
[info] Done updating.
[info] downloading https://repo1.maven.org/maven2/de/sciss/fingertree_2.12/1.5.4/fingertree_2.12-1.5.4.jar ...
[info] 	[SUCCESSFUL ] de.sciss#fingertree_2.12;1.5.4!fingertree_2.12.jar (386ms)
[info] Done updating.
[info] Updating ...
[info] Done updating.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.