PDA

View Full Version : Segmentation fault



Schimanski
31st August 2009, 10:35
Hello together,

since a while I try to get running an old program, from which I lost the source code. The prog has been developed with qt 2 and when I start the program I get a segmentation fault. By using gdb to figure out which kind of error it is I got the following output:

Program received signal SIGSEGV, Segmentation fault.
0xb7da60ac in QWidget::minimumSize () from libqt.so.2

I was using the libs: libqt.so.2.2,libqt.so.2.2.3 ,libqt.so.2.3,libqt.so.2.3.1
But with all of them I got the same error.
It would be kind if anybody could help me.

Thank you
Dave

wysota
31st August 2009, 10:41
Please provide a full backtrace from the debugger. It's very unlikely there will be anything you can do about the problem without the source code though...

Schimanski
31st August 2009, 10:54
Here is the backtrace from the gdb:

Program received signal SIGSEGV, Segmentation fault.
0xb7cca0ac in QWidget::minimumSize () from libqt.so.2
(gdb) bt
#0 0xb7cca0ac in QWidget::minimumSize () from libqt.so.2
#1 0xb7cca3e4 in QWidget::setFixedWidth () from libqt.so.2
#2 0x08058985 in tmaSegmentationMain::tmaSegmentationMain (this=0x8c4df48, parent=0xbf990dec, name=0x0) at tmaSegmentationMain.cpp:25
#3 0x0805bb1f in tmaMainWindow::tmaMainWindow (this=0xbf990dec) at tmaMainWindow.cpp:6
#4 0x0805bc00 in main (argc=2, argv=0xbf990f34) at main.cpp:25

I know that it is difficult but the source code is definitely gone :(

wysota
31st August 2009, 11:05
Where did you get the libs from? Is it a standard distribution package, self compiled library or something else?

Schimanski
31st August 2009, 11:08
Yes standard distribution package from here: ftp://194.199.20.114/linux/redhat/9/en/os/i386/RedHat/RPMS/

qt2-2.3.1-13.i386.rpm

Kumosan
31st August 2009, 11:11
I know that it is difficult but the source code is definitely gone :(

Difficult? I'd say impossible. Qt 2 is ancient. If you did not compile your libs yourself, I'd expect problems, e.g. due to slightly incompatible glibc or other libs. Only thing you can try is to compile Qt 2 yourself to avoid such problems.

wysota
31st August 2009, 11:16
Yes standard distribution package from here: ftp://194.199.20.114/linux/redhat/9/en/os/i386/RedHat/RPMS/

qt2-2.3.1-13.i386.rpm

Is it suited for your system? It seems it is the library that causes the problem, not the application. You need to have the rpm for exactly your distro (and version, of course).

Schimanski
31st August 2009, 11:21
No it doesn't suit to my system. I'm using ubuntu 9.04. But I don't know which version I should take and don't even no from where. Is it might be possible, when I try to install an old version of SUSE into a virtual machine and try to run it there?

Kumosan
31st August 2009, 11:25
No it doesn't suit to my system. I'm using ubuntu 9.04. But I don't know which version I should take and don't even no from where. Is it might be possible, when I try to install an old version of SUSE into a virtual machine and try to run it there?

Ubuntu has no Qt 2 in its repository anymore? A Debian repository might work better. Though I am not sure whether Qt 2 is already in Debian stable. ;)

But you really should consider compiling your Qt 2 libs yourself.

Schimanski
31st August 2009, 11:35
Ok, I gonna try it in one hour, I need to eat first :) Thank you for you help so far...

Schimanski
31st August 2009, 12:36
Now I compiled qt2 by myself and I got the following error when I run my application:

symbol lookup error: /home/campino/share/MedApp/MedApp: undefined symbol: __ti7QWidget

Program exited with code 0177.
(gdb) bt
No stack.

Kumosan
31st August 2009, 12:43
Now I compiled qt2 by myself and I got the following error when I run my application:

symbol lookup error: /home/campino/share/MedApp/MedApp: undefined symbol: __ti7QWidget

Program exited with code 0177.
(gdb) bt
No stack.

What does 'ldd <programname>' say?

Schimanski
31st August 2009, 12:48
linux-gate.so.1 => (0xb7ee9000)
libqt.so.2 (0xb7bb1000)
libstdc++-libc6.2-2.so.3 (0xb7b69000)
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7b2d000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb79ca000)
libXext.so.6 => /usr/lib/libXext.so.6 (0xb79ba000)
libX11.so.6 => /usr/lib/libX11.so.6 (0xb78cb000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb77dc000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb77cd000)
/lib/ld-linux.so.2 (0xb7eea000)
libXau.so.6 => /usr/lib/libXau.so.6 (0xb77c8000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb77ae000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb77aa000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb77a5000)

wysota
31st August 2009, 12:50
It seems your application doesn't see the library you compiled.

Schimanski
31st August 2009, 12:57
hm.. but it should be...because there is a soft link to the library:
lrwxrwxrwx 1 campino campino 14 2009-08-31 13:33 libqt.so.2.0 -> libqt.so.2.0.2

Kumosan
31st August 2009, 13:00
hm.. but it should be...because there is a soft link to the library:
lrwxrwxrwx 1 campino campino 14 2009-08-31 13:33 libqt.so.2.0 -> libqt.so.2.0.2

Is your lib in a standard location? Like /usr/lib? Try 'ldconfig -v' as root.

Schimanski
31st August 2009, 13:14
No its not but its located in my program folder but I did a export command before: LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:.

so it should be find. without that export command I get ./MedApp: error while loading shared libraries: libqt.so.2: cannot open shared object file: No such file or directory

and the libqt.so.2 is linked to my self compiled lib.

enclosed you can find the output of ldconfig -v

Kumosan
31st August 2009, 13:44
Hmm, as wysota said, your program does not find the qt lib. Or maybe your lib does not find a lib to which it has a dependency. You could try 'ldd libqt.so' to see if all dependencies are met. Else I'd try the ugly way and move the whole libqt* stuff into /usr/lib and do a 'ldconfig -v'. If this still not work I am out of my remote debugging options.

wysota
31st August 2009, 14:02
It does load the library, it seems. It also seems the library does not have the required symbols.

Kumosan
31st August 2009, 14:44
It does load the library, it seems. It also seems the library does not have the required symbols.

Which should be impossible. Even Qt 2 knew QWidget. :-)
I suppose it is a unmet dependency for libqt.so.2

Schimanski
31st August 2009, 16:26
Is it possible that I upload my program and one of you guys can try it to make it run? because I really need some screenshots for my bachelor thesis of this prog. it would be very kind. please let me know!