envoyproxy / envoyproxy/envoy

Signal test failed caused by using signal-unsafe function

Open
#8,193 0 comments 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
C++
Stars
28.9k
Forks
5.6k
Avg merge
1d 22h
Merged PRs (30d)
430

Description

*Title*: *Signal test failed caused by using signal-unsafe function*

*Description*:
>On arm64 platform, SignalsDeathTest.InvalidAddressDeathTest test case failed since the logger class use the signal-unsafe function when processing SIGSEGV signal.

When SIGSEGV signal was sent to envoy from OS, it will invoke the sighandler function for print log information. From the following diagram, we could see, eventually, the os/glibc function locatime_r was invoked. But, as we known, the localtime_r function is not suitable for using in signal processing handler. It mainly because that the localtime_r function was implemented by __tz_convert function that will try to get the tzset_lock which used for reading & setting time zone. But the signal handler should not try to get the lock.
![sequency](https://user-images.githubusercontent.com/44225601/64578369-c3410080-d3b1-11e9-98da-7567e048332e.png)
Finally, could we implement another safe log system which only used for signal processing ?

*Logs*:
[SignalFailed.txt](https://github.com/envoyproxy/envoy/files/3593459/SignalFailed.txt)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.