== DEBUGGING CORE FILES  == STACK TRACE <-> SOURCE CODE [EXAMPLE 1]
C program : example1.c [see at the end of entry]
Platform : AIX
Compilation: cc -q64 example1.c -o example1
Execution : ./example1 example1.c 99
# example1 example1.c 99
Let's load the core file and print the stack:
# dbx example1 mycore
Type 'help' for help.
[using memory image in mycore]
reading symbolic information ...warning: no source compiled with -g
Segmentation fault in gettimeofday... [More]
== DEBUGGING CORE FILES  == STACK TRACE <-> SOURCE CODE
We know now what is a stack trace, what help it can provide and how
to read it. When a program is compiled with -g the stack trace will
usually contain the line number in the source file. In that case it
is quite easy to find the exact location in the source.
It becomes a bit more complicated when the program was not compiled
with -g and most of the time this is the case. To add to this many
other things can make your quest even harder, to name a few only:
== DEBUGGING CORE FILES  == STACK TRACE
Now we know how to package, ship and load a core file. Question now is
what can we do with it? Most likely anyone who is a bit familiar with
C programming heard about 'stack'. But what is it really and how can
it help when it comes to core file analysis?
The 'stack' is a memory region dedicated to functions. It will provide
storage for function's local variables as well as storage for special
variables that will be used to guarantee flawless calls and returns
== DEBUGGING CORE FILES  == HOW TO LOAD A CORE FILE IN A DEBUGGER?
Once you have packaged the core file with all the objects required you
need to load it into the debugger. If you are running the debugger on
the same machine as the one where the core file was generated then
not much of an issue, the debugger should be able to locate all required
objects. However, if you are running the debugger on a different machine
then you need to tell the debugger where to find the objects.
So let's see how we can load the core file in... [More]
== DEBUGGING CORE FILES  == HOW TO PREPARE A CORE FILE FOR ANALYSIS?
As we mentioned before the core file contains almost all regions that
the running process had in it's address space. But not all. Among the
missing ones are the 'text' regions. Those regions contains the various
instructions that the process would execute. As well, the symbol tables
that allow the debugger to print function names, are not included in
the core file.
Since viewing the assembly code (unless you compiled with -g) will
most likely be a... [More]
== DEBUGGING CORE FILES  == WHAT IS A CORE FILE?
A core file is the (almost complete) image of the running process in memory.
Core files can be created on demand using gencore, gcore or other commands
but most of the time they are the result of a fault in the executing program.
They are useful for finding what was wrong at the time a process crashed
because they provide us with access to most of the data that the program
was using when it crashed.
While the internal format of a core file will depend based on the machine
Can I use online backup to encrypt an existing database ? The answer is YES . Converting a database to be encrypted is a kind of big change. Therefore, I still strongly suggest to take an offline backup before the change if business permits the outage time to do that. On the DB2 knowledge center page " Encrypting an existing database ", it shows the example steps using an offline backup. But that does not necessarily mean we can only use the offline backup. On this blog, I will show some sample steps using online... [More]
Recently following simple guidelines helped customers to get rid of corrupted pages easily. So, just putting it here in case it helps. Customer's db2 inspect output was showing following kind of corruptions, DATABASE: TESTDB VERSION : SQL09053 2018-02-01-14.45.44.077383 Action: CHECK TABLE Schema name: DB2INST1 Table name: MY_TAB Tablespace ID: 3 Object ID: 580 Result file name: badpage.out Table phase start (ID Signed: 580,... [More]
Question: Why does db2icrt fail on Linux? It was able to run without any error and an instance was created one year ago. Answer: Here is the steps and result. As root user: --- [root]# useradd testuser [root]# su - testuser [testuser]$ exit [root]# /opt/ibm/db2/V10.5/instance/db2icrt -d -u testuser testuser DBI1446I The db2icrt command is running. DBI1264E This program failed. Errors encountered during execution were written to the installation log file. Program name: db2icrt. Log file name: ... [More]
It is a HADR system set up with near_sync mode. This server has been running well for several years with version V9.7 FixPack7 even though the user already know the storage on standby side could be a bottleneck. At the beginning of this year 2018, the user upgraded Db2 to V10.5, the problem happened since then. The log gap kept on increasing, and standby can never catch up with primary. Collected stacks from standby, found hadrs EDU was busy on writing log to disk: 0x0900000000037B18 pwrite64 + 0x38 0x090000002817CF4C... [More]
Sometimes db2 stack traces on Solaris can be misleading as the function
name we see on the stack is not the name of the function that was called.
This might happen when a 'static' function is called. It has to do with
the fact that 'static' functions do not have 'global' entries in the
For example, if you have a source file containing functions like this:
static int function2()
If some function calls 'function2()'... [More]
As an experienced DB2 DBA, you are familiar with HADR and applying DB2 fixpack by rolling maintenance. Now pureScale with HADR clusters system. What are you going to do ? From DBA’s perspective, it’s always better to have enough service down maintenance time window. But if your critical business does not permit this way for 24/7 operation requirement, we will have to implement appropriate steps without service interruption. So I’m writing this blog assuming you have to complete the mission without taking down... [More]
We have seen some cases recently where the we see following messages frequently written into the db2diag.log for purescale environments : 2018-01-10-03.35.00.656437+540 I8443A1349 LEVEL: Error PID : 18153532 TID : 3193 PROC : db2sysc 1 INSTANCE: db2inst1 NODE : 001 HOSTNAME: host0005 EDUID : 3232 EDUNAME: db2pdbc 1 FUNCTION: DB2 UDB, fast comm manager, sqkfChannel::DeliverInboundBuffer , probe:4717 DATA #1 : String, 51 bytes Invalid Sequence No. Detected = 2. Expected No. = 1 DATA #2 :... [More]
When your SSL certificate is about to expire or already expired you generate/create a new one. To make this new/revised certificate effective and for DB2 to use it, DB2 needs to be recycled (db2stop/ db2start) . References : Infocenter link : https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.db2.luw.admin.sec.doc/doc/t0025241.html Step by step instructions : Secure Sockets Layer (SSL) support in DB2 for Linux, UNIX, and Windows... [More]