Results 1 to 7 of 7

Thread: [Qt-4.7.0-arm] Segfault on hello->show()

  1. #1
    Join Date
    Sep 2010
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default [Qt-4.7.0-arm] Segfault on hello->show()

    Hello,

    Im trying to build an (almost) complete version of Qt 4.7.0 for arm.
    I want to: play videos/sounds (phonon), ssl support (openssl) and webkit on my card.
    I installed scratchbox in order to get a working cross-compiler (arm-none-linux-gnueabi).
    I tried and succeed to compile/run an hello world (without Qt stuff) with this cross-compiler.

    This is myconfig.sh to compile Qt-4.7.0 for arm.
    Qt Code:
    1. scratchboxUser='leflou'
    2.  
    3. ./configure -v -embedded arm -xplatform qws/linux-arm-gnueabi-g++ \
    4. -opensource -little-endian \
    5. -prefix /usr/local/Trolltech/Qt-4.7.0-arm \
    6. -I /scratchbox/users/$scratchboxUser/targets/Arm/usr/local/include \
    7. -I /scratchbox/users/$scratchboxUser/targets/Arm/usr/local/include/glib-2.0 \
    8. -I /scratchbox/users/$scratchboxUser/targets/Arm/usr/local/include/libxml2 \
    9. -I /scratchbox/users/$scratchboxUser/targets/Arm/usr/local/include/gstreamer-0.10 \
    10. -I /scratchbox/users/$scratchboxUser/targets/Arm/usr/local/include/gstreamer-0.10/gst \
    11. -I /scratchbox/users/$scratchboxUser/targets/Arm/usr/local/include/gstreamer-0.10/gst/interfaces \
    12. -I /scratchbox/users/$scratchboxUser/targets/Arm/usr/local/ssl/include \
    13. -L /scratchbox/users/$scratchboxUser/targets/Arm/usr/local/lib \
    14. -L /scratchbox/users/$scratchboxUser/targets/Arm/usr/local/ssl/lib \
    15. -rpath -lssl -lcrypto -lz -lxml2 -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lgthread-2.0 -lgstreamer-0.10 \
    16. -nomake demos -nomake example -make tools \
    17. -multimedia -audio-backend -phonon -phonon-backend -glib \
    18. -no-mmx -no-3dnow -no-sse -no-sse2 \
    19. -no-largefile -no-gtkstyle -no-qt3support -no-cups -no-nis
    To copy to clipboard, switch view to plain text mode 

    Each library has been downloaded/configured/maked in scratchbox (glib, gstreamer, gst-plugins, openssl, xml2).

    When I compile this code:
    Qt Code:
    1. #include <QDebug>
    2. #include <QPushButton>
    3. #include <QApplication>
    4.  
    5. int main(int argc, char** argv)
    6. {
    7. qDebug() << "Before everything...";
    8. QApplication* app = new QApplication(argc, argv);
    9. qDebug() << "QApplication created";
    10. QPushButton* hello = new QPushButton("Hello World !");
    11. qDebug() << "QPushButton created";
    12.  
    13. QObject::connect(hello, SIGNAL(clicked()), app, SLOT(quit()));
    14. qDebug() << "QObject connected !";
    15.  
    16. hello->move(50, 50);
    17. qDebug() << "QPushButton move";
    18.  
    19. hello->resize(300, 100);
    20. qDebug() << "QPushButton resize";
    21.  
    22. hello->show();
    23. qDebug() << "QPushButton shows up !";
    24.  
    25. qDebug() << "Before app exec";
    26. const int ret = app->exec();
    27. qDebug() << "After app exec";
    28. delete hello;
    29. delete app;
    30. return ret;
    31. }
    To copy to clipboard, switch view to plain text mode 

    $ ./QtHelloWorld -qws
    Segmentation fault occurs on line 22...

    I checked ldd, it seems correct...
    Qt Code:
    1. root@cm-debian:~# ldd QtHelloWorld
    2. libQtGui.so.4 => /usr/local/Trolltech/Qt-4.7.0-arm/lib/libQtGui.so.4 (0x40001000)
    3. libQtNetwork.so.4 => /usr/local/Trolltech/Qt-4.7.0-arm/lib/libQtNetwork.so.4 (0x40a78000)
    4. libQtCore.so.4 => /usr/local/Trolltech/Qt-4.7.0-arm/lib/libQtCore.so.4 (0x40b97000)
    5. libssl.so.1.0.0 => /usr/local/ssl/lib/libssl.so.1.0.0 (0x40ea4000)
    6. libcrypto.so.1.0.0 => /usr/local/ssl/lib/libcrypto.so.1.0.0 (0x40ef6000)
    7. libz.so.1 => /usr/local/lib/libz.so.1 (0x41091000)
    8. libxml2.so.2 => /usr/local/lib/libxml2.so.2 (0x410b6000)
    9. libgmodule-2.0.so.0 => /usr/local/Trolltech/Qt-4.7.0-arm/lib/libgmodule-2.0.so.0 (0x411e8000)
    10. libgobject-2.0.so.0 => /usr/local/lib/libgobject-2.0.so.0 (0x411f3000)
    11. libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x41239000)
    12. libgthread-2.0.so.0 => /usr/local/lib/libgthread-2.0.so.0 (0x41330000)
    13. libgstreamer-0.10.so.0 => /usr/local/lib/libgstreamer-0.10.so.0 (0x4133d000)
    14. libpthread.so.0 => /lib/libpthread.so.0 (0x41414000)
    15. libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x41434000)
    16. libm.so.6 => /lib/libm.so.6 (0x41518000)
    17. libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x415c0000)
    18. libc.so.6 => /lib/libc.so.6 (0x415d4000)
    19. libdl.so.2 => /lib/libdl.so.2 (0x41704000)
    20. librt.so.1 => /lib/librt.so.1 (0x4170f000)
    21. /lib/ld-linux.so.3 (0x2a000000)
    To copy to clipboard, switch view to plain text mode 

    I dont have any clue on my issue, this is really embarassing.

    Edit:
    - main.cpp compiles & runs without any issue on x86.
    - I tried another example "standarddialogs":
    crosscompiled successful, running failed.

    Regards,
    Last edited by LeFlou; 28th September 2010 at 17:03.

  2. #2
    Join Date
    Sep 2010
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: [Qt-4.7.0-arm] Segfault on hello->show()

    Hello,

    70 views and no answers ?
    Im currently trying to compile Qt-4.7.0 with phonon + phonon-backend inside scratchbox.

  3. #3
    Join Date
    Jan 2010
    Posts
    18
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    1

    Default Re: [Qt-4.7.0-arm] Segfault on hello->show()

    I'm not sure if NOT setting this variable would cause a seg fault, but did you set the QWS_DISPLAY variable before trying to run your program?

    If not (and you haven't already figured the issue out) you may want to try this:

    $ export QWS_DISPLAY="LinuxFb:/dev/fb4"
    $ ./QtHelloWorld -qws

    Hope this helps.

  4. #4
    Join Date
    Sep 2010
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: [Qt-4.7.0-arm] Segfault on hello->show()

    Hello,

    It still occurs a segmentation fault... I used the configuration for 4.6.3 and all programs are working.
    But there is an important bunch of features in 4.7.0 and I need it.
    By the way, it was not fb4 but fb0 on my board, I dont know if that's a relevant fact.

    Thanks anyway for the answer

  5. #5
    Join Date
    Jan 2010
    Posts
    18
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    1

    Default Re: [Qt-4.7.0-arm] Segfault on hello->show()

    Hey LeFlou,

    "I installed scratchbox in order to get a working cross-compiler (arm-none-linux-gnueabi)."

    I'm not familiar with scratchbox, but I was wondering, what is the version of your cross compiler?

    http://doc.trolltech.com/4.6/require...ded-linux.html

    http://doc.trolltech.com/4.7/require...ded-linux.html

  6. #6
    Join Date
    Sep 2010
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: [Qt-4.7.0-arm] Segfault on hello->show()

    Hello,

    [sbox-Arm: ~] > g++ --version
    sbox-arm-none-linux-gnueabi-g++ (Sourcery G++ Lite 2009q3-67) 4.4.1
    I think this version is enough recent.
    The weird part is that everything works with Qt-4.6.3 and segfault occurs on Qt-4.7.0 :s
    QtMobility from QtDevNetwork seems pretty attractive but requires 4.7.0.

    Regards,

  7. #7
    Join Date
    Sep 2010
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Thumbs up Re: [Qt-4.7.0-arm] Segfault on hello->show()

    Hello,

    For those who are interested in the solution, there you go:

    Add -no-freetype in your configuration and everything works for arm with Qt4.7.0

    Regards,

Similar Threads

  1. Replies: 3
    Last Post: 12th July 2010, 14:12
  2. libkcddb segfault
    By skepticalgeek in forum Qt Programming
    Replies: 0
    Last Post: 23rd March 2010, 02:25
  3. QwtPlotMarker segfault
    By viridis in forum Qwt
    Replies: 4
    Last Post: 17th September 2008, 14:22
  4. Segfault
    By Dumbledore in forum Qt Programming
    Replies: 3
    Last Post: 12th November 2007, 08:31
  5. segfault
    By conexion2000 in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2006, 13:34

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
  •  
Qt is a trademark of The Qt Company.