1

I have a Fortran code that my client give me many month ago, we have done C implementation (JNI) with declaration of Fortran as an extern method and then we can call fortran from C and now we can call C from JAVA.

It work very well (almost :)) in fact in 1 of 8 library, sometime we have a segfault with

Stack: [0x00007f1ea63fc000,0x00007f1ea6afd000],  sp=0x00007f1ea6af8f30,  free space=7155k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libCMordor.so+0x5240]  long double restrict+0xcac
C  [libCMordor.so+0x1f84]  unsigned long+0xbc8

I don't know what can cause a long double restrict ?

value of a result is bigger than a long double? or something else?

if someone can help me to show me the good way to find my solution, i will appreciate.

thaks a lot.

PS: i don't want to know if my code is ok or not because all work fine from many month, so i don't post code here, but i just want to know potential cause of long double restrict problem ;)

EDIT1

Finally i find my solution i guess.

I have put log into fortran and for a reason i don't understand now, because code is not from me and i don't know anything about fortran, i have a value that was 1 in many time and sometime this value is 1078334587, so i will re-send the code to the client and the man who wrote this code can correct this.

I think its a non initialized value that was get from fortran and the adress contain a big value in memory and cause sigsev!

  • You took a look at [this](http://stackoverflow.com/questions/28403852/jvm-crash-due-to-sigsegv)? – Youka Aug 26 '15 at 14:08
  • yes i find 2 or 3 subject about this on stack overflow but no one explain clairly long double restrict. all subject give solution to try to resole the segfault problem, but it s too generic, me i want to understand the root cause before test all the different way. And finally i have add log in the fortran code, and i see that a value in many case is 1 and for any reason this value become '1078334587' i think it was a value in memory that is not reinitialize. but with this i think problem is that the value is bigger than the object and cause sigsev. – Mançaux Pierre-Alexandre Aug 27 '15 at 06:59

1 Answers1

0

finaly the problem here was a non-initialized variable in fortran! The variable took the value in memory and say "long double restrict" and send SIGSEV signal. I have initialize the value and all work fine now. to find this problem, because its not my code, i put write in it to show me where is the problem.

And this explain why the program work fine randomly.