SQLite3 is crashing the JVM

0

I am using sqlite-jdbc 3.7.2 when i run my application, SQLLite is crashing the JVM. It is not happening consistently but it happened twice. Please help to find the issue.

A fatal error has been detected by the Java Runtime Environment:
SIGSEGV (0xb) at pc=0x01c60d18, pid=5731, tid=5888912

JRE version: Java(TM) SE Runtime Environment (8.0_65-b17) (build 1.8.0_65-b17)
Java VM: Java HotSpot(TM) Server VM (25.65-b01 mixed mode linux-x86 )
Problematic frame:
C  [sqlite-3.7.2-libsqlitejdbc.so+0x34d18]

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

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.

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

Current thread (0x0a9b7000):  JavaThread "Event Handler" daemon [_thread_in_native, id=17400, stack(0x0054d000,0x0059e000)]

siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x00000044

Registers:
EAX=0x00000000, EBX=0x01c9bfc4, ECX=0x00000000, EDX=0x00000000
ESP=0x0059c784, EBP=0x0059c798, ESI=0x0a766b80, EDI=0x011d1280
EIP=0x01c60d18, EFLAGS=0x00010216, CR2=0x00000044

Top of Stack: (sp=0x0059c784)
0x0059c784:   0a766b80 0059c798 01c60d10 01c9bfc4
0x0059c794:   00000000 0059c7b8 01c60dfa 01c9b860
0x0059c7a4:   011d1280 0059c7b8 01c60de7 01c9bfc4
0x0059c7b4:   0a9b7138 0059c7e8 01c34268 0a766b80
0x0059c7c4:   00000004 0059c808 0a9b7000 00000000
0x0059c7d4:   00000006 0a9b7000 00000000 0059c804
0x0059c7e4:   0a9b7000 0059c818 a957f81b 0a9b7138
0x0059c7f4:   0059c804 0a766b80 00000000 00000004 

Instructions: (pc=0x01c60d18)
0x01c60cf8:   1b 1d fd ff 81 c3 c8 b2 03 00 85 c0 74 1d 8b 50
0x01c60d08:   58 8b 00 e8 d8 f4 ff ff 83 ec 0c 89 46 58 8b 06
0x01c60d18:   ff 70 44 e8 54 17 fd ff 83 c4 10 8d 65 f8 5b 5e
0x01c60d28:   5d c3 55 89 e5 56 8b 55 0c 53 8b 45 08 e8 dd 1c 

Register to memory mapping:

EAX=0x00000000 is an unknown value
EBX=0x01c9bfc4: <offset 0x6ffc4> in /tmp/sqlite-3.7.2-libsqlitejdbc.so at 0x01c2c000
ECX=0x00000000 is an unknown value
EDX=0x00000000 is an unknown value
ESP=0x0059c784 is pointing into the stack for thread: 0x0a9b7000
EBP=0x0059c798 is pointing into the stack for thread: 0x0a9b7000
ESI=0x0a766b80 is an unknown value
EDI=0x011d1280: <offset 0x54c280> in     /usr/java/jre1.8.0_65/lib/i386/server/libjvm.so at 0x00c85000


Stack: [0x0054d000,0x0059e000],  sp=0x0059c784,  free space=317k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [sqlite-3.7.2-libsqlitejdbc.so+0x34d18]
C  [sqlite-3.7.2-libsqlitejdbc.so+0x34dfa]  sqlite3_column_text+0x2e
C  [sqlite-3.7.2-libsqlitejdbc.so+0x8268]  Java_org_sqlite_NativeDB_column_1text+0x2a
J 3028  org.sqlite.NativeDB.column_text(JI)Ljava/lang/String; (0 bytes) @ 0xa957f81b [0xa957f6c0+0x15b]
J 3100 C2 org.sqlite.RS.getString(Ljava/lang/String;)Ljava/lang/String; (10 bytes) @ 0xa95da894 [0xa95da820+0x74]
sqlite
jvm
asked on Server Fault May 22, 2017 by Mohan • edited May 22, 2017 by Tero Kilkanen

1 Answer

0

Looks like the error occurs when the jvm or .so (not sure which) attempts to do IO on a memory-mapped file:

Register to memory mapping:

EAX=0x00000000 is an unknown value
EBX=0x01c9bfc4: <offset 0x6ffc4> in /tmp/sqlite-3.7.2-libsqlitejdbc.so at 0x01c2c000

The memory mapping is getting munged. Make sure you have enough space in your /tmp directory and that you don't have conflicts with other programs modifying this area.

You can also use a dedicated temp directory to avoid conflicts and manage disk space using the java directive -Djava.io.tmpdir=[custom directory]. Example:

java -Djava.io.tmpdir=/home/appuser/localtmp [other command arguments]
answered on Server Fault May 22, 2017 by Diogenes deLight

User contributions licensed under CC BY-SA 3.0