1

sorry to bother, but i´m quite new in working with Java. I´ve created a project with several classes, all classes worked fine, but since i started the algorithm again today, i recieve this error message.

I could locate the error, being caused by one class of the project, but i clearly don´t know where the problem ist. I hope that somebody is able to help me.

I´m really looking forward for help. Thank you very much.

A fatal error has been detected by the Java Runtime Environment:

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000064e7b23f, pid=13200, tid=0x00000000000063bc

JRE version: Java(TM) SE Runtime Environment (8.0_241-b07) (build 1.8.0_241-b07) Java VM: Java HotSpot(TM) 64-Bit Server VM (25.241-b07 mixed mode windows-amd64 compressed oops) Problematic frame: V [jvm.dll+0x4cb23f]

Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

An error report file with more information is saved as: C:\Users\marti\eclipse-workspace\IGMOTaillardLocNew\hs_err_pid13200.log

Compiler replay data is saved as: C:\Users\marti\eclipse-workspace\IGMOTaillardLocNew\replay_pid13200.log

If you would like to submit a bug report, please visit: http://bugreport.java.com/bugreport/crash.jsp

---------------  T H R E A D  ---------------

Current thread (0x0000000019cef000):  JavaThread "C2 CompilerThread2" 
daemon [_thread_in_native, id=25532, 
stack(0x000000001a6e0000,0x000000001a7e0000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x0000000000000008

Registers:
RAX=0x0000000000000000, RBX=0x0000000000000000, RCX=0x000000001ca6b570, 
RDX=0x0000000000004000
RSP=0x000000001a7db520, RBP=0x000000001b079d30, RSI=0x000000001ca6b570, 
RDI=0x000000001a7dba60
R8 =0x0000000000000000, R9 =0x000000001e07bfc0, R10=0x000000001a7dba60, 
R11=0x000000001afe4df0
R12=0x000000001acd5a80, R13=0x000000001ce513d8, R14=0x000000001a7db608, 
R15=0x000000001a7db628
RIP=0x0000000064e7b23f, EFLAGS=0x0000000000010206

Top of Stack: (sp=0x000000001a7db520)
0x000000001a7db520:   000000001b07a038 000000001b079d30
0x000000001a7db530:   000000001dd7e290 000000001a7dba60
0x000000001a7db540:   000000001b079d30 000000001a7db678
0x000000001a7db550:   000000001a7db6d0 0000000064e7ca69
0x000000001a7db560:   000000001b07a038 00000000000003d3
0x000000001a7db570:   0000000000000001 0000000019cd9dd0
0x000000001a7db580:   000000001a7dc438 0000000064ec7490
0x000000001a7db590:   000000001d6d8500 0000000019cd9dd0
0x000000001a7db5a0:   0000000019d16cc0 000000001a7db6d0
0x000000001a7db5b0:   0000000019cd9dd0 000000000000002b
0x000000001a7db5c0:   000000001a7dba60 0000000064e7e813
0x000000001a7db5d0:   000000001a7dba60 0000000000000001
0x000000001a7db5e0:   0000000000000001 000000001a7db678
0x000000001a7db5f0:   000000001d6d8550 000000001d6e04e8
0x000000001a7db600:   0000000000247c80 0000000019cd9dd0
0x000000001a7db610:   0000000000000400 000000001b11bbf0 

Instructions: (pc=0x0000000064e7b23f)
0x0000000064e7b21f:   4c 89 64 24 50 4c 8b e0 4c 3b e8 0f 84 4f 01 00
0x0000000064e7b22f:   00 44 8b 43 28 4c 8b 8f f8 09 00 00 4b 8b 1c c1
0x0000000064e7b23f:   48 8b 43 08 48 83 38 00 75 2a 8b 57 28 0f 1f 40
0x0000000064e7b24f:   00 8b 43 28 3b c2 73 0c 8b c8 48 8b 47 30 48 8b 


Register to memory mapping:

RAX=0x0000000000000000 is an unknown value
RBX=0x0000000000000000 is an unknown value
RCX=0x000000001ca6b570 is an unknown value
RDX=0x0000000000004000 is an unknown value
RSP=0x000000001a7db520 is pointing into the stack for thread: 
0x0000000019cef000
RBP=0x000000001b079d30 is an unknown value
RSI=0x000000001ca6b570 is an unknown value
RDI=0x000000001a7dba60 is pointing into the stack for thread: 
0x0000000019cef000
R8 =0x0000000000000000 is an unknown value
R9 =0x000000001e07bfc0 is an unknown value
R10=0x000000001a7dba60 is pointing into the stack for thread: 
0x0000000019cef000
R11=0x000000001afe4df0 is an unknown value
R12=0x000000001acd5a80 is an unknown value
R13=0x000000001ce513d8 is an unknown value
R14=0x000000001a7db608 is pointing into the stack for thread: 
0x0000000019cef000
R15=0x000000001a7db628 is pointing into the stack for thread: 
0x0000000019cef000


Stack: [0x000000001a6e0000,0x000000001a7e0000],  sp=0x000000001a7db520,  
free space=1005k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native 
code)
V  [jvm.dll+0x4cb23f]
V  [jvm.dll+0x4cca69]
V  [jvm.dll+0x4ce813]
V  [jvm.dll+0x47e1e0]
V  [jvm.dll+0x47f013]
V  [jvm.dll+0x4618a2]
V  [jvm.dll+0xa6a62]
V  [jvm.dll+0xa73af]
V  [jvm.dll+0x2467ef]
V  [jvm.dll+0x29fd2a]
C  [msvcr100.dll+0x21d9f]
C  [msvcr100.dll+0x21e3b]
C  [KERNEL32.DLL+0x17bd4]
C  [ntdll.dll+0x6ced1]


Current CompileTask:
C2:   1511  309       4       
InsertionNeighborhoodLocNew::InsertionNeighborhood (2858 bytes)

for(int x=0; x<nFac; x++) {
    for(int y=0; y<nJob; y++) {

        if(ZZ[x][y][0]==0 && y!=0) {
            flag=y-1;
            ZZf[0][x]=ZZ[x][flag][nMachine-1];
            merkerZZf[0][x]=ZZ[x][flag][nMachine-1];
            break;
        }
            else{
                if(ZZ[x][y][0]==0 && y==0) {
                ZZf[0][x]=0;
                merkerZZf[0][x]=0;
                }
                    else {
                        if(ZZ[x][nJob-1][0]!=0) {
                        flag=nJob-1;
                        ZZf[0][x]=ZZ[x][flag][nMachine-1];
                        merkerZZf[0][x]=ZZ[x][flag][nMachine-1];
                        }
                    }

            }
    }
}

With this code i´m basically trying to differentiate circumstances related to the problem I´m dealing with. I realized since i removed the lines with the "merkerZZf" i´m not causing the error. I actually don´t know why.

Kayaman
  • 72,141
  • 5
  • 83
  • 121
masc3265
  • 11
  • 3
  • Have you had a look at the error report file in `C:\Users\marti\eclipse-workspace\IGMOTaillardLocNew\hs_err_pid13200.log` – I.T Delinquent Apr 03 '20 at 14:18
  • Yes but the information given aren´t helping me. I don´t even quite know what the problem is, to be honest. But i can attach the log file if that helps. – masc3265 Apr 03 '20 at 14:30
  • Compile from scratch and run again. – PeterMmm Apr 03 '20 at 14:35
  • If i run the project as Debug there is error detection. – masc3265 Apr 03 '20 at 14:44
  • Are you able to turn that into a self contained class with a `main()` method and necessary variables and data, so the code can be run by others, and still get the error? Then it'll be perfect. It's not expected that you would know why this error occurs, and many Java programmers wouldn't understand it. It involves very low level mechanisms that not all people are familiar with. I'm just doing the groundwork (getting the simplest program that exhibits the bug) until someone smarter than me gets here. – Kayaman Apr 04 '20 at 08:18
  • I tried that but unfortuneatly the main method runs without causing the error. I can´t replicate the error. An intersting aspect is that, the array merkerZZf ist only used in those three lines. I used a modified code in a different class reworked the new one. In fact those lines are a relic from the old code. So at this point i can say it works fine without those lines and doesn´t work with those lines. I can further modify the code. The counter i mentioned earlier isn´t a problem anymore. – masc3265 Apr 04 '20 at 09:25
  • Well, can you at least include the variables and data used in the code so it's runnable by others? Include the whole method where that loop is contained in please, as well as the values of `nFac` and `nJob`. – Kayaman Apr 04 '20 at 11:15
  • And the arrays being used of course. A [minimal example](https://stackoverflow.com/help/minimal-reproducible-example) so it can be run, even if it doesn't exhibit the error (it may be that it doesn't run "hot" enough yet). – Kayaman Apr 04 '20 at 11:24
  • This indeed looks like a JVM bug. Please, include the full `hs_err_pid.log` and `replay_pid.log` files along with the code that reproduces the problem. Without the reproducer, it will be hard to tell where the problem is and how to avoid it. – apangin Apr 05 '20 at 21:25
  • Okay, sorry for the late response. Had been some busy days. I´ll try to update the post today. The class is part of a project with like 10 classes. I´ll post the code of the class. – masc3265 Apr 07 '20 at 08:15

1 Answers1

1

This is a fatal error in the JVM, it's not your fault. It's happening while the JVM is trying to compile your InsertionNeighbourhood code into native code. You could try changing your code around (modify the structure but keep the logic same) so the C2 compiler (see below) might not run into that, but again this is not something that should happen in the first place.

It looks to be a case of this bug, and since you apparently have a lot simpler code, you should submit a bug report. Don't lose your current code, the one that causes the error.


The C2 compiler (in addition to the C1) is the JVM's internal optimizing compiler that is responsible for analyzing the bytecode being run, and determining the optimal native code for it. It can also throw away previously compiled code and recompile it, which is important for performance. Let's say (simplified) your code starts by processing data that's only 0 and 1, and the code gets compiled to something efficient. Later on you get data that's in the range of 0-1000000, and the compiled code isn't as effective as it could be, so the JVM throws it away and recompiles it to work more effectively with that data.

Unfortunately as with any code, the JVM isn't bugfree either. In this case the compilation results in a fatal error and borks. Since the compiler does different things based on the code, data and other things, changing the code around a bit can result in the bug appearing/disappearing.

Kayaman
  • 72,141
  • 5
  • 83
  • 121
  • Well, thank you very much for your answer. So the only thing I can do is report the bug or trying changing the code? The class I created contains quite a loot of loops. I changed the code in some lines and well i´m not running into the error anymore. The problem is i want to reset a countervariable after a true if clause and if I insert this line which is simply xxxcounter=0; i´m running into it again. Is there a logical explanation for that? – masc3265 Apr 03 '20 at 16:33
  • @masc3265 yes there is (a logical reason for the bug), but it involves so low level mechanisms that it's impossible to know from Java code alone why it happens. I'll tag this with the jvm tag and see if it gets the attention of Andrei Pangin who's pretty much the go-to guy in these things. Don't forget to keep a copy of the code that reproduces the bug. If you want to help, try if you can shorten the code down and still make it throw the error. Or if it's short enough to post in the question, include it now. – Kayaman Apr 03 '20 at 16:48
  • @masc3265 or could you post the code for that class in the question? It should be reproducible with just that. – Kayaman Apr 03 '20 at 18:49
  • Thank you very much for your help. I´ll try to shorten the code tomorrow. Since i´m a beginner the code isn´t that complicated, just quite an amount of loops in it. I´ll keep this updated tomorrow. – masc3265 Apr 03 '20 at 21:55
  • i tried to find the cause by commenting out several lines of the code. I think i finally found the lines causing the error. I´ll update the originial post. Yeah ähm, i know there might be easier ways to code this .;D – masc3265 Apr 04 '20 at 08:02