X
74 Rate this article:
No rating

[Internal] Using GDB to debug an IDL Segmentation Fault

Zachary Norman

Introduction

Wikipida: "the GNU Debugger, usually called just GDB and named gdb as an executable file, is the standard debugger for the GNU operating system. However, its use is not strictly limited to the GNU operating system; it is a portable debugger that runs on many Unix-like systems and works for many programming languages, including AdaCC++Objective-CFree PascalFortranJava and partially others." Read more about it here:

http://en.wikipedia.org/wiki/GNU_Debugger

This help article shows a way to debug the IDL application (command line IDL only) using GDB in a Unix/Linux system (including Mac OS X).


Scenario

The following scenario may occur: 

  • IDL is invoked from the Linux prompt
  • then, a segmentation fault happens instantly. 

The Linux terminal shows, for example:

IDL Version 6.4 (linux x86 m32). (c) 2007, ITT Visual Information Solutions
Segmentation fault (core dumped)


Debugging the Seg. Fault.

The GDB debugger can be used to know more about what the issue is in the case of the seg. fault explained above. This is important, because most of the time a seg. fault doesn't explicitly shows an error message that can be used to find what the exact issue was.

The idea is to start first the debugger and from their start IDL:

1- in the linux prompt type the following:

cd /usr/local/itt/idl64/bin/bin.linux.x86/

gdb ./idl

2- From the GDB prompt type "run" to start debugging the IDL executable:

(gdb) run

3- The following is an example of what can be seeing when GDB starts and the output message that appears in the Linux console:

(gdb) run

Starting program: /opt/itt/idl64/bin/bin.linux.x86/idl

[Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

IDL Version 6.4 (linux x86 m32). (c) 2007, ITT Visual Information Solutions [New Thread 0xf706db40 (LWP 7977)] [New Thread 0xf686cb40 (LWP 7978)] [New Thread 0xf606bb40 (LWP 7979)] [New Thread 0xf586ab40 (LWP 7980)] [New Thread 0xf5069b40 (LWP 7981)] [New Thread 0xf4868b40 (LWP 7982)] [New Thread 0xf4067b40 (LWP 7983)]

Program received signal SIGSEGV, Segmentation fault.

0xf35f9caa in _nv015tls () from /usr/lib32/nvidia-current-updates/libnvidia-tls.so.304.88

The last line in the above output points to the culprit. The system library where the problem is located is called libnvidia-tls.so.304.88. In this example, changing this library fixed the issue.