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. *** set a breakpoint in malloc_error_break to debug - how in Qt?
Forum Updated to NodeBB v4.3 + New Features

*** set a breakpoint in malloc_error_break to debug - how in Qt?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 13.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.
  • K Offline
    K Offline
    kloveridge
    wrote on last edited by
    #1

    My app crashes with this message:
    @
    Lotus(18762,0x111e19000) malloc: *** error for object 0x102469358: incorrect checksum for freed object - object was probably modified after being freed.
    *** set a breakpoint in malloc_error_break to debug
    @

    How do I set a breakpoint to "malloc_error_break" in Qt? If I right click on the breakpoints window, I am presented with a bunch options. But which one is it I use for malloc_error_break?

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      "This site":http://qt-project.org/doc/qtcreator-3.1/creator-debug-mode.html describes in detail how to interact with the debugger.
      In short - just open a file, set a cursor in wanted line and press F9 to set a breakpoint (or click on the left margin next to that line). A red circle will be displayed on the margin to indicate that a breakpoint was set and you will see it also in the breakpoints window.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kloveridge
        wrote on last edited by
        #3

        I know how to do break points. Thats hilarious. This is a special breakpoint that uses a symbol called "malloc_error_break". I have a memory problem that this warning gives me instructions how to track it down.

        I just don't how to make QT do this with its break points implementation.

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

          There is a section "Adding Breakpoints":http://qt-project.org/doc/qtcreator-3.1/creator-debug-mode.html#adding-breakpoints in the link that Chris Kawa posted.

          When you start "Add Breakpoint" dialog select "Function Name" from "Breakpoint type" drop-down box. Enter the function name in the "Function" field.

          You may need to enter a module name in the "Advanced" section.
          I can not tell you where this function from. I know that it is definitely not from Qt. Maybe some system library, which depends on OS.

          1 Reply Last reply
          0
          • Chris KawaC Offline
            Chris KawaC Offline
            Chris Kawa
            Lifetime Qt Champion
            wrote on last edited by
            #5

            [quote author="kloveridge" date="1401412991"]I know how to do break points. Thats hilarious.[/quote]
            Sorry. It sounded like you didn't.
            [quote author="kloveridge" date="1401412991"]This is a special breakpoint that uses a symbol called "malloc_error_break". I have a memory problem that this warning gives me instructions how to track it down.[/quote]
            What is special about it? Is it a function? an object instance?
            [quote author="kloveridge" date="1401412991"]I just don't how to make QT do this with its break points implementation.[/quote]
            Qt (btw. QT usually means Apple QuickTime) is a library. It doesn't have "breakpoint implementation". If you mean Qt Creator then it uses whatever debugger you set with a kit so it's no different than any other IDE.

            So you have a symbol name. If you know where it is defined go there and hit F9 like I said. If you don't then use andreyc's suggestion and it will do the same for you.

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kloveridge
              wrote on last edited by
              #6

              it turned out this is not just a typical breakpoint. its not a function, its not any of the types in the pulldown for the breakpoints.

              I had to go to the Debugger log and type in the command field:

              @b malloc_error_break@

              Now, withat that said, the break did go off in my application. But the output was so cryptic that I frankly found it useless.

              I found my bug, btw. turned out I was memcpy() too many bytes to a buffer I allocated with 'new'

              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