Friday, July 18th 2008, 11:33pm UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, May 12th 2008, 8:21am

How do I rectify this segmentation fault

When I am running a QT Application, the application is segmenting with the following message ? What does this message actually mean , How do I
rectify this?


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912499279680 (LWP 863)]
0x0000003e795007d2 in QApplication::internalNotify () from /usr/lib64/qt-3.3/lib/libqt-mt.so.3


Thanks in advance.
  • Go to the top of the page

2

Monday, May 12th 2008, 10:48am

RE: How do I rectify this segmentation fault

probably accessing a uninitialized pointer

you could, for instance, obtain such an error with

Source code

1
2
3
int * a = NULL;
// ...
*a = 0;

or

Source code

1
2
3
4
5
int * a = new int;
// ...
delete a;
// ...
*a = 0;

or

Source code

1
2
3
int * a = new int [10];
// ...
a[12] = 0;

or ... many other erronous code

compile with debug

verify a core file is generated
if not, parameter your Linux (I don't remember exactly where)
- /etc/sysctl.conf
kernel.core_pattern
kernel.core_uses_pid
- ~/.bashrc
ulimit -c unlimited

rerun
after crash run: kdbg|gdb yourApp generatedCoreFile
you will obtain a call stack, be abble to move in this call stack and to examine variables at crash time
Nicolas

This post has been edited 5 times, last edit by "Nicolas SOUCHON" (May 12th 2008, 11:49am)

  • Go to the top of the page

Rate this thread