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. [Solved]solving random crashes on reactivate application window
Forum Updated to NodeBB v4.3 + New Features

[Solved]solving random crashes on reactivate application window

Scheduled Pinned Locked Moved General and Desktop
9 Posts 2 Posters 2.0k 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.
  • H Offline
    H Offline
    hhacker
    wrote on last edited by
    #1

    I'm getting random crashes on my Qt application,here is the thing:my program has several thread which works fine on background,and it runs a couple of hour for good,and then it crashed when I switch back to program window."Access Violation" on Normal mode,"Segment fault" on Debug mode.
    And this "Segment fault" is the only message I got,there is no other debug output at all,and I checked call stack but got nothing,after recur this bug several times,I found a qBadAlloc() into it.
    I thought it was a memory leak or something else,but after checking memory usage,the usage didn't grow big at all.
    I can not use Valgrind to check my code,because my environment limit me to use mingw on Windows 7.
    So I was kind of stuck here,this bug is really fatal,any suggestions will be grateful.

    EDIT:
    The program is not immediately crash on reactive app window,but switch from different window will boost the crash happen,otherwise it will working normally for a long time.
    EDIT:
    After a lot of windows switch,finally I got some message useful on debug output window.
    @
    HEAP[Server.exe]:
    Invalid address specified to RtlFreeHeap( 003F0000, 25259B88 )
    @
    EDIT:
    My interface was based on qml.

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

      Without seeing source code and or a core dump it is hard to say where is a problem. Looks like you trying to use un-allocated memory somewhere.
      I would suggest to run the app under debugger or add some debug printing at the places that are activated on window switch.

      1 Reply Last reply
      0
      • H Offline
        H Offline
        hhacker
        wrote on last edited by
        #3

        [quote author="andreyc" date="1417020716"]Without seeing source code and or a core dump it is hard to say where is a problem. Looks like you trying to use un-allocated memory somewhere.
        I would suggest to run the app under debugger or add some debug printing at the places that are activated on window switch.[/quote]

        Thanks for your tips,my thread routine is a running cycle,and I didn't new any object for work.
        I didn't un-allocated memory manually.

        1 Reply Last reply
        0
        • H Offline
          H Offline
          hhacker
          wrote on last edited by
          #4

          @
          Some backtrace
          @

          1 Reply Last reply
          0
          • H Offline
            H Offline
            hhacker
            wrote on last edited by
            #5

            @
            Some backtrace
            @

            1 Reply Last reply
            0
            • H Offline
              H Offline
              hhacker
              wrote on last edited by
              #6

              @
              Some backtrace
              @

              1 Reply Last reply
              0
              • H Offline
                H Offline
                hhacker
                wrote on last edited by
                #7

                @
                Some backtrace
                @

                1 Reply Last reply
                0
                • H Offline
                  H Offline
                  hhacker
                  wrote on last edited by
                  #8

                  @
                  Some backtrace
                  @

                  1 Reply Last reply
                  0
                  • H Offline
                    H Offline
                    hhacker
                    wrote on last edited by
                    #9

                    After a deep core dump,I found out what happened,I was using QTime::currentTime() within Thread,QTime are not documented as being concurrent,so it causes this werid bug.fixed.

                    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