0

I have a Java application which uses several native libraries through JNA. The application works fine on many different systems. However, on Ubuntu 10.04 LTS - 32bit when I close the application a segmentation fault occurs. 64bit works fine and the error does not occur on other 32bit distributions. Windows works fine too. The segmentation fault occurs in the delete function of glibc within an empty destructor.

The problem is solved, if I increase the maximum stack size of the JVM to 32mb (e.g. java -Xss32m ...)

Does anyone have an idea why this error only happens on Ubuntu 10.04 32bit? I have tested several distribution within a VM.

I am using Java 8 and the default maximum stack size is 4MB. I dont know if this is relevant to the JVM, but ulimit -s is 8MB.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
retro009
  • 23
  • 1
  • 4
  • 1
    @ArunAS: "native libraries" are typically written in C or C++. Apparently, here they are written in C++. – MSalters Dec 12 '17 at 15:27
  • The option to support 4MB stack sizes was [deprecated in linux kernel 2.6.37](https://elinux.org/Kernel_Small_Stacks). I recall kernel version 2.6.32 being around with Ubuntu 10.04. Could it just be that the 4MB stack size is too small? – cbr Dec 14 '17 at 17:31
  • Do you have a stack trace for the crash? Do you have outstanding JNA-allocated memory at exit? – technomage Jan 20 '18 at 05:58

0 Answers0