Why `sun.jvm.hotspot.debugger.DebuggerException: cannot open binary file`? - java

In linux, I got a core file generated by java, it can't be opened by jvisualvm ,so I want to translate it to a heap dump file , but occured some error :
[root#root_test-1 game]$ jmap -J-d64 -dump:format=b,file=core.10255.dump java ./core.10255
Attaching to core ./core.10255 from executable java, please wait...
Error attaching to core file: cannot open binary file
sun.jvm.hotspot.debugger.DebuggerException: cannot open binary file
at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach0(Native Method)
at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach(LinuxDebuggerLocal.java:286)
at sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:673)
at sun.jvm.hotspot.HotSpotAgent.setupDebuggerLinux(HotSpotAgent.java:611)
at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:337)
at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:304)
at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:156)
at sun.jvm.hotspot.tools.Tool.start(Tool.java:191)
at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
at sun.jvm.hotspot.tools.HeapDumper.main(HeapDumper.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.tools.jmap.JMap.runTool(JMap.java:201)
at sun.tools.jmap.JMap.main(JMap.java:130)
How to fix it?

It does look like you are using bit older(JDK8 update 60 or lesser) version of java. The issue you have mentioned is known issue https://bugs.openjdk.java.net/browse/JDK-8039995 this has been already fixed in JDK9 and backported to varies lower versions (JDK8 update 65 is the lowest). You need to upgrade your java to use latest version to avoid this issue.

Related

FTB Infinity Evolved server not starting with JDK 8

I have downloaded and unzipped the FTB Infinity server from CurseForge on my Arch Linux machine and run both the install and run scripts, and I am presented with this error:
Starting server
OpenJDK 64-Bit Server VM warning: ignoring option PermSize=256M; support was removed in 8.0
OpenJDK 64-Bit Server VM warning: Using the ParNew young collector with the Serial old collector is deprecated and will likely be removed in a future release
A problem occurred running the Server launcher.java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cpw.mods.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:43)
at cpw.mods.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:12)
Caused by: java.lang.NoClassDefFoundError: org/apache/logging/log4j/Level
at net.minecraft.launchwrapper.Launch.launch(Launch.java:94)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
... 6 more
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.Level
at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 8 more
My directory listing:
changelogs FTBserver.jar ServerStart.sh
config libraries settings.bat
eula.txt minecraft_server.1.7.10.jar settings.sh
FTBInstall.bat modpack version.json
FTBInstall.sh mods
FTBServer-1.7.10-1614.jar ServerStart.bat
I looked at all of the questions online, and most of them said to install jdk 8, but I am already using it. Any ideas?
Okay, so this is pretty dumb of the install script. It downloaded an XML file saying that the jar could not be found instead of the actual jar. (laughs) I should probably report that.

InvocationTargetException when converting a Windows minidump to hprof format

When trying to extract an hprof from a Windows minidump of a crashed JVM (-XX:+CreateMinidumpOnCrash) with jmap, I'm receiving an InvocationTargetException at about 31 MB of hprof file written (the mdmp file is 1700+ MB large):
jmap -dump:format=b,file=hs_err_pid15916.hprof "C:\Program Files\Java\jdk1.8.0_40\jre\bin\java.exe" hs_err_pid15916.mdmp
Attaching to core hs_err_pid15916.mdmp from executable C:\Program Files\Java\jdk1.8.0_40\jre\bin\java.exe, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.40-b25
Dumping heap to hs_err_pid15916.hprof ...
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.tools.jmap.JMap.runTool(JMap.java:201)
at sun.tools.jmap.JMap.main(JMap.java:130)
Caused by: sun.jvm.hotspot.utilities.AssertionFailure: can not get class data for sun/net/ExtendedOptionsImpl$$Lambda$10x00000001001afc2
at sun.jvm.hotspot.utilities.Assert.that(Assert.java:32)
at sun.jvm.hotspot.utilities.HeapHprofBinWriter.writeInstance(HeapHprofBinWriter.java:803)
at sun.jvm.hotspot.utilities.AbstractHeapGraphWriter$1.doObj(AbstractHeapGraphWriter.java:95)
at sun.jvm.hotspot.oops.ObjectHeap.iterateLiveRegions(ObjectHeap.java:353)
at sun.jvm.hotspot.oops.ObjectHeap.iterate(ObjectHeap.java:171)
at sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.write(AbstractHeapGraphWriter.java:51)
at sun.jvm.hotspot.utilities.HeapHprofBinWriter.write(HeapHprofBinWriter.java:433)
at sun.jvm.hotspot.tools.HeapDumper.run(HeapDumper.java:62)
at sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:260)
at sun.jvm.hotspot.tools.Tool.start(Tool.java:223)
at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
at sun.jvm.hotspot.tools.HeapDumper.main(HeapDumper.java:83)
... 6 more
The exception is thrown regardless of the jmap variant used (1.8.0_40 Oracle JDK vs 1.8.0_40 Zulu).
How can I further diagnose this problem?
Update:
If I use a more recent jmap version (1.8.0_92 vs 1.8.0_40), can't pull out any hprof, either:
sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions are 25.92-b14. Target VM is 25.40-b25

[Eclipse not starting]:An error has occured. See the log file null

I'm unable to get my Eclipse Luna running. It was working fine till now and suddenly crashed. Now when i try to start it, I get the error saying:
An error has occured. See the log file null
I tried launching eclipse from terminal and also tried to delete the metadata folder from my workspace but nothing helped me.
Here is the crash log:
org.osgi.framework.BundleException: Error initializing container.
at org.eclipse.osgi.container.SystemModule.init(SystemModule.java:93)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle.init(EquinoxBundle.java:209)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle.init(EquinoxBundle.java:201)
at org.eclipse.osgi.launch.Equinox.init(Equinox.java:168)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:296)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:231)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
Caused by: java.lang.ExceptionInInitializerError
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.initWorker(EquinoxBundle.java:137)
at org.eclipse.osgi.container.SystemModule.init(SystemModule.java:83)
... 12 more
Caused by: java.security.ProviderException: setSeed() failed
at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:458)
at sun.security.provider.NativePRNG$RandomIO.access$300(NativePRNG.java:329)
at sun.security.provider.NativePRNG.engineSetSeed(NativePRNG.java:212)
at java.security.SecureRandom.getDefaultPRNG(SecureRandom.java:209)
at java.security.SecureRandom.<init>(SecureRandom.java:190)
at org.eclipse.osgi.internal.framework.UniversalUniqueIdentifier.computeNodeAddress(UniversalUniqueIdentifier.java:127)
at org.eclipse.osgi.internal.framework.UniversalUniqueIdentifier.<clinit>(UniversalUniqueIdentifier.java:35)
... 14 more
Caused by: java.io.IOException: Operation not permitted
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:313)
at sun.security.provider.NativePRNG$RandomIO.implSetSeed(NativePRNG.java:456)
... 20 more
It seems you're using Solaris? This OS has an alternative entropy source called EGD, which needs special protocol to write to, which Sun JDK does not implement...
Can you try adding -Djava.security.egd=/dev/random to the vmargs section of your eclipse.ini.
If you still see the same issue. Make sure your user can write to /dev/random.
I fixed it myself. Few files in my security folder /jre/lib/security had got messed up.
Downloaded latest Java Cryptography Extension (JCE) and put the jars (Download US_export_policy.jar and local_policy.jar) in the security folder. My eclipse works fine now.

Java JPG codec won't work

I have problem with my tomcat application, after changing the server and installing the last version of tomcat7 my application won't read/load jpg files..
I installed imageio and jai on the server, try to change java version but every time I have the same error..
Anybody have an idea?
Error: One factory fails for the operation "jpeg"
Occurs in: javax.media.jai.ThreadSafeOperationRegistry
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122)
at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674)
at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:473)
at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332)
at com.sun.media.jai.opimage.StreamRIF.create(StreamRIF.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122)
at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674)
at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:473)
at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332)
at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:819)
at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:867)
at javax.media.jai.RenderedOp.getWidth(RenderedOp.java:2179)
The whole error log can be found here -> http://paste.ubuntu.com/7653452/.
Update: The problem is related to grails plugin called ImageTools
If you look at the code for JPEGImageDecoder you'll see it depends on com.sun.image.codec.jpeg.ImageFormatException in its imports.
However, com.sun.image.codec.jpeg was removed from Java 7 onwards.
So likely the problem is that JAI is simply out of date, and you would have to use a Java 6 runtime to use it.

Can't Run JCUDA 0.4.1 Over CUDA 4.0 On Windows 7 64-bit, Sun JDK 7, and IntelliJ 11.1

The question lays out all the pertinent versions.
I'm trying to run one of the sample files at http://www.jcuda.org: JCublasMatrixInvert.java.
I've got the NVIDIA CUDA drivers installed; I've downloaded the JCUDA 0.4.1 bindings and added their /lib directory to my java.library.path. Here are the JVM parameters I set when I run:
-ea -XX:+UseParNewGC -XX:+UseNUMA -XX:PermSize=128m -XX:MaxPermSize=256m -Xmx1024m -Djava.library.path=F:\Projects\Java\learning\out\production\learning
Yet when I try to run the class I get the following stack trace:
Error while loading native library "JCublas-windows-x86_64" with base name "JCublas"
Operating system name: Windows 7
Architecture : amd64
Architecture bit size: 64
Stack trace from the attempt to load the library as a resource:
java.lang.NullPointerException: No resource found with name '/lib/JCublas-windows-x86_64.dll'
at jcuda.LibUtils.loadLibraryResource(LibUtils.java:151)
at jcuda.LibUtils.loadLibrary(LibUtils.java:83)
at jcuda.jcublas.JCublas.initialize(JCublas.java:82)
at jcuda.jcublas.JCublas.<clinit>(JCublas.java:70)
at matrix.jcuda.JCublasMatrixInvert.main(JCublasMatrixInvert.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Stack trace from the attempt to load the library as a file:
java.lang.UnsatisfiedLinkError: F:\Projects\Java\learning\out\production\learning\JCublas-windows-x86_64.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1928)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1854)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at jcuda.LibUtils.loadLibrary(LibUtils.java:94)
at jcuda.jcublas.JCublas.initialize(JCublas.java:82)
at jcuda.jcublas.JCublas.<clinit>(JCublas.java:70)
at matrix.jcuda.JCublasMatrixInvert.main(JCublasMatrixInvert.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load the native library
at jcuda.LibUtils.loadLibrary(LibUtils.java:129)
at jcuda.jcublas.JCublas.initialize(JCublas.java:82)
at jcuda.jcublas.JCublas.<clinit>(JCublas.java:70)
at matrix.jcuda.JCublasMatrixInvert.main(JCublasMatrixInvert.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Process finished with exit code 1
I can see the allegedly missing dll at the path
F:\Projects\Java\learning\out\production\learning\JCublas-windows-x86_64.dll
What have I missed? What am I doing wrong? Can anyone who has had success with running this example advise me? Thanks.
If standard way is too hard - I recommend you to use mavenized version of JCuda. You could clone standard project here - https://github.com/MysterionRise/mavenized-jcuda it's working automatically for Windows/Linux 32/64 bit
All you need to do is to run:
You need to install Cuda 5.5 for your platform here - https://developer.nvidia.com/cuda-downloads
Call mvn clean package to build project
Call mvn exec:exec to run main class with "Hello, JCuda" sample :)
After that you could replace main class with your JCuda code
Download that file from the jCuda download section and put it into your library path.

Categories