Page 1 of 2 12 LastLast
Results 1 to 20 of 21

Thread: Segmentation fault

  1. #1

    Default Segmentation fault

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Segmentation fault

    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...
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3

    Default Re: Segmentation fault

    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

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Segmentation fault

    Where did you get the libs from? Is it a standard distribution package, self compiled library or something else?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5

    Default Re: Segmentation fault

    Yes standard distribution package from here: ftp://194.199.20.114/linux/redhat/9/...6/RedHat/RPMS/

    qt2-2.3.1-13.i386.rpm

  6. #6
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: Segmentation fault

    Quote Originally Posted by Schimanski View Post
    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.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Segmentation fault

    Quote Originally Posted by Schimanski View Post
    Yes standard distribution package from here: ftp://194.199.20.114/linux/redhat/9/...6/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).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8

    Default Re: Segmentation fault

    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?

  9. #9
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: Segmentation fault

    Quote Originally Posted by Schimanski View Post
    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.

  10. #10

    Default Re: Segmentation fault

    Ok, I gonna try it in one hour, I need to eat first Thank you for you help so far...

  11. #11

    Default Re: Segmentation fault

    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.

  12. #12
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: Segmentation fault

    Quote Originally Posted by Schimanski View Post
    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?

  13. #13

    Default Re: Segmentation fault

    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)

  14. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Segmentation fault

    It seems your application doesn't see the library you compiled.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  15. #15

    Default Re: Segmentation fault

    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

  16. #16
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: Segmentation fault

    Quote Originally Posted by Schimanski View Post
    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.

  17. The following user says thank you to Kumosan for this useful post:

    Morion_self (21st June 2011)

  18. #17

    Default Re: Segmentation fault

    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
    Attached Files Attached Files

  19. #18
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: Segmentation fault

    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.

  20. The following user says thank you to Kumosan for this useful post:

    Morion_self (21st June 2011)

  21. #19
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Segmentation fault

    It does load the library, it seems. It also seems the library does not have the required symbols.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  22. #20
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: Segmentation fault

    Quote Originally Posted by wysota View Post
    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

Similar Threads

  1. Replies: 21
    Last Post: 28th September 2010, 11:59
  2. Replies: 2
    Last Post: 17th June 2010, 00:58
  3. segmentation fault for no apparent reason
    By rishiraj in forum Newbie
    Replies: 1
    Last Post: 12th February 2009, 12:13
  4. Segmentation fault running any QT4 executables
    By jellis in forum Installation and Deployment
    Replies: 7
    Last Post: 19th May 2007, 17:35
  5. Icons missing => segmentation fault
    By antonio.r.tome in forum Qt Programming
    Replies: 4
    Last Post: 8th March 2006, 17:30

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.