Does getting random SIGTRAP signals (in MinGW-gdb) is a sign of memory corruption?

后端 未结 2 1616
梦毁少年i
梦毁少年i 2021-01-05 16:48

I wrote my own reference counted memory manager c++ (for fun) and I\'m sure it isn\'t perfect ;) . And now when I\'m trying to use it I got random SIGTRAP signals. If I comm

2条回答
  •  佛祖请我去吃肉
    2021-01-05 17:12

    I'd throw in a guess that you might be calling mismatched new/delete or malloc/free implementations - So something was allocated by your memory manager but when the memory is released you end up with the default delete/free implementation.

    Set a breakpoint on the signal and see whether there is free() or operator delete on the stack and whether that is the implementation of said function which you would expect.

提交回复
热议问题