From nobody Tue Oct 04 02:19:37 2022 X-Original-To: ports-bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MhLxj57vfz4d47g for ; Tue, 4 Oct 2022 02:19:37 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MhLxj3dxvz3lRl for ; Tue, 4 Oct 2022 02:19:37 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MhLxj2cP3zPlT for ; Tue, 4 Oct 2022 02:19:37 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 2942JbW7044721 for ; Tue, 4 Oct 2022 02:19:37 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2942JbMq044720 for ports-bugs@FreeBSD.org; Tue, 4 Oct 2022 02:19:37 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 266808] www/obhttpd has various issues in both pkg and ports Date: Tue, 04 Oct 2022 02:19:37 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: freebsd@kumba.dev X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc flagtypes.name Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664849977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IiPEYU0vVjT3tiXF99JU5W4FqHJ12TC29dKA8qrkDJ8=; b=TnVnI/xkFHF2CBMXi/zrXVKCRuTg1Y0H8D3Ih8Vy0pw5MG36BuWXghP+yF8otPP7Rm/K0H MFXpcbhcul1P558C04DpOms3sfj4daAdxoT7+alaJ7PoXqXqy/3eSe0cwffYRVTGxqd67g n/eKS/Iwtr6QHmhTNaGVibjSfbhyG7e0bDu+Y/ogUfONFNrK4jI7TN5JPUGlJiN3s9laoi +HZevFZZqBQo8qKsyYTJzBpKEok2lOPxuq4Sa9jndd2ru3R0Vc99zceG2SAMb0UmUiw5/O ONNtdr9NEUkxSFNHKJolOBRmCD5byjTd8wpiZCpT2bThL90qpwIcGT56LIsc6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664849977; a=rsa-sha256; cv=none; b=OUlzWjFXmFu35iuUAZTm3Jefs5ivS7mNHkSGKRuPeFjDikW/Ezu7wTY8DZSLvUReDqrfdy W6YQG4M/6iHYxzxjfVZeb6UWP/g2vuUUZu3jmwjerC021bEU+oqFO6IPthKIs0Pok39DRU tNuO+1Y7V9ll5Uu6CbXcdZi3KUSKyWVw+2ta0EbNikiGyU2Goyt1+Xed+9ed1gVakPi7x8 ePgeRl+lPXT/9uiB3CkxALpQ6c1APoQ1V66jVOZzyAK0IY0Epfk8pUIgRtdtG7BuijEXz3 L0YB98v1MDJ6zFj4E47JjikQz0n+/ilB0sMiaC6GCWnJI9B9Z9UprvuVAJXEOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D266808 Bug ID: 266808 Summary: www/obhttpd has various issues in both pkg and ports Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: ports-bugs@FreeBSD.org Reporter: freebsd@kumba.dev CC: koue@chaosophia.net Flags: maintainer-feedback?(koue@chaosophia.net) CC: koue@chaosophia.net Summary, there are three issues: 1. obhttpd from pkg needs OpenBSD libevent, but this is not auto-fulfilled 2. Using libevent-2.1.12 will cause a SIGSEGV signal 11 crash 3. Compiling from ports doesn't work because of weird way it includes OpenB= SD libs during build Long detail: Running obhttpd-7.1.20220923_1 from pkg in a jail, using a minimal config f= ile to listen only on TCP/80 for IPv4 and IPv6, when I attempt to connect to the server, the server process (not the logger process) will crash with a SIGSE= GV signal 11: Sample obhttpd.conf (site name redacted): > chroot "/srv/www" > prefork 1 >=20 > server "www.foo" { > listen on port 80 > listen on port 80 > gzip-static > root "/htdocs" > directory auto index >=20 > tcp { > nodelay > sack > } > } Running obhttpd directly in the foreground, undaemonized: # /usr/local/sbin/obhttpd -f /usr/local/etc/obhttpd.conf -d startup logger exiting, pid 44521 lost child: pid 44302 terminated; signal 11 parent terminating, pid 44121 The point between "startup" and "logger exiting" is where the crash happens= .=20 Here is the output of truss on the server PID (I already tested the logger = PID and it exits fine). Server name changed for privacy (and offsets adjusted): > # truss -a -f -e -p 44302 > 44302: kevent(4,{ },0,{ 6,EVFILT_READ,0x0,0,0x1,0x30303 },64,0x0) =3D 1 (= 0x1) > 44302: __sysctl("kern.proc.nfds.0",4,0x820cc998c,0x820cc9980,0x0,0) =3D 0= (0x0) > 44302: getdtablesize() =3D 466434 (0x71e02) > 44302: accept4(0x6,0x820cc9a28,0x820cc9a24,0x20000000) =3D 8 (0x8) > 44302: getpid() =3D 44302 (0xad0e) > 44302: getsockname(8,{ AF_INET :80 },0x820cc9a24) =3D 0 (0x0) > 44302: getsockopt(8,SOL_SOCKET,SO_SNDBUF,0x8274b75d8,0x820cc99d4) =3D 0 (= 0x0) > 44302: kevent(4,{ 6,EVFILT_READ,EV_ADD,0,0,0x30303 8,EVFILT_READ,EV_ADD,0= ,0,0x30303 8,EVFILT_WRITE,EV_ADD,0,0,0x30303 },3,{ 8,EVFILT_READ,0x0,0,0x16= 7,0x30303 8,EVFILT_WRITE,0x0,0,0x8c00,0x30303 },64,{ 60.000000000 }) =3D 2 = (0x2) > 44302: ioctl(8,FIONREAD,0x820cc9a20) =3D 0 (0x0) > 44302: readv(8,[{"GET / HTTP/1.1\r\nHost: www.foo"...,359}],1) =3D 359 (0= x167) > 44302: SIGNAL 11 (SIGSEGV) code=3DSEGV_MAPERR trapno=3D12 addr=3D0xe1f41 My thinking is it has to do with libevent. It looks like obhttpd relies on using the libevent from OpenBSD, but when installing from pkg and not ports, there is no dependency on a FreeBSD package containing OpenBSD's version of libevent.so. When I first ran into this, not realizing it needed OpenBSD's version, I installed libevent-2.1.12 from pkg, which is NOT the one from OpenBSD, and I think this is the source of the above crash. When I went to dig into this one, it looks like the obhttpd port pulls down OpenBSD copies of libevent and libimsg from the obhttpd maintainer's github= and builds them in the same work directory as obhttpd. However, trying to build the current version in ports fails because it wants to include an "imsg.h" header (which should be provided by libimsg, but the include paths aren't s= et right, I assume). One can partially satisfy that by installing libopenbsd, which looks to be unmaintained, but obhttpd fails to compile again looking = for tls.h (from libressl I think). I gave up at this point, as this does not appear to be a pkg/port that is straight-forward to install and use. Small snippet of the build failure from a single .c file: >--- config.o --- >cc -O2 -pipe -fno-strict-aliasing -Wall -I/usr/ports/www/obhttpd/work/htt= pd-7.1.20220923/src/usr.sbin/httpd -Wstrict-prototypes -Wmissing-prototypes= -Wmissing-declarations -Wshadow -Wpointer-arith -Wsign-compare -Wcast-qual= -I/usr/ports/www/obhttpd/work/httpd-7.1.20220923/src/usr.sbin/httpd/../../= ../libevent/src/lib/libevent -I/usr/ports/www/obhttpd/work/httpd-7.1.20220= 923/src/usr.sbin/httpd/../../../libimsg/src/lib/libutil -I/usr/ports/www/o= bhttpd/work/httpd-7.1.20220923/src/usr.sbin/httpd/../../include -I /usr/lo= cal/include -D__dead=3D'' -DHAVE_CONFIG_H -march=3Dnative -MD -MF.depend= .config.o -MTconfig.o -std=3Dgnu99 -Wno-format-zero-length -nobuiltininc -i= dirafter /usr/lib/clang/13.0.0/include -fstack-protector-strong -Qunused= -arguments -c config.c -o config.o > >--- config.o --- >config.c:31:10: fatal error: 'imsg.h' file not found >#include > ^~~~~~~~ --=20 You are receiving this mail because: You are the assignee for the bug.=