IBM Support

SIGILL (UNIX) application crash or hang (Windows) when DB2 libraries dynamically load or unload

Question & Answer


Question

This document provides troubleshooting information when an application crashes with a SIGILL (illegal instruction) error or hang when DB2® libraries are dynamically loaded or unloaded.

Cause


Applications that dynamically load and unload the DB2 library before the application terminates might crash when calling the DB2 exit handler. This crash might occur because the application attempts to call a function that does not exist in memory.

Note: The DB2 UDB® v8.2 documentation regarding DB2NOEXITLIST and DB2_COMMIT_ON_EXIT is incorrect, refer to APAR IY94213 listed in the Related URL section for details.

An application that crashed due to this problem may contain the function stack below:

Illegal instruction (illegal opcode) in . at 0x0 ($t75) in . at 0x0 ($t75)
0x00000000
.() at 0x0
exit(??) at 0xd031bab0 [³”F‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ: /usr/lib/libc.a(shr.o)]
xmExitJVM(??, ??) at 0xd334dbf8
JVM_Halt(??) at 0xd32d6208
Java_java_lang_Shutdown_haltImpl(??, ??, ??) at 0xd1a79e44
mmipInvoke_I_V(0x451516a8, 0x45482ea4, 0x1, 0x459b0904) at 0xd330ca68
mmipInvokeLazyJniMethod(??, ??, ??, ??) at 0xd3304c3c
mmipExecuteJava(??, ??) at 0xd32e1620
mmijExecuteJavaFromJIT(??, ??) at 0xd3302dd8
invokerFromJIT() at 0xd348e28c

On Windows platform one symptom may be a hang inside an application which uses the ODBC interface. The hang may contain the following stack.



ntdll_77060000!NtWaitForSingleObject+0x15
mswsock!SockWaitForSingleObject+0x1ba
mswsock!WSPRecv+0x2a7
ws2_32!recv+0x87
WARNING: Stack unwind information not available. Following frames may be wrong.
db2tcp+0x6ff4
db2tcp+0x6058
db2app!sqlccrecv+0x194
db2app!sqljcReadGetPtrInt+0x2318
db2app!sqljrDrdaArDisconnect+0x906e
db2app!sqljrDrdaArDisconnect+0x1a1
db2app!sqleUCdisconnect+0x64
db2app!sqleUCsetConnOpts+0x1451
db2app!sqleckcon+0x191
db2app!sqleInitApplicationEnvironment+0xca7
db2app!sqleInitApplicationEnvironment+0xb34
db2app!sqleInitApplicationEnvironment+0x9f6
db2sys!sqlostartsession+0x415
db2sys!sqlv_trc_zvalue+0x184
ntdll_77060000!LdrpCallInitRoutine+0x14
ntdll_77060000!LdrShutdownProcess+0x1aa 

Answer

Since DB2 cannot determine whether a customer application will dynamically load and unload the DB2 library, the following procedure should be followed to set the DB2 registry variable DB2NOEXITLIST and avoid any crashes caused by SIGILL.

  1. Run the command: db2set DB2NOEXITLIST=ON
  2. Verify that the fix pack level of the DB2 installation includes the APARs related to DB2NOEXITLIST. For the complete list, refer to the Related URL section.
  3. Restart the instance if the application is using a non-client DB2 instance using db2stop and db2start.

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Programming Interface - CLI","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF033","label":"Windows"}],"Version":"9.7;9.5;9.1;8.2","Edition":"Enterprise Server;Express;Personal;Personal Developer's;Workgroup Server","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21255377