
#OPENSOURCE DBX VIEWER CODE#
So with just two commands, you've pinpointed the program that faulted as well as the area of programming code that caused the fault. Sometimes dbx points to a location in a specific file sometimes it points to an offending function. An assert is simply a reaction to a Boolean expression that should always be true a "false" reaction will generate a fault, causing the core dump and the executable to fail. In this case, we have a failed assert called from the frame.c file. ?, internal error: assertion failed at line 3915 in file frame.c But where in the programming code of that executable did the fault happen? To determine this, issue the dump command: (dbx) dumpĮxtend_brk(internal error: assertion failed at line 3915 in file frame.c The identified process will, of course, point back to the executable having problems. To determine which program caused the dump, enter the corefile command at the (dbx) prompt: (dbx) corefileįlags: FULL_CORE | CORE_VERSION_1 | UBLOCK_VALID | USTACK_VALID | LE_VALIDĪt this point you'll be presented with several lines of information, including the name of the process that core dumped, the signal that caused the core dump - in this case a segmentation violation (SEGV pr) most core dumps are generated by this signal - and whether the process was executing in 32- or 64-bit mode. This is where you'll enter all of your commands. The last line of the output (dbx) is the dbx utility's command prompt.

However, this information can be a bit nebulous, so it's often worth digging deeper. If you're only looking to identify the program that caused the dump, most of the time, this screen will give you your answer. Note the object file name in line 3 it will likely point to the executable that caused the core dump. This initial screen above is basically a summary of the conditions in memory at the time of the core dump. In this example, I'm using a core dump that was generated on a system I was working on that was using a 32-bit version of Perl and had recently been updated to AIX 7.1. The core file doesn't exist in the current directory or doesn't match with Warning: Object file is not specified, and the object file "perl5.10.1" mentioned in Your output will be similar to this: dbx -C. Here's how: To start your examination, change your working directory to its location and call up the debugger on the core file: dbx -C. And yes, dbx can be used to examine core dumps. It has many uses, from providing a controlled environment for running programs to diagnosing misbehaving processes live and giving you the ability to step through a program one line at a time.

Part of the fileset, dbx is usually installed by default. The dbx utility is a standard debugger that ships with AIX it's included on the operating system distribution DVDs. By entering a few commands, you'll not only know which program caused the core dump, but also the file or function that lies at fault and the working thread that was interrupted.įirst, you need the proper tool to examine your core dump. Seriously, this information can be gathered in about 10 minutes. So how do you access this data? It can actually be done quickly and fairly easily.

That's a wealth of data that, if diagnosed, could help you avoid future core dumps. And that's unfortunate.Ĭore dumps contain a snapshot of the memory address space for an application - or a database, utility or middleware - at the time of the event that caused the core dump to happen. Meanwhile, the core dump will sit in its archive, forgotten about. You'll dutifully inform your application developers or DBAs about the location of the core dump and when it occurred, and then move on to other duties. Of course, about half the time, core dumps aren't flagged, so other methods must be used to discern their cause, such as examining them with a utility like strings or some other reader.Ĭhances are, that's as far as you'll get. This leaves you to try to puzzle out their cause from information contained in the AIX error log. If you're like most UNIX administrators, you probably have a crontab or some other housekeeping program that regularly searches your systems for core dumps, backs them up (maybe), and then deletes them.
