How to determine if code is running in signal-handler context?

前端 未结 6 1292
一生所求
一生所求 2021-02-03 11:11

I just found out that someone is calling - from a signal handler - a definitely not async-signal-safe function that I wrote.

So, now I\'m curious: how to circumvent this

6条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-03 11:19

    for code optimized at -O2 or better (istr) have found need to add -fno-omit-frame-pointer

    else gcc will optimize out the stack context information

提交回复
热议问题