jmp to self instruction compiled by gcc4.4.6-3

前端 未结 2 553
野性不改
野性不改 2021-02-11 08:42

I have a C++ project, run rightly compiled by gcc-4.1.2-46 and gcc-4.4.5-6

But it has an abnormal dead loop while compiled by gcc-4.4.6-3 using -O2.

I use gdb to

2条回答
  •  情书的邮戳
    2021-02-11 09:23

    Update:

    The _Unwind_Resume function will

    Resume the unwind process, called at the end of cleanup code that didn't return to the normal thread of execution (ie, not a catch).

    See The Secret Life of C++: Day 3: Exceptions

    which according to this

    It's needed for pthread_cancel. It resumes unwinding after a cleanup.

    So it seems there is an exception in a thread for which there is no catch... given that the behavior is different with different versions of gcc and different optimization levels I would venture that you are using threads and have a race condition.

提交回复
热议问题