Could you copy/paste the functions stack pointing to the assert() call. Under gdb, simply type 'bt'. On visual studio you can go up down the stack of functions from the UI.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Could you copy/paste the functions stack pointing to the assert() call.
Under gdb, simply type 'bt'. On visual studio you can go up down the stack
of functions from the UI.
well this log file is extremely hard to read, I would have prefered a neat backtrace. Anyway, I found it suspcious that you have : C:\Program Files\Java\jdk1.8.0_121\jre\bin\gdcmDSED.dll
Are you sure you've installed the latest gdcm over there as well ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I build the solution after Cmake and get all dlls and gdcm.jar and put them in C:\Program Files\Java\jdk1.8.0_121\jre\bin so what is the problem of gdcmDSED.dll
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I got a new information, I am scanning a file which has name "Testkopf_Dr._Jürgens".
In C++ CanRead() returns false but in java it terminates the program but when I remove this letter "ü" from the file name every thing is ok.
for you information :
I am building the version of the branch called release where you remove assert from CanRead().
Concerning the backtrace I can't do this in java as I know.
Thanks very much.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Great ! At least you are able to debug your dll now. Could you please add a breakboint in gdcm::Reader::SetFileName. And tell me what is going on there? I suspect std::ifstream::open does not work... technically it should since it is documented here:
Strings in the Java virtual machine consist of Unicode characters, whereas native strings are typically in a locale-specific encoding. Use utility functions such as JNU_NewStringNative (§8.2.1) and JNU_GetStringNativeChars (§8.2.2) to translate between Unicode jstrings and locale-specific native strings of the underlying host environment.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The value of wfilename is "敔瑳潫晰䑟䩟볃杲湥癯x﷽﷽" which is incoreect.
For bytes comparison there is one extra byte when using the java/jstring conversion from unidode resulting from using "getBytes" function for the letter "ü".
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Could you please add the backtrace.
sorry I can't understand you
On 18 May 2017 at 12:26, Mathieu Malaterre malat@users.sf.net wrote:
Could you copy/paste the functions stack pointing to the assert() call. Under gdb, simply type 'bt'. On visual studio you can go up down the stack of functions from the UI.
In C++ no problem but using java wrapper the CanRead() function terminates
the program
On 18 May 2017 at 21:33, Mathieu Malaterre malat@users.sf.net wrote:
Related
Bugs:
#420well then just attach the debugger to your java program.
Here is the back trace :
A fatal error has been detected by the Java Runtime Environment:
EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffa7c3b8b08, pid=6964, tid=0x0000000000001d80
JRE version: Java(TM) SE Runtime Environment (8.0_121-b13) (build 1.8.0_121-b13)
Java VM: Java HotSpot(TM) 64-Bit Server VM (25.121-b13 mixed mode windows-amd64 compressed oops)
Problematic frame:
C [gdcmDSED.dll+0x58b08] gdcm::Reader::CanRead+0x58
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:
E:\Hossam\Source Code\OsseoView Beta 5\ov\hs_err_pid6964.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 problematic frame for where to report the bug.
you forgot to attach the file: hs_err_pid6964.log
Here you are
well this log file is extremely hard to read, I would have prefered a neat backtrace. Anyway, I found it suspcious that you have : C:\Program Files\Java\jdk1.8.0_121\jre\bin\gdcmDSED.dll
Are you sure you've installed the latest gdcm over there as well ?
I build the solution after Cmake and get all dlls and gdcm.jar and put them in C:\Program Files\Java\jdk1.8.0_121\jre\bin so what is the problem of gdcmDSED.dll
So in summary:
I cannot help much. So I am closing until you can provide meaningful inputs.
I got a new information, I am scanning a file which has name "Testkopf_Dr._Jürgens".
In C++ CanRead() returns false but in java it terminates the program but when I remove this letter "ü" from the file name every thing is ok.
for you information :
I am building the version of the branch called release where you remove assert from CanRead().
Concerning the backtrace I can't do this in java as I know.
Thanks very much.
unicode support in java has been added in 2011, see commit: https://sourceforge.net/p/gdcm/gdcm/ci/24746bf1
so I don't know why this problem occurs although unicode is supported from 2011.
I got the problem after debugging in Win32 mode.
In file gdcmJAVA_wrap.cxx the function JNU_GetStringNativeChars .
For file name "Testkopf_Dr.Jürgens" when we call this line
so we get two bytes for "ü" and after this lines
so we end up by result = "Testkopf_Dr.Jürgens.ovx" so in CanRead function
so Stream=Null and we can't call is.bad().
This is the full description of the error.
What is your opinion?
Great ! At least you are able to debug your dll now. Could you please add a breakboint in
gdcm::Reader::SetFileName. And tell me what is going on there? I suspectstd::ifstream::opendoes not work... technically it should since it is documented here:http://www.cognaxon.com/cached/support/java/pitfalls.html
10.10 Disregarding Internationalization
Strings in the Java virtual machine consist of Unicode characters, whereas native strings are typically in a locale-specific encoding. Use utility functions such as JNU_NewStringNative (§8.2.1) and JNU_GetStringNativeChars (§8.2.2) to translate between Unicode jstrings and locale-specific native strings of the underlying host environment.
In gdcm::Reader::SetFileName
as you expect returns false
The problem as I see is in "getBytes" function in java
I cannot help much from over here. Could you try the following dumb patch to see if the wchar_t API is working for you:
The next step is to compare the series of bytes when using direct C++ code and when using the java/jstring conversion from unicode... good luck :)
The value of wfilename is "敔瑳潫晰䑟䩟볃杲湥癯x﷽﷽" which is incoreect.
For bytes comparison there is one extra byte when using the java/jstring conversion from unidode resulting from using "getBytes" function for the letter "ü".
tons of unicode fix have been made lately.