Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#20560 closed defect (fixed)

Some unit tests fail when logging messages on Windows / MinGW64

Reported by: teor Owned by:
Priority: Medium Milestone: Tor: 0.2.9.x-final
Component: Core Tor/Tor Version: Tor: 0.2.9.4-alpha
Severity: Normal Keywords: windows, mingw64, test
Cc: ice Actual Points:
Parent ID: Points: 1
Reviewer: Sponsor:

Description

A Windows / MinGW64 user sees the following errors in the unit tests:

circuit_timeout: [forking] Nov 03 15:52:03.329 [err] tor_asprintf(): Bug: Internal error in asprintf (on Tor 0.2.9.4-alpha-dev 8f465808a06c739d)
Nov 03 15:52:03.329 [err] tor_assertion_failed_(): Bug: compat.c:515: tor_asprintf: Assertion 0 failed; aborting. (on Tor 0.2.9.4-alpha-dev 8f465808a06c739d)
Nov 03 15:52:03.329 [err] Bug: Assertion 0 failed in tor_asprintf at compat.c:515. (Stack trace not available) (on Tor 0.2.9.4-alpha-dev 8f465808a06c739d)
OK
rend_fns: [forking] OK
geoip: Nov 03 15:52:11.920 [err] tor_asprintf(): Bug: Internal error in asprintf (on Tor 0.2.9.4-alpha-dev 8f465808a06c739d)
Nov 03 15:52:11.920 [err] tor_assertion_failed_(): Bug: compat.c:515: tor_asprintf: Assertion 0 failed; aborting. (on Tor 0.2.9.4-alpha-dev 8f465808a06c739d)
Nov 03 15:52:11.920 [err] Bug: Assertion 0 failed in tor_asprintf at compat.c:515. (Stack trace not available) (on Tor 0.2.9.4-alpha-dev 8f465808a06c739d)
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
make: *** [test] Error 3

https://trac.torproject.org/projects/tor/attachment/ticket/20530/test-output-fmp.txt

Split off from #20530.
This is probably happening due to #19999.

Child Tickets

Attachments (1)

va_copy.patch (588 bytes) - added by nickm 3 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 3 years ago by teor

Keywords: windows mingw64 test added

comment:2 Changed 3 years ago by nickm

Keywords: 029-proposed removed
Milestone: Tor: 0.2.???Tor: 0.2.9.x-final
Version: Tor: 0.2.9.4-alpha

I don't think that would be #19999 -- #19999 was only about LD_BUG messages, and this one comes with an assertion failure too.

It appears that tor_vasprintf is returning -1, or setting *strp to NULL.

comment:3 Changed 3 years ago by nickm

I would love to see the orconfig.h here, to confirm which instance of tor_vasprintf() is being built.

comment:4 Changed 3 years ago by nickm

Ah, the configure output is in #20530:

checking for vasprintf... no
checking for _vscprintf... yes

That's clear enough.

So either the first _vcsprintf call is returning a negative value, or the second _vcsprintf call is returning a mismatched length.

Hm. I wonder, are we missing an intervening call to va_copy here?

I'm attaching a patch that should fix the problem, if that is the problem.

Changed 3 years ago by nickm

Attachment: va_copy.patch added

comment:5 Changed 3 years ago by nickm

Cc: ice added
Status: newneeds_review

Adding ice to the cc list, as the original reporter.

comment:6 Changed 3 years ago by teor

The patch seems plausible, but I can't test it.

comment:7 Changed 3 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Thanks for the review; I'll merge it and hope. (I've confirmed that msvc does indeed support va_copy and friends.)

comment:8 Changed 3 years ago by nickm

(Merged it as 286fa94064dcc6d1b260bec77de052274e3c4403)

Note: See TracTickets for help on using tickets.