PDA

View Full Version : segmentation fault error



sagi
24th July 2008, 06:10
i have installed Qt 4 on slackware 12.1 without GUI , the installation has done successfully qmake -project, qmake, make everything working fine. while executing the output script getting segmentation fault it doesnt show any errors.

Just I have tried :confused::confused: sample program to verify the installation.

Here is the code


#include <QCoreApplication>
#include <QtDebug>
int main(int argc,char*argv[])
{
qDebug()<<"WithinMain";
QCoreApplication app(argc,argv);
qDebug ()<<"Running";
return app.exec();
}

Output
within main
Segmentation fault

what could be the wrong? Please help me


root@myami:/home/pr# ldd pr
linux-gate.so.1 => (0xbfffe000)
libQtGui.so.4 => /usr/local/Trolltech/Qt-4.4.0/lib/libQtGui.so.4 (0xb765b000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb75e8000)
libXext.so.6 => /usr/lib/libXext.so.6 (0xb75da000)
libX11.so.6 => /usr/lib/libX11.so.6 (0xb74f3000)
libQtCore.so.4 => /usr/local/Trolltech/Qt-4.4.0/lib/libQtCore.so.4 (0xb72b9000)
librt.so.1 => /lib/librt.so.1 (0xb72af000)
libdl.so.2 => /lib/libdl.so.2 (0xb72ab000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb7294000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb71b0000)
libm.so.6 => /lib/libm.so.6 (0xb718a000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb717f000)
libc.so.6 => /lib/libc.so.6 (0xb7032000)
libz.so.1 => /usr/lib/libz.so.1 (0xb701e000)
libXau.so.6 => /usr/lib/libXau.so.6 (0xb701b000)
libxcb-xlib.so.0 => /usr/lib/libxcb-xlib.so.0 (0xb7019000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb7002000)
/lib/ld-linux.so.2 (0xb7f30000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb6ffc000)

installation path: /usr/local/Trolltech/Qt-4.4.0/

Thanks in advnace
Sg..

jpn
24th July 2008, 17:32
Could you show us the backtrace from gdb?

sagi
25th July 2008, 05:37
Thanks a lot for your response.

I am an Linux admin so not aware of Qt programs, I need to install the Qt successfully

Here I post the output of gdb backtrace .. Please help me

root@myami:/home/qtscripts# gdb qtscripts
GNU gdb 6.6
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i486-slackware-linux"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run
Starting program: /home/qtscripts/qtscripts
warning: Cannot initialize thread debugging library: unknown thread_db error '22'
warning: Cannot initialize thread debugging library: unknown thread_db error '22'
warning: Cannot initialize thread debugging library: unknown thread_db error '22'
warning: Cannot initialize thread debugging library: unknown thread_db error '22'
warning: Cannot initialize thread debugging library: unknown thread_db error '22'
warning: Cannot initialize thread debugging library: unknown thread_db error '22'
warning: Cannot initialize thread debugging library: unknown thread_db error '22'
warning: Cannot initialize thread debugging library: unknown thread_db error '22'
warning: Cannot initialize thread debugging library: unknown thread_db error '22'
warning: Cannot initialize thread debugging library: unknown thread_db error '22'
warning: Cannot initialize thread debugging library: unknown thread_db error '22'
warning: Cannot initialize thread debugging library: unknown thread_db error '22'
warning: Cannot initialize thread debugging library: unknown thread_db error '22'

Program received signal SIGSEGV, Segmentation fault.
0x0de26093 in ?? ()

(gdb) bt
#0 0x0de26093 in ?? ()
#1 0xb6f33917 in gconv () from /usr/lib/gconv/UTF-16.so
#2 0xb6fe4c99 in __gconv () from /lib/libc.so.6
#3 0xb6fe42ce in iconv () from /lib/libc.so.6
#4 0xb73cf2bd in QIconvCodec::convertFromUnicode (this=0x8052568,
uc=0x8051efa, len=14) at codecs/qiconvcodec.cpp:242
#5 0xb73c97a7 in QTextCodec::fromUnicode (this=0x8052568, str=@0x8051f38)
at codecs/qtextcodec.cpp:1182
#6 0xb72eb81e in QString::toLocal8Bit (this=0x8051f38)
at tools/qstring.cpp:3059
#7 0xb732cb69 in locale_encode (f=@0x8051f38) at io/qfile.cpp:68
#8 0xb732c9aa in QFile::encodeName (fileName=@0x8051f38) at io/qfile.cpp:461
#9 0xb7376e22 in QFSFileEnginePrivate::nativeInitFileName (this=0x8051f28)
at io/qfsfileengine_unix.cpp:131
#10 0xb7371654 in QFSFileEngine (this=0x8051cd0, file=@0xbfc19b50)
at io/qfsfileengine.cpp:187
#11 0xb731e7ff in QAbstractFileEngine::create (fileName=@0xbfc19b50)
at io/qabstractfileengine.cpp:203
#12 0xb7333647 in QFileInfoPrivate::initFileEngine (this=0x8051c48,
file=@0xbfc19b50) at io/qfileinfo.cpp:140
#13 0xb7333bfa in QFileInfo (this=0xbfc19b48, file=@0xbfc19b50)
at io/qfileinfo.cpp:387
#14 0xb739d2ac in QCoreApplication::applicationFilePath ()
---Type <return> to continue, or q <return> to quit---
at kernel/qcoreapplication.cpp:1678
#15 0xb739dd0b in QCoreApplication::applicationDirPath ()
at kernel/qcoreapplication.cpp:1624
#16 0xb729b77c in QLibraryInfoPrivate::findConfiguration ()
at global/qlibraryinfo.cpp:138
#17 0xb729b957 in QLibrarySettings (this=0x8051c00)
at global/qlibraryinfo.cpp:109
#18 0xb729b9c6 in qt_library_settings () at global/qlibraryinfo.cpp:75
#19 0xb729babe in QLibraryInfo::location (loc=QLibraryInfo::PluginsPath)
at global/qlibraryinfo.cpp:99
#20 0xb739e106 in QCoreApplication::libraryPaths ()
at kernel/qcoreapplication.cpp:1965
#21 0xb739e84b in QCoreApplication::init (this=0xbfc19ef4)
at kernel/qcoreapplication.cpp:472
#22 0xb739ea85 in QCoreApplication (this=0xbfc19ef4, p=@0x804b198)
at kernel/qcoreapplication.cpp:392
#23 0xb7741bdc in QApplication (this=0xbfc19ef4, argc=@0xbfc19f50,
argv=0xbfc19fd4, GUIenabled=false, _internal=263168)
at kernel/qapplication.cpp:700
#24 0x08048c89 in main ()