-
Notifications
You must be signed in to change notification settings - Fork 917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
logger: Use a function-level static var for the logger object #6689
logger: Use a function-level static var for the logger object #6689
Conversation
I tested this on NetBSD/amd64, and verified that the authoritative server and the recursor both work correctly with this modification. Thus, it solves the issue I reported in #6624. I will also test on NetBSD/arm, and report further once that has been done. |
The recursor still crashes in exactly the same way on NetBSD/arm, I'm afraid. |
I'm now wondering whether the switch to |
Can I do something to test whether thread_local is working properly? Might be a platform specific bug in GCC 6.4, I suppose. |
Just to see what would happen, I built the authoritative server on the Pi, from the same code base, including the gpgsql module. It's running (and logging) just as it should, happily letting me create and modify zones, which it then serves correctly. Securing zones on it works, too. So the crash in the recursor, the first time recursorThread() tries to log something, may of course be a GCC bug in the thread_local handling, but it doesn't seem all that likely to me. For reference, the backtrace looks like this: Program terminated with signal SIGSEGV, Segmentation fault. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM although I don't like the macro trick either. Perhaps putting getLogger()
in a namespace would reduce confusion ?
I'm not sure I understand what you have in mind? |
Short description
This PR includes the commit from #6625, replaces #6639. I don't like the macro trick at all but I don't see any other way to make sure that the
Logger
object is correctly initialized before any use.Checklist
I have: