From nobody Fri Oct 22 06:15:03 2021 X-Original-To: freebsd-current@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 D0D9D1816FD4 for ; Fri, 22 Oct 2021 06:15:15 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic316-8.consmr.mail.gq1.yahoo.com (sonic316-8.consmr.mail.gq1.yahoo.com [98.137.69.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HbDbk6Cc0z4lLq for ; Fri, 22 Oct 2021 06:15:14 +0000 (UTC) (envelope-from marklmi@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634883307; bh=fSOZXEb+Y9hb/1af9giplqtkqU8DWnm2plarmfEtp00=; h=From:Subject:Date:References:To:In-Reply-To:From:Subject:Reply-To; b=gLS+c1v5I6lZbaIKPw+jh+oGi0JvZA4myiMmRza1hDUuOan5xPG/ZXpE1bSMTbejbFBnARUlWMoOJ1sD9ufBBMDKTweKMvaCI/tb70JWYb/klOn6XcYqxcnDwnMZQB2+lbbRSIYBycvXG0rJSl+Oou/eIEJRyBp1yV63bUanF+P67jooDUL9eoEdi+uTjKGAj8qnurrMlrXPX0miZ61UmiS/+DqHDYPzDIxskAFwnS/9jvq/MpLgnYopycg4xHnO/NCLTSys4GO9twvgEoy9Ykv/TYWWtJ2+VtflallqQSwlI9tStaf4olXlfO+mof21X9jiL7Gg72CXX1ftbNoOQQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1634883307; bh=K9Bt8mTvTfs6dfvIJi4ZQRTRMJogLviJXY03/hVHLwQ=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=OyxYbZbaWvnnOua/pbU+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U_6YDlbiFGlkVZtcq9xxmPXtOnQfJXR4obSI7MhCtAk5h5nbjABtaGTumCJAC1XHdkt vF._cR81QUFjPj8afaizZI6kG_e12ikMWZyFumZ06W0N4uNQSLFddnaaiNlBlWxdePFSL41R0IR8 wgRz64QkjrIM9A2nbZ4Le.SJxCSuVJlruuVLVo97pGCWOa0arOm16r0YdrqRBjf82sMje_b31XzY xsULllvswofoDmb1vVRXDnK4v2jvMHLNgYG8lQcXOL13EPUUmMeyf2EtePx7SbJvbG2iMEL7JpmQ 8pSsOqSkEBzPkDG_pGUO1HMQRxvfh__z.55CmybhJiXB6SJAL65dwHjzNdCC6Z2rKoH60uK8LDqd GT6WCiQ5vtKXDrLbUYTB0.ubCoHgKn3YNEdvtBxpnaMpnZGZ7bPY1LO43RDacjl25moGVTXzm6sF h.W4IQquOjOAyZaZv6GfqSfY8upHhB5UWxmd2LH4UvE6ModXB7GCRtW4xPxaRWsKcPejVV3nWYRT hXjNAIgmG4do.Jw-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.gq1.yahoo.com with HTTP; Fri, 22 Oct 2021 06:15:07 +0000 Received: by kubenode528.mail-prod1.omega.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID ae1fb88cc1a98ee063f2db7c20e12dd3; Fri, 22 Oct 2021 06:15:05 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: Is dialog4ports built in/for releng/13.0 also supposed to work under main [so: 14]? It gets SIGSEGV in my context. (some low level failure info now) Date: Thu, 21 Oct 2021 23:15:03 -0700 References: <0465422C-DA30-4421-85E7-17CACBF0356D.ref@yahoo.com> <0465422C-DA30-4421-85E7-17CACBF0356D@yahoo.com> <20211021151438.7496a0d0@ernst.home> <20211022002715.5a6ec66c7c27442f483e9347@dec.sakura.ne.jp> <146075A5-1311-4C57-AD42-982C3FB5DF81@yahoo.com> To: freebsd-current In-Reply-To: <146075A5-1311-4C57-AD42-982C3FB5DF81@yahoo.com> Message-Id: <721F4836-0A36-4A8E-B596-5ED4BC02FC55@yahoo.com> X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4HbDbk6Cc0z4lLq X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=gLS+c1v5; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.69.32 as permitted sender) smtp.mailfrom=marklmi@yahoo.com X-Spamd-Result: default: False [-3.44 / 15.00]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-0.94)[-0.939]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; SUBJECT_HAS_QUESTION(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[98.137.69.32:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.69.32:from]; RCVD_COUNT_TWO(0.00)[2] Reply-To: marklmi@yahoo.com From: Mark Millard via freebsd-current X-Original-From: Mark Millard X-ThisMailContainsUnwantedMimeParts: N On 2021-Oct-21, at 16:24, Mark Millard wrote: > On 2021-Oct-21, at 11:53, Mark Millard wrote: >=20 >> On 2021-Oct-21, at 08:27, Tomoaki AOKI = wrote: >>=20 >>> On Thu, 21 Oct 2021 07:40:36 -0700 >>> Mark Millard via freebsd-current = wrote: >>>=20 >>>>=20 >>>>=20 >>>> On 2021-Oct-21, at 06:14, Gary Jennejohn = wrote: >>>>=20 >>>>> On Thu, 21 Oct 2021 01:34:47 -0700 >>>>> Mark Millard via freebsd-current = wrote: >>>>>=20 >>>>>> I get the following crash (amd64 example shown), as reported >>>>>> via gdb afterwards. (devel/llvm13 is just an example context.) >>>>>>=20 >>>>>> gdb `which dialog4ports` devel/llvm13/dialog4ports.core >>>>>> . . . >>>>>> Core was generated by `/usr/local/bin/dialog4ports'. >>>>>> Program terminated with signal SIGSEGV, Segmentation fault. >>>>>> Address not mapped to object. >>>>>> #0 vfprintf_l (fp=3D0x4d4940, locale=3D0x8004d4128 = <__xlocale_global_locale>, fmt0=3D0x201f64 "\"%s\"", = ap=3Dap@entry=3D0x7fffffffcf00) at = /usr/main-src/lib/libc/stdio/vfprintf.c:281 >>>>>> 281 if ((fp->_flags & (__SNBF|__SWR|__SRW)) =3D=3D = (__SNBF|__SWR) && >>>>>> (gdb) bt >>>>>> #0 vfprintf_l (fp=3D0x4d4940, locale=3D0x8004d4128 = <__xlocale_global_locale>, fmt0=3D0x201f64 "\"%s\"", = ap=3Dap@entry=3D0x7fffffffcf00) at = /usr/main-src/lib/libc/stdio/vfprintf.c:281 >>>>>> #1 0x0000000800409283 in fprintf (fp=3D0x800411660 = <__stdio_cancel_cleanup>, fmt=3D0x7fffffffcdd0 "0\317\377\377\377\177") = at /usr/main-src/lib/libc/stdio/fprintf.c:57 >>>>>> #2 0x000000000020399d in main (argc=3D, = argv=3D) at dialog4ports.c:332 >>>>>> (gdb) quit >>>>>>=20 >>>>>> The crash happens after selecting OK but not after selecting = Cancel. The >>>>>> display is also odd before that (no line drawing, just odd text = instead), >>>>>> but is sufficient to be usable at that stage. >>>>>>=20 >>>>>> . . . >>>>=20 >=20 > gdb's disass/s reports the failure point via: >=20 > . . . > /usr/main-src/lib/libc/stdio/vfprintf.c: > 279 FLOCKFILE_CANCELSAFE(fp); > 0x0000000800412357 <+71>: mov 0xbf082(%rip),%rax # = 0x8004d13e0 > 0x000000080041235e <+78>: cmpl $0x0,(%rax) > 0x0000000800412361 <+81>: je 0x800412370 > 0x0000000800412363 <+83>: mov %rbx,%rdi > 0x0000000800412366 <+86>: call 0x8004c6730 <_flockfile@plt> > 0x000000080041236b <+91>: mov %rbx,%rsi > 0x000000080041236e <+94>: jmp 0x800412372 > 0x0000000800412370 <+96>: xor %esi,%esi > 0x0000000800412372 <+98>: lea -0xd19(%rip),%rdi # = 0x800411660 <__stdio_cancel_cleanup> > 0x0000000800412379 <+105>: lea -0x70(%rbp),%rdx > 0x000000080041237d <+109>: call 0x800384a90 = <__pthread_cleanup_push_imp_int> >=20 > 280 /* optimise fprintf(stderr) (and other unbuffered Unix = files) */ > 281 if ((fp->_flags & (__SNBF|__SWR|__SRW)) =3D=3D = (__SNBF|__SWR) && > =3D> 0x0000000800412382 <+114>: movzwl 0x10(%rbx),%eax > 0x0000000800412386 <+118>: and $0x1a,%eax > 0x0000000800412389 <+121>: cmp $0xa,%ax > 0x000000080041238d <+125>: jne 0x8004123a9 >=20 > 282 fp->_file >=3D 0) > 0x000000080041238f <+127>: cmpw $0x0,0x12(%rbx) >=20 > 281 if ((fp->_flags & (__SNBF|__SWR|__SRW)) =3D=3D = (__SNBF|__SWR) && > 0x0000000800412394 <+132>: js 0x8004123a9 > . . . >=20 > (gdb) info reg > rax 0x0 0 > rbx 0x4d4940 5065024 > rcx 0x7fffffffd0e0 140737488343264 > rdx 0x7fffffffcfb0 140737488342960 > rsi 0x0 0 > rdi 0x800411660 34364003936 > rbp 0x7fffffffd020 0x7fffffffd020 > rsp 0x7fffffffcfb0 0x7fffffffcfb0 > r8 0x0 0 > r9 0x0 0 > r10 0x800a330f0 34370433264 > r11 0x206 518 > r12 0x8004d4128 34364801320 > r13 0x2083a0 2130848 > r14 0x7fffffffd0e0 140737488343264 > r15 0x201f64 2105188 > rip 0x800412382 0x800412382 > eflags 0x10246 [ PF ZF IF RF ] > cs 0x43 67 > ss 0x3b 59 > ds > es > fs > gs > fs_base > gs_base >=20 > where: >=20 > (gdb) disass/s __pthread_cleanup_push_imp_int > Dump of assembler code for function __pthread_cleanup_push_imp_int: > /usr/main-src/lib/libc/gen/_pthread_stubs.c: > 289 STUB_FUNC3(__pthread_cleanup_push_imp, PJT_CLEANUP_PUSH_IMP, = void, void *, > 0x0000000800384a90 <+0>: push %rbp > 0x0000000800384a91 <+1>: mov %rsp,%rbp > 0x0000000800384a94 <+4>: mov 0x14c94d(%rip),%rax # = 0x8004d13e8 > 0x0000000800384a9b <+11>: mov 0x3c8(%rax),%rax > 0x0000000800384aa2 <+18>: pop %rbp > 0x0000000800384aa3 <+19>: jmp *%rax > End of assembler dump. >=20 >=20 > It is not obvious that any of this has any relationship with > libtinfow.so.9 or libncursesw.so.9 use unless some memory is > being trashed first. It is memory being stomped on, for example __stderrp has its value inappropriately replaced by inappropriate code. Hardware watchpoint 1: -location __stderrp Old value =3D (FILE *) 0x8004d4940 New value =3D (FILE *) 0x4d4940 caused by: 0x00000008002d298e <+62>: movb $0x0,0x84(%rax) of: 286 } else { 287 dialog_state.had_resize =3D FALSE; in: (gdb) bt #0 0x00000008002d2995 in dlg_result_key (dialog_key=3D541, fkey=3D541, = resultp=3Dresultp@entry=3D0x7fffffffd0c0) at = /usr/main-src/contrib/dialog/dlg_keys.c:287 #1 0x0000000000204934 in dlg_mixedlist = (title=3Dtitle@entry=3D0x7fffffffd150 " llvm13-13.0.0 ", = cprompt=3D0x20207c "", height=3D, min_height=3D, width=3D,=20 width@entry=3D80, item_no=3D17, items=3D0x800a3dc80, = align_center=3D, fullscreen=3D) at = mixedlist.c:475 #2 0x000000000020393b in mixedlist_show (title=3D0x7fffffffd150 " = llvm13-13.0.0 ", cprompt=3D, height=3D0, min_height=3D0, = width=3D80, items=3D0x800a3dc80, align_center=3Dfalse, fullscreen=3Dfalse)= at dialog4ports.c:212 #3 main (argc=3D, argv=3D) at = dialog4ports.c:321 (gdb) disass/s Dump of assembler code for function dlg_result_key: /usr/main-src/contrib/dialog/dlg_keys.c: 278 { 0x00000008002d2950 <+0>: push %rbp 0x00000008002d2951 <+1>: mov %rsp,%rbp 0x00000008002d2954 <+4>: push %r15 0x00000008002d2956 <+6>: push %r14 0x00000008002d2958 <+8>: push %r12 0x00000008002d295a <+10>: push %rbx 0x00000008002d295b <+11>: mov %rdx,%r14 0x00000008002d295e <+14>: mov %esi,%r15d 0x00000008002d2961 <+17>: mov %edi,%ebx 279 int done =3D FALSE; 280=09 281 DLG_TRACE(("# dlg_result_key(dialog_key=3D%d, fkey=3D%d)\n", = dialog_key, fkey)); 0x00000008002d2963 <+19>: lea -0x116aa(%rip),%rdi # = 0x8002c12c0 0x00000008002d296a <+26>: xor %r12d,%r12d 0x00000008002d296d <+29>: mov %ebx,%esi 0x00000008002d296f <+31>: mov %r15d,%edx 0x00000008002d2972 <+34>: xor %eax,%eax 0x00000008002d2974 <+36>: call 0x8002ee460 282 #ifdef KEY_RESIZE 283 if (dialog_state.had_resize) { 0x00000008002d2979 <+41>: mov 0x1ec10(%rip),%rax # = 0x8002f1590 0x00000008002d2980 <+48>: cmpb $0x0,0x84(%rax) 0x00000008002d2987 <+55>: je 0x8002d29dd 284 if (dialog_key =3D=3D ERR) { 0x00000008002d2989 <+57>: cmp $0xffffffff,%ebx 0x00000008002d298c <+60>: je 0x8002d2998 285 dialog_key =3D 0; 286 } else { 287 dialog_state.had_resize =3D FALSE; 0x00000008002d298e <+62>: movb $0x0,0x84(%rax) =3D> 0x00000008002d2995 <+69>: mov %ebx,%r12d 291 } 292 #endif . . . So: dialog_state.had_resize overlaps with the content of __stderrp at the time, specifically with the most significant byte of __stderrp . =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)