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. Crash when prepending QString to QList

Crash when prepending QString to QList

Scheduled Pinned Locked Moved General and Desktop
9 Posts 3 Posters 2.5k Views 1 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.
  • N Offline
    N Offline
    nicky j
    wrote on last edited by
    #1

    Hello,

    whenever I try to run the following code, I get a crash:
    @
    void NBhistoryInterface::addHistoryItem(QString title, QString url)
    {
    qDebug() << "SLOT: NBhistoryInterface::addHistoryItem(QString title, QString url) STATUS: Called";
    qDebug() << "m_historyTitle.prepend() Called";
    m_historyTitle.prepend(title);
    qDebug() << "m_historyTitle.prepend() Completed";
    qDebug() << "SLOT: NBhistoryInterface::addHistoryItem(QString title, QString url) STATUS: Completed";
    }
    @
    The program launches, then crashes when it gets to the prepend() call. This is becoming a major problem and an obstacle towards moving forward with my project. Here is the crash report provided by OS X 10.9:

    @

    Exception Type: EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000010

    VM Regions Near 0x10:
    -->
    __TEXT 0000000100187000-00000001001b4000 [ 180K] r-x/rwx SM=COW /Users/USER/Desktop/*/NovaBrowser_v2.app/Contents/MacOS/NovaBrowser_v2

    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0 <BUNDLEIDENTIFIER> 0x000000010019eae4 QList<QString>::prepend(QString const&) + 20 (qlist.h:546)
    1 <BUNDLEIDENTIFIER> 0x000000010019dec5 NBhistoryInterface::addHistoryItem(QString, QString) + 277 (nbhistory.cpp:29)

    @

    Help would be appreciated greatly!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      How is m_historyTitle declared?

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nicky j
        wrote on last edited by
        #3

        Thats the first place m_historyTitle is declared in the .cpp file.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andreyc
          wrote on last edited by
          #4

          What is a type of m_historyTitle ?
          Are you sure that NBhistoryInterface object is allocated ?

          1 Reply Last reply
          0
          • N Offline
            N Offline
            nicky j
            wrote on last edited by
            #5

            ok here is m_historyTitle in the .h file:
            @
            QList<QString> m_historyTitle;
            @

            yes NBhistoryInterface is allocated

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andreyc
              wrote on last edited by
              #6

              Does you app generate a core file ?
              Check /cores/ directory after app crash.
              The directory should contain core.PID files.
              Could you put here a backtrace.

              1 Reply Last reply
              0
              • N Offline
                N Offline
                nicky j
                wrote on last edited by
                #7

                where would i find the cores file?

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andreyc
                  wrote on last edited by
                  #8

                  Check /cores/ directory after app crash.
                  The directory should contain core.PID files.

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    Chrisw01
                    wrote on last edited by
                    #9

                    Nicky, try running it through the debugger and analyze the data at crash time.

                    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