square / leakcanary

A memory leak detection library for Android.
https://square.github.io/leakcanary
Apache License 2.0
29.41k stars 3.97k forks source link

java.lang.LinkageError: Cannot to link java.nio.DirectByteBuffer #2449

Open VladislavSumin opened 1 year ago

VladislavSumin commented 1 year ago

Description

shark-cli crashes with new feature neo4j

Steps to Reproduce

  1. install product with included leakcanary
  2. install shark-cli
  3. run shark-cli --process <deleted> neo4j
  4. crash at terminal

Expected behavior: no crash

Version Information

stacktrace ``` ➜ ~ shark-cli --process neo4j Dumping heap on for process "" with pid 28266 to /data/local/tmp/2022-11-16_11-59-00_831-.hprof Creating db in /Users/sumin/2022-11-16_11-59-00_831- Exception in thread "main" java.lang.LinkageError: Cannot to link java.nio.DirectByteBuffer at org.neo4j.internal.unsafe.UnsafeUtil.(UnsafeUtil.java:128) at org.neo4j.memory.RuntimeInternals.guessHeaderSize(RuntimeInternals.java:158) at org.neo4j.memory.RuntimeInternals.(RuntimeInternals.java:53) at org.neo4j.memory.HeapEstimator.(HeapEstimator.java:103) at org.neo4j.internal.collector.RecentQueryBuffer.(RecentQueryBuffer.java:37) at org.neo4j.graphdb.factory.module.GlobalModule.(GlobalModule.java:212) at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.createGlobalModule(DatabaseManagementServiceFactory.java:273) at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.build(DatabaseManagementServiceFactory.java:133) at org.neo4j.dbms.api.DatabaseManagementServiceBuilder.newDatabaseManagementService(DatabaseManagementServiceBuilder.java:101) at org.neo4j.dbms.api.DatabaseManagementServiceBuilder.build(DatabaseManagementServiceBuilder.java:94) at shark.Neo4JCommand$Companion.dump(Neo4JCommand.kt:145) at shark.Neo4JCommand.run(Neo4JCommand.kt:97) at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:139) at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:14) at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:215) at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:212) at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:230) at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:253) at shark.MainKt.main(Main.kt:13) Caused by: java.lang.IllegalAccessException: module java.base does not open java.nio to unnamed module @54307ae0 at java.base/java.lang.invoke.MethodHandles.privateLookupIn(MethodHandles.java:279) at org.neo4j.internal.unsafe.UnsafeUtil.(UnsafeUtil.java:111) ... 18 more ```
pyricau commented 1 year ago

Sounds like a Java version issue? https://community.neo4j.com/t5/neo4j-graph-platform/java-lang-illegalaccessexception-module-java-base-does-not-open/td-p/23841

OussamaHaff commented 1 year ago

Hello, I run into the same issue on both JDKs