varnishevent issueshttps://code.uplex.de/uplex-varnish/varnishevent/issues2018-04-07T23:12:30Zhttps://code.uplex.de/uplex-varnish/varnishevent/issues/3len == strlen(substr) failed in test_format_SLT at test_format.c:1659 (errno ...2018-04-07T23:12:30ZNils Gorolllen == strlen(substr) failed in test_format_SLT at test_format.c:1659 (errno 0: Success)became visible after fix of #2https://code.uplex.de/uplex-varnish/varnishevent/issues/2test_format fails with new gcc 6 and -g -O22018-04-07T23:12:30ZNils Gorolltest_format fails with new gcc 6 and -g -O2```
Linux haggis 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) x86_64 GNU/Linux
gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)
```
```
$ head -3 test_format.log
Assert error in get_hdr(), format.c line 204:
Condition(hdr_idx <= hidx[tag]) not true.
```
```
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007fd9c71ea42a in __GI_abort () at abort.c:89
#2 0x00007fd9c7a7ab96 in VAS_Fail (
func=func@entry=0x5629a9a98468 <__func__.4827> "get_hdr",
file=file@entry=0x5629a9a949a3 "format.c", line=line@entry=204,
cond=cond@entry=0x5629a9a9802b "hdr_idx <= hidx[tag]",
kind=kind@entry=VAS_ASSERT) at ../libvarnish/vas.c:77
#3 0x00005629a9a92d1b in get_hdr (tx=<optimized out>, tag=tag@entry=SLT_ReqHeader,
hdr_idx=<optimized out>) at format.c:204
#4 0x00005629a9a93079 in format_Xio (len=0x7ffe246a9298, s=0x7ffe246a9290,
tag=SLT_ReqHeader, hdr_idx=<optimized out>, tx=<optimized out>) at format.c:695
#5 format_Xi_client (tx=<optimized out>, args=<optimized out>, s=0x7ffe246a9290,
len=0x7ffe246a9298) at format.c:703
#6 0x00005629a9a81286 in test_format_Xi () at test_format.c:1271
#7 0x00005629a9a8b077 in all_tests () at test_format.c:2424
#8 main (argc=<optimized out>, argv=0x7ffe246a9688) at test_format.c:2439
```
works fine with
```
CFLAGS='-g -O0 -pthread' ./configure
```Geoff SimmonsGeoff Simmonshttps://code.uplex.de/uplex-varnish/varnishevent/issues/1Assertion failure when no contents from the log are specified in any format s...2018-04-07T23:12:31ZGeoff SimmonsAssertion failure when no contents from the log are specified in any format stringNoticed by Nils with: ``-g raw`` and this configuration:
```
cformat=
rformat=fixed_string
```
That would have the effect of just emitting the fixed string for every raw transaction (possibly filtered by a query) -- obviously very much a corner case, but nevertheless varnishevent shouldn't crash.
```
#2 0x0000000000404e41 in assert_fail (func=0x411031 <__func__.6111> "main", file=0x41090a "varnishevent.c", line=930,
cond=0x410580 "!VSTAILQ_EMPTY(&rdr_rec_freelist) || (!VSB_EMPTY(config.cformat) && nonrecs_wanted[VSL_t_req]) || (!VSB_EMPTY(config.bformat) && nonrecs_wanted[VSL_t_bereq]) || (!VSB_EMPTY(config.rformat) && nonrecs_"..., err_e=<optimized out>) at varnishevent.c:569
#3 0x0000000000404615 in main (argc=<optimized out>, argv=<optimized out>) at varnishevent.c:927
```