-
Notifications
You must be signed in to change notification settings - Fork 63
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
Logging change crashes on OSX #273
Comments
Hi @annatisch Very interesting. I need to look at this in closer detail tomorrow. I don't understand yet why it would crash. The only explanation would be VA_ARGS gets expanded to something else and and basically the printf under LOG() attempts to print a string from a pointer that is not pointing to a string. The problem with removing the extra %s is that a warning is spewed I believe by clang that a spring is directly used in printf as format (which is a potential for security issues usually - because if the string unintentionally contains a %s or some other format specifier then unspecified things will happen including segfaults). So the correct way to handle this is to use %s, but the problem seems to be the VA_ARGS expansion. Cheers, |
@annatisch I was looking a bit more into this today. /Users/jenkins/build/workspace/c-osx-xcode-native/src/connection.c:225:30: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] I think the clang compiler is right generally, there should always be a string literal used as format. Otherwise it is easier to introduce a mistake and provide a format string that might contain a format specifier in it and then a bug ensues. Which compiler are you using? clang or gcc? Cheers, |
Hi @annatisch, Whenever you have some extra time can you update me on the compiler used so I can try a repro? Cheers, |
So sorry for dropping the ball here!
However it looks like the Python extension is being build with gcc?
|
On Mac, |
It seems one of the latest logging changes crashes in connection.c
log_outgoing_frame
(probably incoming frame too, but the code doesn't get that far).By reverting these changes:
Removing the extra "%s" argument here:
https://github.com/Azure/azure-uamqp-c/blob/master/src/connection.c#L250
And removing the "if (0) " statement here:
https://github.com/Azure/azure-c-shared-utility/blob/master/inc/azure_c_shared_utility/xlogging.h#L113
Then it runs without issues.
The text was updated successfully, but these errors were encountered: