I have built sysutils/screen (screen-4.7.0_4) on a wandboard-quad running: FreeBSD 13.0-CURRENT r352778 GENERIC arm The version of the ports tree is: Last Changed Rev: 516289 Last Changed Date: 2019-11-02 07:24:29 +0000 (Sat, 02 Nov 2019) The build (using ports-mgmt/poudriere-3.3.2_1) finished successfully. If I start sysutils/screen: root@wqtest:~ # gdb /usr/local/bin/screen GNU gdb (GDB) 8.3.1 [GDB v8.3.1 for FreeBSD] ... Reading symbols from /usr/local/bin/screen... (gdb) run Starting program: /usr/local/bin/screen [Detaching after fork from child process 13723] I get error messages in /var/log/messages: Nov 3 15:22:04 wqtest SCREEN[13723]: stack overflow detected; terminated Nov 3 15:22:05 wqtest kernel: pid 13723 (screen), jid 0, uid 0: exited on signal 6 (core dumped) The screen core file: http://ulrich-grey.de/dl/screen.core.xz
Is ASLR enabled? ulimit -a, please. The core won't do me any good, no arm here, no debug info. A backtrace won't do us good as screen traps all exceptions and issues an abort() to abend gracefully.
ulimit -a for my wandboard-quad running: root@wqtest:~ # uname -a FreeBSD wqtest.intranet 13.0-CURRENT FreeBSD 13.0-CURRENT r352778 GENERIC arm root@wqtest:~ # ulimit -a cpu time (seconds, -t) unlimited file size (512-blocks, -f) unlimited data seg size (kbytes, -d) 524288 stack size (kbytes, -s) 8192 core file size (512-blocks, -c) unlimited max memory size (kbytes, -m) unlimited locked memory (kbytes, -l) unlimited max user processes (-u) 5547 open files (-n) 58095 virtual mem size (kbytes, -v) unlimited swap limit (kbytes, -w) unlimited socket buffer size (bytes, -b) unlimited pseudo-terminals (-p) unlimited kqueues (-k) unlimited umtx shared locks (-o) unlimited
I didn't ask for uname -a. Is ASLR enabled?
sysctl -a | grep aslr
root@wqtest:~ # sysctl -a | grep aslr kern.elf32.aslr.stack_gap: 3 kern.elf32.aslr.honor_sbrk: 1 kern.elf32.aslr.pie_enable: 0 kern.elf32.aslr.enable: 0 vm.aslr_restarts: 0
I don't know what the issue is but here is a possible workaround for arm: Index: Makefile =================================================================== --- Makefile (revision 516618) +++ Makefile (working copy) @@ -49,6 +49,10 @@ .include <bsd.port.options.mk> +.if ${ARCH} == armv6 || ${ARCH} == armv7 +SSP_CFLAGS?= -fno-stack-protector +.endif + GNU_CONFIGURE= yes CFLAGS+= -I${NCURSESINC} LDFLAGS+= -L${NCURSESLIB}
I don't have any arm here. Can you test the patch please?
The patch does not work. I get a "stack overflow detected" warning like before.
(In reply to Ulrich Grey from comment #8) Can you post the build log somewhere (it works for me on 2 different boards)?
I noticed that I made a stupid mistake. I installed the new built package from an older repository. Mikaëls patch works, sysutils/screen is running now on my wandboard. I apologize.
Thanks all for the patch and for testing this.
A commit references this bug: Author: cy Date: Mon Nov 4 20:43:08 UTC 2019 New revision: 516740 URL: https://svnweb.freebsd.org/changeset/ports/516740 Log: Fix a stack assertion under arm. PR: 241690 Submitted by: mikael.urankar at gmail.com Reported by: Ulrich Grey <usenet at ulrich-grey.de> Changes: head/sysutils/screen/Makefile
Is this a proper fix or maybe is there a bug in screen somewhere anyway? Would that be possible to compile screen without this patch make WITH_DEBUG=yes clean deinstall reinstall and see where it crashes with gdb ("bt all" after crash)
(In reply to Marcin Cieślak from comment #13) er, just 'bt'
This is the correct fix.