Important: Please read the Qt Code of Conduct -

segmentation fault at graphics_system_name.isEmpty()

  • I have ported Qt 4.8.6 to sparc per my knowledge Sparc and Linux support is not available in qws folder.
    I have copied linux-generic-g++ to linux-sparc-g++ and changed qmake.conf as per my toolchain functionality as shown below.

    #include (../../common/gcc-base-.conf)

    #Compiler Flags to take advantage of the sparc architecture
    QMAKE_CFLAGS_RELEASE = -nostdlib -nostartfiles -shared
    QMAKE_CXXFLAGS_RELEASE = -nostdlib -nostartfiles -shared
    QMAKE_LFLAGS_RELEASE = -nostdlib -nostartfiles -shared

    QMAKE_CC = sparc-elf-gcc
    QMAKE_CXX = sparc-elf-g++
    QMAKE_LINK = sparc-elf-g++
    QMAKE_LINK_SHLIB = sparc-elf-g++

    QMAKE_AR = sparc-elf-ar cqs
    QMAKE_OBJCOPY = sparc-elf-objcopy
    QMAKE_STRIP = sparc-elf-strip


    After this I have configured with below configuration feature

    ./configure -verbose -opensource -confirm-license -no-qt3support -no-glib -depths 32 -qt-gfx-vnc -no-gfx-qvfb -no-gfx-multiscreen -no-gfx-directfb -debug -shared -embedded sparc -platform qws/linux-x86_64-g++ -xplatform qws/linux-sparc-g++ -host-little-endian -little-endian -no-openssl -no-opengl -no-sql-sqlite -no-xmlpatterns -no-multimedia -no-audio-backend -no-phonon -no-script -no-phonon-backend -no-svg -multimedia -no-webkit -nomake demos -no-separate-debug-info -prefix /usr/local/ -plugindir /usr/local/plugins -importdir /usr/local/imports -translationdir /usr/local/translations -no-rpath

    I have successfully crated all shared library and copied into my board /lib/ path

    Now my plan is to run analogclock example on board using below command(I don't have display that's what I am using VNC display)
    ./analogclock -qws -display VNC:0

    analogclock[120]: segfault at 8 ip 5019b06c (rpc f000eff0) sp ef82cae8 error 30001 in[50017000+10cb000]
    Segmentation fault

    I am getting segmentation fault when graphics_system_name.isEmpty(); in src/gui/kernel/qapplication.cpp file is invoked.

    After debugging I found that global "QString QApplicationPrivate::graphics_system_name;" object is created successfully with valid address 0x5143a400.
    However I could not access any QString member functions such as (, graphics_system_name.size().....)

    if I create local QString class object,it is working fine.if global segmentation fault.

    Please help me....

    Manjunath Goudar

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Please stop posting the exact same question in every sub forum.

    Duplicates are here and there.

    You're use case is pretty unusual since you are trying to use a linux specific feature on a Sparc system. You should try to write to the interest mailing list You'll find there Qt's developers/maintainers (this forum is more user oriented)

  • Hi Manjunath,

    1. First thing try to put a printf or cout statement in destructor function of class graphics_system_name and its base class destructors also. And put printf/cout statements in all other areas in the file.

    Just confirm that when destructor function is getting called.

    1. check your make file and configure file - same symbols and macro variables are used to build library and application.

    2. If you are not getting crash when you use that object in some function but you get crash when you use it in global scope. it means that something wrong with you data segment. Is data segment size decided by any of your linker script? Do you have sufficient memory reserved for data segment through linker script.

    3. Please declare your object as extern and see. I suspect whether somewhere else they are freeing it.

    4. Finally make graphics_system_name class as singlton, it means you are not allowing anyone else to create one more object of it.

    5. Know whether this crash genuine or side effects of your compiling options - make :)

  • Thank you very much Sidharth.

    I will try all your suggestion.

    Manjunath Goudar

  • @Manjunath-Goudar

    Can you show me code of analogclock.cpp if it is not a confidential.
    I need to see the class declaration- data and member functions of class, object creation.
    If you want to access only static member of class means you dont need any object to be created.
    you access as class_name::static_member

    If it contain any static member please remove static keyword and use it. Lets see whether it crashes it again.

Log in to reply