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
Could not self-attach to current VM using external process (ByteBuddyAgent.installExtension) #2741
Comments
Can you update them in separate steps, so that it is clearer which particular step is breaking it? E.g. you first upgrade your Mockito version to 4.7.0 and then later you upgrade to Java 17. |
Hey Tim for sure: 1.) The initial situation with mockito-core and Java 8
2.) Now we switch from mockito-core to mockito-core to mockito-inline because we are aware of some potential issues in newer Java version.
3.) Now we switch from Java 8 to Java 17. The mockito-inline version stays the same
So the breaking step is switching from Java 8 to 17 |
Unfortunately, |
No problem at all and thanks for the explanation :) I never thought about the side effects mocking static methods can have in Mockito |
Seems like JDK on Linux is prone to having this problem when the executables' file are owned by a different user but the process is started by another, so I guess it's probably about capabilities. Anyway, seeing it requires self-attaching and only "CAP_SYS_PTRACE" seems relevant, I just tried adding "CAP_SYS_PTRACE" capability to the |
I am switching from Mockito 3 to 4.7.0 and Java 8 to 17. Some unit tests started to fail in a really strange way, so I asked a question on Stackoverflow (https://stackoverflow.com/questions/73492733/how-to-properly-spy-on-an-input-stream). Therefore I switched to
mockito-inline
and now I get aCould not self-attach to current VM using external process
innet.bytebuddy.agent.ByteBuddyAgent.installExternal(ByteBuddyAgent.java:700)
. Source: https://github.com/raphw/byte-buddy/blob/master/byte-buddy-agent/src/main/java/net/bytebuddy/agent/ByteBuddyAgent.java#L689My Gradle
build.gradle
file:My JUnit test:
The command I run:
This results in the following JVM crash (I guess), followed by several JVM restarts/re-attempts (Second guess): Output.log
What I checked:
ByteArrayInputStream
is not finalVersion of the used components:
Note: I can provide access to this system if whished :)
The text was updated successfully, but these errors were encountered: