core: fix segmentation fault during global teardown (#3288)#3331
core: fix segmentation fault during global teardown (#3288)#3331harshal24-chavan wants to merge 1 commit into
Conversation
|
I had a different solution in mind. What I need is to have some flag that is 0 by default, but it enables logs in this area. Let's say: #define SRT_ENABLE_UNSAFE_LOGS 0 #if SRT_ENABLE_UNSAFE_LOGS Now, all HLOGC macro uses in this function should be replaced by HLOGC_UNSAFE. In the default configuration this will be simply turned into no instruction. But a developer may need to enable logs in this area temporarily to track any problems, and to do that, they can change SRT_ENABLE_UNSAFE_LOGS locally. |
|
okay! yes makes sense, keep it for debugging & exclude them for normal use, thanks for correcting. I'll implement that. |
Fixes Haivision#3288. Removed HLOGC macros from closeAllSockets() as they were being triggered during the static destruction phase, attempting to access already deleted global logging objects.
|
Following the pattern I saw in the |
|
Yes, that's very good. In perspective also the |
Removed the
HLOGCmacros fromcloseAllSockets()that were causing a segmentation fault during global teardown due to static destruction order. Added a warning comment to prevent future logging in this function.Fixes #3288