Hi list!
I've been staring at this file for some time trying to find the elusive compile-error (MingW-gcc v4.50) on Win_XP). The bug was a missing comma (!) and a typo ('err_msg' at line 277 changed to 'err_msg').
I've also changed the format for 'err_code' at line 293 into a "%ld" to suppress a warning. How did this go unnoticed for ~1 month?
--- Git-latest\src\common\procmon.c Thu May 26 19:30:24 2011 +++ common/procmon.c Tue May 31 22:54:14 2011 @@ -252,7 +252,7 @@ if (!GetExitCodeProcess(procmon->hproc, &exit_code)) { char *errmsg = format_win32_error(GetLastError()); log_warn(procmon->log_domain, "Error "%s" occurred while polling " - "handle for monitored process %d; assuming it's dead." + "handle for monitored process %d; assuming it's dead.", errmsg, procmon->pid); tor_free(errmsg); its_dead_jim = 1; @@ -287,12 +287,12 @@
if (!its_dead_jim) log_info(procmon->log_domain, "Failed to open handle to monitored " - "process %d, and error code %d (%s) is not 'invalid " + "process %d, and error code %lu (%s) is not 'invalid " "parameter' -- assuming the process is still alive.", procmon->pid, - err_code, err_msg); + err_code, errmsg);
- tor_free(err_msg); + tor_free(errmsg); } } #else
-------------
Sorry, no git patch. I'm a git newbie.
Gisle V.
On Tue, 31 May 2011 23:12:09 +0200 Gisle Vanem gvanem@broadpark.no wrote:
I've been staring at this file for some time trying to find the elusive compile-error (MingW-gcc v4.50) on Win_XP). The bug was a missing comma (!) and a typo ('err_msg' at line 277 changed to 'err_msg').
I've also changed the format for 'err_code' at line 293 into a "%ld" to suppress a warning. How did this go unnoticed for ~1 month?
The short answer to that is that it is a PITA to compile Tor on Windows, and the process starts with installing an unsigned binary package that automatically downloads several other unsigned binary packages. I (the person that wrote that broken code) didn't have a compilation environment set up to build Tor for Windows, and didn't want to use the instructions I was given to set one up. Sorry about the bug, and thanks for finding and fixing it!
I'm setting up a cross-compiler now, and I'll compile OpenSSL and libevent for Windows Real Soon Now, so this shouldn't happen again.
Robert Ransom