Re: OpenBSD/2.1.0 - weird syslogging?

2019-12-03 Thread Philipp Buehler

Am 03.12.2019 07:22 schrieb Willy Tarreau:
I suspect that on other platforms, logging 0 characters from a NULL 
pointer
is OK and results in nothing being emitted while on OpenBSD it still 
checks
the pointer's validity before detecting it doesn't need it, resulting 
in the
error. Could you please try to change the last line Aleks pointed like 
this:


-(int)host.data, host.area, sep, "");
+(int)host.data, host.area ? host.area : "", sep, "");

I suspect it will be enough.


Indeed, this does the job!
Thanks.

--
pb



Re: OpenBSD/2.1.0 - weird syslogging?

2019-12-02 Thread Willy Tarreau
On Sun, Dec 01, 2019 at 01:16:13PM +0100, Philipp Buehler wrote:
> Am 01.12.2019 12:00 schrieb Aleksandar Lazic:
> > just a wild guess have you set "log-send-hostname" if not can you set
> > it and tell us if anything is changed.
> > http://cbonte.github.io/haproxy-dconv/2.1/configuration.html#log-send-hostname
> > 
> 
> I had not, but made me curious. So I did some tcpdump on it and can
> "confirm"
> that without this option the hostname is missing in the syslog message.
> 
> Logging is now mute instead of errors, but I would rather blame my setup
> on this.
> 
> Thanks for this pointer already

I suspect that on other platforms, logging 0 characters from a NULL pointer
is OK and results in nothing being emitted while on OpenBSD it still checks
the pointer's validity before detecting it doesn't need it, resulting in the
error. Could you please try to change the last line Aleks pointed like this:

-(int)host.data, host.area, sep, "");
+(int)host.data, host.area ? host.area : "", sep, "");

I suspect it will be enough.

Thanks,
Willy



Re: OpenBSD/2.1.0 - weird syslogging?

2019-12-01 Thread Philipp Buehler

Am 01.12.2019 12:00 schrieb Aleksandar Lazic:

just a wild guess have you set "log-send-hostname" if not can you set
it and tell us if anything is changed.
http://cbonte.github.io/haproxy-dconv/2.1/configuration.html#log-send-hostname



I had not, but made me curious. So I did some tcpdump on it and can 
"confirm"

that without this option the hostname is missing in the syslog message.

Logging is now mute instead of errors, but I would rather blame my setup
on this.

Thanks for this pointer already

--
pb



Re: OpenBSD/2.1.0 - weird syslogging?

2019-12-01 Thread Aleksandar Lazic
Hi Philipp.

Am 30.11.19 um 23:15 schrieb Philipp Buehler:
> Hello,
> 
> just build 2.1.0 on OpenBSD.. while the actual processing (fe->be) works,
> I am getting quite some weird logging (in /var/log/messages) per http-request:
> Nov 30 23:01:05 tyo haproxy: vfprintf %s NULL in ">%s %2d %02d:%02d:%02d 
> %.*s%*s"

Looks like this is from this line, but I don't know which part of the line 
could be NULL.

http://git.haproxy.org/?p=haproxy-2.1.git;a=blob;f=src/log.c;hb=c4c499b812ab306c7ecd0d2fcc9eb7e0a3175c41#l1419

That's the block.
```
1418 hdr_len = snprintf(logheader, global.max_syslog_len,
1419">%s %2d %02d:%02d:%02d %.*s%*s",
1420monthname[tm.tm_mon],
1421tm.tm_mday, tm.tm_hour, tm.tm_min, 
tm.tm_sec,
1422(int)host.data, host.area, sep, "");
```

just a wild guess have you set "log-send-hostname" if not can you set it and 
tell us if anything is changed.
http://cbonte.github.io/haproxy-dconv/2.1/configuration.html#log-send-hostname

Regards
Aleks

> syslog.conf pretty straight forward:
> *.notice;auth,authpriv,cron,ftp,kern,lpr,mail,user.none /var/log/messages 
> #default
> local0.*    /var/log/haproxy
> 
> with syslog config in haproxy.cfg
>     log 127.0.0.1   local0 debug
> 
> I am confused.. this is a plain test/sandbox (working on "new"
> monitoring), so can do whatever needed on tracing and such.
> 
> PS: logging is the same for HTTP or HTTPS (just in case libressl..)
> 
> 
> tyo# haproxy -vv
> HA-Proxy version 2.1.0 2019/11/25 - https://haproxy.org/
> Status: stable branch - will stop receiving fixes around Q1 2021.
> Known bugs: http://www.haproxy.org/bugs/bugs-2.1.0.html
> Build options :
>   TARGET  = openbsd
>   CPU = generic
>   CC  = cc
>   CFLAGS  = -O2 -pipe -fno-strict-aliasing
>   OPTIONS = USE_PCRE=1 USE_OPENSSL=1
> 
> Feature list : -EPOLL +KQUEUE -MY_EPOLL -MY_SPLICE -NETFILTER +PCRE -PCRE_JIT 
> -PCRE2 -PCRE2_JIT +POLL -PRIVATE_CACHE +THREAD -PTHREAD_PSHARED -REGPARM 
> -STATIC_PCRE -STATIC_PCRE2 +TPROXY -LINUX_TPROXY -LINUX_SPLICE -LIBCRYPT 
> -CRYPT_H -VSYSCALL -GETADDRINFO +OPENSSL -LUA -FUTEX +ACCEPT4 -MY_ACCEPT4 
> -ZLIB -SLZ -CPU_AFFINITY -TFO -NS -DL -RT -DEVICEATLAS -51DEGREES -WURFL 
> -SYSTEMD -OBSOLETE_LINKER -PRCTL -THREAD_DUMP -EVPORTS
> 
> Default settings :
>   bufsize = 16384, maxrewrite = 1024, maxpollevents = 200
> 
> Built with multi-threading support (MAX_THREADS=64, default=1).
> Built with OpenSSL version : LibreSSL 2.8.2
> Running on OpenSSL version : LibreSSL 2.8.2
> OpenSSL library supports TLS extensions : yes
> OpenSSL library supports SNI : yes
> OpenSSL library supports : TLSv1.0 TLSv1.1 TLSv1.2
> Built with transparent proxy support using: SO_BINDANY
> Built with PCRE version : 8.41 2017-07-05
> Running on PCRE version : 8.41 2017-07-05
> PCRE library supports JIT : no (USE_PCRE_JIT not set)
> Encrypted password support via crypt(3): yes
> Built without compression support (neither USE_ZLIB nor USE_SLZ are set).
> Compression algorithms supported : identity("identity")
> 
> Available polling systems :
>  kqueue : pref=300,  test result OK
>    poll : pref=200,  test result OK
>  select : pref=150,  test result OK
> Total: 3 (3 usable), will use kqueue.
> 
> Available multiplexer protocols :
> (protocols marked as  cannot be specified using 'proto' keyword)
>   h2 : mode=HTTP   side=FE|BE mux=H2
>     fcgi : mode=HTTP   side=BE    mux=FCGI
>     : mode=HTTP   side=FE|BE mux=H1
>     : mode=TCP    side=FE|BE mux=PASS
> 
> Available services : none
> 
> Available filters :
>     [SPOE] spoe
>     [CACHE] cache
>     [FCGI] fcgi-app
>     [TRACE] trace
>     [COMP] compression
> 
> TIA,




OpenBSD/2.1.0 - weird syslogging?

2019-11-30 Thread Philipp Buehler

Hello,

just build 2.1.0 on OpenBSD.. while the actual processing (fe->be) 
works,
I am getting quite some weird logging (in /var/log/messages) per 
http-request:
Nov 30 23:01:05 tyo haproxy: vfprintf %s NULL in ">%s %2d 
%02d:%02d:%02d %.*s%*s"


syslog.conf pretty straight forward:
*.notice;auth,authpriv,cron,ftp,kern,lpr,mail,user.none 
/var/log/messages #default

local0.*/var/log/haproxy

with syslog config in haproxy.cfg
log 127.0.0.1   local0 debug

I am confused.. this is a plain test/sandbox (working on "new"
monitoring), so can do whatever needed on tracing and such.

PS: logging is the same for HTTP or HTTPS (just in case libressl..)


tyo# haproxy -vv
HA-Proxy version 2.1.0 2019/11/25 - https://haproxy.org/
Status: stable branch - will stop receiving fixes around Q1 2021.
Known bugs: http://www.haproxy.org/bugs/bugs-2.1.0.html
Build options :
  TARGET  = openbsd
  CPU = generic
  CC  = cc
  CFLAGS  = -O2 -pipe -fno-strict-aliasing
  OPTIONS = USE_PCRE=1 USE_OPENSSL=1

Feature list : -EPOLL +KQUEUE -MY_EPOLL -MY_SPLICE -NETFILTER +PCRE 
-PCRE_JIT -PCRE2 -PCRE2_JIT +POLL -PRIVATE_CACHE +THREAD 
-PTHREAD_PSHARED -REGPARM -STATIC_PCRE -STATIC_PCRE2 +TPROXY 
-LINUX_TPROXY -LINUX_SPLICE -LIBCRYPT -CRYPT_H -VSYSCALL -GETADDRINFO 
+OPENSSL -LUA -FUTEX +ACCEPT4 -MY_ACCEPT4 -ZLIB -SLZ -CPU_AFFINITY -TFO 
-NS -DL -RT -DEVICEATLAS -51DEGREES -WURFL -SYSTEMD -OBSOLETE_LINKER 
-PRCTL -THREAD_DUMP -EVPORTS


Default settings :
  bufsize = 16384, maxrewrite = 1024, maxpollevents = 200

Built with multi-threading support (MAX_THREADS=64, default=1).
Built with OpenSSL version : LibreSSL 2.8.2
Running on OpenSSL version : LibreSSL 2.8.2
OpenSSL library supports TLS extensions : yes
OpenSSL library supports SNI : yes
OpenSSL library supports : TLSv1.0 TLSv1.1 TLSv1.2
Built with transparent proxy support using: SO_BINDANY
Built with PCRE version : 8.41 2017-07-05
Running on PCRE version : 8.41 2017-07-05
PCRE library supports JIT : no (USE_PCRE_JIT not set)
Encrypted password support via crypt(3): yes
Built without compression support (neither USE_ZLIB nor USE_SLZ are 
set).

Compression algorithms supported : identity("identity")

Available polling systems :
 kqueue : pref=300,  test result OK
   poll : pref=200,  test result OK
 select : pref=150,  test result OK
Total: 3 (3 usable), will use kqueue.

Available multiplexer protocols :
(protocols marked as  cannot be specified using 'proto' 
keyword)

  h2 : mode=HTTP   side=FE|BE mux=H2
fcgi : mode=HTTP   side=BEmux=FCGI
: mode=HTTP   side=FE|BE mux=H1
: mode=TCPside=FE|BE mux=PASS

Available services : none

Available filters :
[SPOE] spoe
[CACHE] cache
[FCGI] fcgi-app
[TRACE] trace
[COMP] compression

TIA,
--
pb