[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-dev] Debug-assert in 'test util/logging/sigsafe_err'



Running  "test --verbose util/logging/sigsafe_err" gives me an debug-assert in
write(STDERR_FILENO,...). Assert that failed is: "(_osfile(h) & FOPEN)"

Here's the call-stack in WinDbg:

MSVCR100D!_write+0x126
test!tor_log_err_sigsafe_write(char * s = 0x00707290 ".======================
====================================== T=")+0x66 [g:\mingw32\src\inet\tor-project\src\common\log.c @ 463]

test!tor_log_err_sigsafe(char * m = 0x006bae50 "Minimal..")+0xdf [g:\mingw32\src\inet\tor-project\src\common\log.c @ 491]

test!test_sigsafe_err(void * arg = 0x00000000)+0xb0 [g:\mingw32\src\inet\tor-project\src\test\test_logging.c @ 98]

...

It makes sense that "(_osfile(h) & FOPEN)" is FALSE, since in test_logging.c I see:

 close(STDERR_FILENO);   <<< !!! what good is this?
 log_err(LD_BUG, "Say, this isn't too cool.");
 tor_log_err_sigsafe("Minimal.\n", NULL);

If you close stderr, shouldn't handle 2 point to something else? I cannot see it
does. All this is on Win-XP SP3, MSVC v16 (debug).

--gv



_______________________________________________
tor-dev mailing list
tor-dev@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev