1

I'm new in HDF5 and HDFql, I'm working in java and I have a .h5 file with several groups, inside each group I have different Datasets, some are floating arrays, which I get as follows. https://gyazo.com/c10100b327d20a2db8c13f2fd9ab7668

 Double[][] values = new Double[numRow][numCol];
 HDFql.variableRegister(values);
 HDFql.execute("SELECT FROM "+gName+"/"+dName+" INTO MEMORY "+HDFql.variableGetNumber(values));
 HDFql.variableUnregister(values);

The problem occurs when I have a dataset with a variable that is 1 row and 1 column and the type of data, is String. https://gyazo.com/2622693aee83d9eba5487a053ba9247c

I have tried to implement the following codes and I get the following error message

  String[] val = new String[10];
  HDFql.variableRegister(val);
  HDFql.execute("SELECT FROM "+gName+"/"+dName+" INTO MEMORY "+HDFql.variableGetNumber(val));
  HDFql.variableUnregister(val);

and

String val = "";
HDFql.variableRegister(val);
HDFql.execute("SELECT FROM "+gName+"/"+dName+" INTO MEMORY "+HDFql.variableGetNumber(val));
HDFql.variableUnregister(val);

the error shown by the console is:

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

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006da2f270, pid=42048, tid=0x00000000000089d4

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

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\us\AppData\Local\Temp\hs_err_pid42048.log

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

Any help is welcome, thank you very much in advance

Muhammad Dyas Yaskur
  • 6,914
  • 10
  • 48
  • 73
JavierSO
  • 15
  • 3

3 Answers3

0

Even if the dataset only has one element (in your case, 1 row x 1 col), you still need to declare the variable (that you register to store the data) as an array. In other words, declare and create variable val as follows:

String val[] = new String[1];

Additionally, please check section 5.2.51 in HDFql reference manual to know what type of variables you may register (with method variableRegister) in Java.

SOG
  • 876
  • 6
  • 10
0

Sorry for my delay in answering.

The problem persists, I found a way to access 1 Row x 1 Col variables. However, the problem seems to be another one.

I have a method that implements an HDFql call as follows. https://gyazo.com/c3bc1e4e568cb4277607fa21ea71445f

If I make 2 calls from the class constructor to the method https://gyazo.com/9dee4e0b9a0ea69e73089b2802dbdad9 Works correctly and I get as a result the two datasets that I have consulted. https://gyazo.com/40e4485408fe08e7cf9a1ad8baf97a9d https://gyazo.com/372fc6cb991992e82340325dfd0b548d

However, when I try to run the same method on a listener when a button is clicked. https://gyazo.com/928ee0b90e8b864fe6908b79e56da7a7 https://gyazo.com/f8c044e298208fa9f94c8be7bc5e1de3

An error occurs in Java, I have increased the memory heap to a maximum of 8Gb and I release all the variables of the HDFql once I finish the query, but the error persists. I don't understand why if the call is made from the constructor, even if it's several consecutive calls, it works and on the contrary, if a call is made from a method other than the constructor, the next error is returned.

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

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000054f6f1c2, pid=137068, tid=0x0000000000014d88

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

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\Code\AppData\Local\Temp\hs_err_pid137068.log

If you would like to submit a bug report, please visit: http://bugreport.java.com/bugreport/crash.jsp The crash happened outside the Java Virtual Machine in native code. See the problematic frame for where to report the bug. *

JavierSO
  • 15
  • 3
  • Out of curiosity, is your code multithread? Asking this because HDFql does not support multithreading. Additionally, could you please share your HDF5 file and a short version of the Java code that makes the JVM to crash? – SOG Jun 30 '20 at 16:57
0

I'm using the Vaadin framework for the development of a web application, I don't create any threads but I think this framework could be creating threads when the user interacts with the browser's components (buttons, comboBox, etc). I have tried to run the method from the constructor, which runs when you navigate to that view, the first time you navigate it works correctly, however, when you return to navigate or refresh the web page fails to access. It's like HDFql is caching or saving memory addresses from the previous access, and when you browse again or click a button certain variables will change their memory pointer and instead of using the new pointer, HDFql is trying to reuse the previous memory addresses.

Method: http://cpp.sh/8s5c3

Log: http://cpp.sh/3zgxa

JavierSO
  • 15
  • 3
  • If I remove from the SELECT query the part " INTO MEMORY "+HDFql.variableGetNumber(values)) the code works correctly and I can execute it as many times as I want, from buttons or navigating several times. Logically I don't get the java results of the query, but the access to the HDFql is done correctly. – JavierSO Jul 01 '20 at 08:33
  • What is the value returned by method `HDFql.variableGetNumber(values)`? Is it the same returned when you registered the variable `values` using method `HDFql.variableRegister` or `HDFql.variableTransientRegister`? Is variable `values` assigned to new memory between the time it is registered until it is used in method `HDFql.variableGetNumber`? Is your dataset changing dimensions and/or datatype in the meantime? The answers to these questions will help better debug the issue you are facing. – SOG Jul 01 '20 at 13:28
  • Hello, the value in both cases is 0, it doesn't change and the dataset doesn't change either, neither the dimensions nor the content. "I've solved the problem" by removing the record of the variable INTO memory from the query. Now I execute the query and then I iterate it with the cursor, this way everything works correctly.https://gyazo.com/053431ee89950ddd70e0406fa63177ea @SOG, Thanks a lot for the help! – JavierSO Jul 02 '20 at 05:19