Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. segmentation fault at graphics_system_name.isEmpty()
Forum Updated to NodeBB v4.3 + New Features

segmentation fault at graphics_system_name.isEmpty()

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.5k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Manjunath Goudar
    wrote on last edited by Manjunath Goudar
    #1

    I have ported Qt 4.8.6 to sparc linux.as 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/linux.conf)
    include(../../common/gcc-base-unix.conf)
    include(../../common/g++-unix.conf)
    #include (../../common/gcc-base-.conf)
    #include(../../common/g++.conf)
    include(../../common/qws.conf)

    #Toolchain
    #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

    load(qt_config)

    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 libQtGui.so.4.8.6[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.data(), graphics_system_name.size().....)

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

    Please help me....

    Thanks
    Manjunath Goudar

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by SGaist
      #2

      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)

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sidharthyedal
        wrote on last edited by
        #3

        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 :)

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Manjunath Goudar
          wrote on last edited by
          #4

          Thank you very much Sidharth.

          I will try all your suggestion.

          Thanks
          Manjunath Goudar

          S 1 Reply Last reply
          0
          • M Manjunath Goudar

            Thank you very much Sidharth.

            I will try all your suggestion.

            Thanks
            Manjunath Goudar

            S Offline
            S Offline
            sidharthyedal
            wrote on last edited by
            #5

            @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.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved