How to “set a breakpoint in malloc_error_break to

2019-07-07 04:13发布

问题:

My Qt5 app crashes when I hit the close window returning:

MyApp(28741,0x7fff7aa73000) malloc: *** error for object 0x7fc40bc8e300: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
The program has unexpectedly finished.

How to “set a breakpoint in malloc_error_break to debug” in Qt Creator 4 (Mac OS)?

Should be better to do it via terminal in lldb/gdb, how?

Reference: How to find reason for app crash on close?

回答1:

In Breakpoints window, right click->Add Breakpoint... change Breakpoint type to Function name and type malloc_error_break in Funcion:. Another way is to open Debugger Console (Cmd+5) and type b malloc_error_break.