JVM在我们的SIGSEGV服务器中不时意外崩溃。我们正在使用JNI调用一些C函数,这些函数最终使用ECPG与postgres db进行通信。
这是一个堆栈跟踪供参考:
Stack: [0xa895e000,0xa89af000], sp=0xa89ab550, free space=309k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libpq.so.5+0x1a42c] resetPQExpBuffer+0x2c
C [libpq.so.5+0x1a46f] printfPQExpBuffer+0x1f
C [libpq.so.5+0x10b1a] PQgetResult+0xea
C [libpq.so.5+0x10c97]
C [libpq.so.5+0x110e7] PQexec+0x27
C [libecpg.so.6+0x506f] ECPGdo+0xc5f
C [libvcswsilib.so+0x9b914] get_codes_info+0x4eb
C [libvcswsilib.so+0x4b4c8] getCodes(CConference*, CUser const&)+0xc8
C [libvcswsilib.so+0x4d06d] CConf::GetFromDatabase(CUser const&, std::string const&)+0x203
C [libvcswsilib.so+0x4ce0f] CConf::GetFromDatabaseViaEitherCode(CUser const&, std::string const&)+0xd7
C [libvcswsilib.so+0x3acac] getCommon(CUser&, std::string const&, std::string&)+0x45
C [libvcswsilib.so+0x3b56e] getCred(std::string const&, std::string&)+0x107
C [libvcswsilib.so+0x376fa] WebServiceImpl_getCredJNI+0x78
j WebServiceImpl.getCredJNI(Ljava/lang/String;)Ljava/lang/String;+0
j WebServiceImpl.getInfo(Ljava/net/InetSocketAddress;Lcom/Lis tener;Ljava/util/HashMap;)Ljava/lang/String;+51
j MessageProcessor.processInfo(Lcom/wss/MessageProcessor$MessagePacket;)V+47
j MessageProcessor.processMessage(Lcom/wss/Manager$MessagePacket;Ljava/lang/String;)V+79
J 388% C2 Manager.run()V (257 bytes) @ 0xf4737b9c [0xf47370c0+0xadc]
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub
V [libjvm.so+0x459d54]
V [libjvm.so+0x61b129]
V [libjvm.so+0x45923a]
V [libjvm.so+0x45936b]
V [libjvm.so+0x4a4ffc]
V [libjvm.so+0x73b040]
V [libjvm.so+0x73b339]
V [libjvm.so+0x622689]
C [libpthread.so.0+0x6b39] start_thread+0xc9
我们已经扫描了本机和Java代码,但没有找到可能导致此问题的任何内容。对ECPG或postgres的工作没有太多了解。
非常感谢任何有关调试问题的帮助/想法。