Java routines fail with SQL1131N if SED is enabled on AIX systems.
All Java routines always fail with SQL1131N, db2diag.log shows the db2fmp process is not responding, or errpt shows db2fmp died with SIGILL.
Users may receive SQL1131N or SQL1042C if he/she is trying to run a routine which involves Java VM, please note that non-Java routines may involve Java VM for example, db2_install_jar() routine.
The following db2diag.log entry may be observed, which implies db2fmp died with SIGILL.
2013-06-20-15.50.09.466013+060 E3765132A398 LEVEL: Error
PID : 32702618 TID : 258 PROC : db2wdog
INSTANCE: db2inst1 NODE : 000
EDUID : 258 EDUNAME: db2wdog
FUNCTION: DB2 UDB, base sys utilities, sqleChildCrashHandler, probe:5461
DATA #1 : <preformatted>
A non-EDU child crashed Process id: 23593056, OSS term code: 0x101,
A DB2 fenced mode process for Java routines (db2fmp (Java)) will be launched when a user invokes a Java routine for the first time after instance startup. The db2fmp process tries to load a Java VM into the process by calling JNI_CreateJavaVM(). Such a request will fail if stack execution disable (SED) is enabled on the AIX system. You can determine the SED settings on your system by using the sedmgr command, as shown below:
Stack Execution Disable (SED) mode: select
SED configured in kernel: select
All Java routines will fail with SQL1131N if SED mode is set to 'setidfiles' or 'all' because the SED feature will prevent the running of Just-In-Time (JIT) compiled code. The Java manual says that users need to exempt the Loader (db2fmp in this case) from SED so that JIT runs properly.
The Just-In-Time (JIT) compiler
In many systems, this problem does not come up because SED mode is set as 'select' by default.
NOTE: A script provided by PowerSC can modify the SED settings to setidfiles, then it causes this problem.
Resolving the problem
Users can choose one of the following workarounds.
a) Exempt db2fmp from SED feature.
NOTE: This steps will modify the program header of the db2fmp executable, so users need to stop the DB2 instance first so that sedmgr command can update the db2fmp executable.
1. Login to the AIX system as root
2. Run sedmgr to exempt db2fmp executable from SED.
# sedmgr -c exempt <path_to_db2fmp_executable>
# sedmgr -c exempt /home/db2inst1/sqllib/adm/db2fmp
# dump -X64 -ov /home/db2inst1/sqllib/adm/db2fmp
***Object Module Header***
# Sections Symbol Ptr # Symbols Opt Hdr Len Flags
4 0x00006a08 673 120 0x1082
Flags=( EXEC DYNLOAD DEP_EXEMPT )
Timestamp = "Mar 31 16:29:22 2011"
Magic = 0x1f7 (64-bit XCOFF)
b) Change system wide SED settings so that db2fmp can execute JIT code.
1. Login to the system as root.
2. Run sedmgr to change system wide SED settings, you need to restart the system.
# sedmgr -m select
# shutdown -Fr
1. Login to the system as DB2 instance owner.
2. Set environment variable to disable JIT compiler.
$ export JAVA_COMPILER=none
$ db2set DB2ENVLIST=JAVA_COMPILER
More support for:
DB2 for Linux, UNIX and Windows
Routines (SP & UDF) - Java
Software version: 9.1, 9.5, 9.7, 10.1, 10.5
Operating system(s): AIX
Reference #: 1573065
Modified date: 18 November 2015