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
MSVC crash with '-DMEMDEBUG_LOG_SYNC' #828
Comments
I'm guessing the issue has to do with the size 0 passed in when line buffering; does it work if you pass in 1024 for example? In any case, unbuffering this stream is just as good (if not actually a better) of a solution in this case. |
It does. Not sure what you mean by unbuffering this stream, but trying with this:
seems okay. |
I was talking about using _IONBF unconditionally, which sets the stream unbuffered. Don't bother making it conditional, just use _IONBF unconditionally, either the way you have it or the slightly simpler setbuf(logfile, (char*)NULL); |
Ah, yes this works:
|
Thanks! |
This issue seems to have surfaced once again. Now in C-ares when --- a/memdebug.c 2017-05-25 14:03:18
+++ b/memdebug.c 2017-07-06 18:03:24
@@ -115,6 +115,7 @@
logfile = stderr;
#ifdef MEMDEBUG_LOG_SYNC
/* Flush the log file after every line so the log isn't lost in a crash */
+ if (logfile)
setbuf(logfile, (char *)NULL);
#endif
} |
Building libcurl with
-DCURLDEBUG
and-DMEMDEBUG_LOG_SYNC
for me causes crash inlib/memdebug.c
insidecurl_memdebug()
:I.e. Dr. Watson triggers a run-time check followed by a crash. But this seems to work as intended:
Anybody who can confirm this?
This seems to be the same as this Stackoverflow issue. I'm using MSVC-2015 (cl 19.00.23506 for x86) on Win-10.
The text was updated successfully, but these errors were encountered: