Trac issueshttps://gitlab.torproject.org/legacy/trac/-/issues2020-06-13T15:40:43Zhttps://gitlab.torproject.org/legacy/trac/-/issues/30179Building with 'ALL_BUGS_ARE_FATAL' fails because of formatted assertion changes.2020-06-13T15:40:43ZTracBuilding with 'ALL_BUGS_ARE_FATAL' fails because of formatted assertion changes.Building with **ALL_BUGS_ARE_FATAL** should AFAICS normally be
reserved for Coverty and/or analysers. But just for kicks, I've
added **-DALL_BUGS_ARE_FATAL** to my CFLAGS.
This causes errors like these (from clang using a git-checkout f...Building with **ALL_BUGS_ARE_FATAL** should AFAICS normally be
reserved for Coverty and/or analysers. But just for kicks, I've
added **-DALL_BUGS_ARE_FATAL** to my CFLAGS.
This causes errors like these (from clang using a git-checkout from today):
```
buf/buffers.c(531,7): error: too few arguments to function call, expected at least 5, have 4
if (BUG(buf->datalen >= INT_MAX))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
..\lib/log/util_bug.h(151,70): note: expanded from macro 'BUG'
(tor_assertion_failed_(SHORT_FILE__,__LINE__,__func__,"!("#cond")"), \
~~~~~~~~~~~~~~~~~~~~~ ^
..\lib/log/util_bug.h(242,1): note: 'tor_assertion_failed_' declared here
void tor_assertion_failed_(const char *fname, unsigned int line,
^
buf/buffers.c(533,7): error: too few arguments to function call, expected at least 5, have 4
if (BUG(buf->datalen >= INT_MAX - string_len))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
```
I've used this patch to fix it:
```
--- a/src/lib/log/util_bug.h 2019-04-14 03:56:41
+++ b/src/lib/log/util_bug.h 2019-04-14 11:31:23
@@ -148,7 +148,7 @@
#define tor_assert_nonfatal_once(cond) tor_assert((cond))
#define BUG(cond) \
(ASSERT_PREDICT_UNLIKELY_(cond) ? \
- (tor_assertion_failed_(SHORT_FILE__,__LINE__,__func__,"!("#cond")"), \
+ (tor_assertion_failed_(SHORT_FILE__,__LINE__,__func__,"!("#cond")", NULL), \
abort(), 1) \
: 0)
#elif defined(TOR_UNIT_TESTS) && defined(DISABLE_ASSERTS_IN_UNIT_TESTS)
```
W/o knowing what the correct fix would be.
**Trac**:
**Username**: gvanemTor: 0.4.1.x-finalhttps://gitlab.torproject.org/legacy/trac/-/issues/27185test/test.c and lround() prototype2020-06-13T15:29:31ZTractest/test.c and lround() prototypeFirst off, I have to express my frustration with this Trac-system. Clumsy as hell; the Markdown support is a joke. I'd wish you'd moved to Github or Gitlab.
Okay. To the issue. Compiling test/test.c using MSVC-2017 or clang-cl, spits ou...First off, I have to express my frustration with this Trac-system. Clumsy as hell; the Markdown support is a joke. I'd wish you'd moved to Github or Gitlab.
Okay. To the issue. Compiling test/test.c using MSVC-2017 or clang-cl, spits out this warning:
```
test.c(42,10): warning: 'lround' redeclared without 'dllimport' attribute: previous 'dllimport' ignored [-Winconsistent-dllimport]
long int lround(double x);
```
From MSVC:
```
test.c(42): warning C4273: 'lround': inconsistent dll linkage
f:\ProgramFiler-x86\WindowsKits\Include\10.0.16299.0\ucrt\corecrt_math.h(520):
note: see previous definition of 'lround'
```
For Windows, it's already prototypes as (after C-preprocessing):
```
__declspec (dllimport)
long long __cdecl llround (double _X);
```
Why not use `tor_lround()` instead?
Same goes for `fabs()` I guess, but this function is **not** marked with `dllimport`!? Seems to be an intrinsic for clang-cl + MSVC.
**Trac**:
**Username**: gvanemTor: 0.3.5.x-finalteorteorhttps://gitlab.torproject.org/legacy/trac/-/issues/26196Abort in test_bridges.c2020-06-13T15:25:57ZTracAbort in test_bridges.cRunning `test.exe bridges/clear_bridge_list` causes this assertion:
```
bridges/clear_bridge_list: May 23 17:12:53.714 [err] tor_assertion_failed_():
Bug: container.h:70: smartlist_get: Assertion sl->num_used > idx failed;
```
AFA...Running `test.exe bridges/clear_bridge_list` causes this assertion:
```
bridges/clear_bridge_list: May 23 17:12:53.714 [err] tor_assertion_failed_():
Bug: container.h:70: smartlist_get: Assertion sl->num_used > idx failed;
```
AFAICS, since `sweep_bridge_list()` caused all entries in `bridgelist` to get deleted, an index of zero is illegal. Don't ask me why.
And since I compiled all `test/*.c` sources with `-DDEBUG_SMARTLIST`, this will trigger this abort(). I fail to see why this isn't done in the officially.
\\
PS1. I'm on Win-10, tor.exe + libs was built with MSVC 2017.
\\
PS2. Build tor.exe from master at 23 May 2018.
**Trac**:
**Username**: gvanemTor: 0.3.4.x-finalrl1987rl1987