Inverse Heisenbug - Unit test fails only when debugger is attached

后端 未结 4 2124
不知归路
不知归路 2021-01-19 21:39

I recently fixed a defect in our product, the symptom of which was an access violation caused by accessing a dangling pointer.

For good practice I added a unit test

4条回答
  •  耶瑟儿~
    2021-01-19 22:08

    I ran into this years ago in reverse: The problem was only occurring when the debugger was not attached.

    It turned out the code was corrupting the stack-frame of the previous method activation and using the debugger introduced an intermediate stack-frame.

    You possibly have a similar situation.

提交回复
热议问题