From nobody Wed Nov 30 11:04:53 2022 X-Original-To: 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 4NMbvT2L3hz4jdNH for ; Wed, 30 Nov 2022 11:04:53 +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 4NMbvT078Sz3CKX for ; Wed, 30 Nov 2022 11:04:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669806293; 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=ImxW7dHK8SHCSNQbDfrLCCWwr6wHUzSaWrmLTawVCmA=; b=HiWk7CgZV9qXEDLxzEHopY/6F0CGKMJbCJkflK+BP2dFSxqv63m02PePaPFjhcNc4gu37R ge/XCOTf4yBiI2Qdaw0P3DwTmwac+cMWJS4KNsXWAynprhfhfWZfxCVH39OLaCuhlxA0s4 IWK1bn7ArBJTAmQl20TNKqJZoNgGvYfXYv4UvWdDHh8hOX9y7bi4cwZYYbxaG88zfIQsE7 H7e+4SDthXdDnkQCVoeRn6eQWS7CFrlHcipoEP3bQBUtjSNP+pRsnqs3SgI3/ePbMMQqfY KAqh8+Y3vAgXTMl4MQA3fU++9FYl9wlycC31dx6vhR1Q5xaUcLNZOGOBoSjd/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669806293; a=rsa-sha256; cv=none; b=bgcuy3DcoLicuABcoZXisJ8zZoS+HtrfFAokuVA7+zrl5HeEMqbAjfL7+bbAeaxymsjc+s MVifQrEhmYWxCxn6OyS2GqDR2oURvSVTyqQRacs+kWYVny7JzFdphZTQBEfP+fDVYoHcar /824hwnZ2XVN6vOXkoAEzHoxLRh9Th68CjSnujaPN7ZB2+ekhOk5hL6D6glpOiiH+BDmnP WY/7XsRxsVV10FvYDeJGAI/822mR/XQ9aX2J0bI1zWukwpCfZ6OHBYZwJvrr1q+NBO8JpK p6Q0RgdPevYMsHt1a5Lge+2z2DYdxfZJl3dzsXveFiXDQ+/0MCN92mzzYqRVzw== 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 4NMbvS6Df1zv44 for ; Wed, 30 Nov 2022 11:04:52 +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 2AUB4q3G011352 for ; Wed, 30 Nov 2022 11:04:52 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2AUB4q3r011351 for bugs@FreeBSD.org; Wed, 30 Nov 2022 11:04:52 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: bugs@FreeBSD.org Subject: [Bug 268076] dc(1): crash on window size change Date: Wed, 30 Nov 2022 11:04:53 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: saper@saper.info X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter 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: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D268076 Bug ID: 268076 Summary: dc(1): crash on window size change Product: Base System Version: CURRENT Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: saper@saper.info > dc --version dc 5.3.3 Copyright (c) 2018-2022 Gavin D. Howard and contributors Report bugs at: https://git.yzena.com/gavin/bc This is free software with ABSOLUTELY NO WARRANTY. > bc --version bc 5.3.3 Copyright (c) 2018-2022 Gavin D. Howard and contributors Report bugs at: https://git.yzena.com/gavin/bc This is free software with ABSOLUTELY NO WARRANTY I am running -CURRENT as of 75217c2b470 on my laptop and noticed that dc du= mps core on SIGWINCH (I am using x11-wm/dwm as a window manager so this happens often): Window size change occurs after 4 is printed: radziecki> dc 2 2 + p 4 Memory fault(coredump) Core was generated by `dc'. Program terminated with signal SIGSEGV, Segmentation fault. Address not mapped to object. #0 terminal_get_size (el=3Del@entry=3D0x0, lins=3Dlins@entry=3D0x3cd5864c5= b1c, cols=3Dcols@entry=3D0x3cd5864c5b18) at /usr/src/contrib/libedit/terminal.c:931 --Type for more, q to quit, c to continue without paging-- 931 *cols =3D Val(T_co); (gdb) bt #0 terminal_get_size (el=3Del@entry=3D0x0, lins=3Dlins@entry=3D0x3cd5864c5= b1c, cols=3Dcols@entry=3D0x3cd5864c5b18) at /usr/src/contrib/libedit/terminal.c:931 #1 0x00003cd587453ff8 in el_resize (el=3D0x0) at /usr/src/contrib/libedit/el.c:614 #2 #3 _read () at _read.S:4 #4 0x00003ccd6561e351 in bc_read_chars (vec=3D0x3ccd65626848 , prompt=3D0x3ccd655f297c ">>> ") at /usr/src/contrib/bc/src/read.c:165 #5 bc_read_line (vec=3D0x3ccd65626848 , prompt=3D0x3ccd655f297c ">= >> ") at /usr/src/contrib/bc/src/read.c:238 #6 0x00003ccd65622c0b in bc_vm_readLine (clear=3D) at /usr/src/contrib/bc/src/vm.c:1053 #7 bc_vm_stdin () at /usr/src/contrib/bc/src/vm.c:1099 #8 0x00003ccd65621e9d in bc_vm_exec () at /usr/src/contrib/bc/src/vm.c:1420 #9 bc_vm_boot (argc=3D1, argv=3D0x3cd5864c62d0) at /usr/src/contrib/bc/src/vm.c:1570 #10 0x00003ccd65606334 in main (argc=3D1, argv=3D0x3cd5864c62d0) at /usr/src/contrib/bc/src/bc.c:60 (gdb) frame 4 #4 0x00003ccd6561e351 in bc_read_chars (vec=3D0x3ccd65626848 , prompt=3D0x3ccd655f297c ">>> ") at /usr/src/contrib/bc/src/read.c:165 165 r =3D read(STDIN_FILENO, vm.buf + vm.buf_len, (gdb) p vm.history $1 =3D {el =3D 0x0, hist =3D 0x0, badTerm =3D false} vm.history.el seems to be zero at this point. bc, however, behaves different, and frankly I must say I don't like its err= or handling that obscures things: radziecki> gdb /usr/bin/bc GNU gdb (GDB) 12.1 [GDB v12.1 for FreeBSD] Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-portbld-freebsd14.0". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /usr/bin/bc... Reading symbols from /usr/lib/debug//usr/bin/bc.debug... (gdb) run Starting program: /usr/bin/bc=20 warning: Could not load shared library symbols for [vdso]. Do you need "set solib-search-path" or "set sysroot"? 2+2 4 Fatal error: I/O error Function: (main) [Inferior 1 (process 26153) exited with code 04] After a bit of digging I figured out I had to do this: (gdb) b bc_vm_handleError Breakpoint 1 at 0x1050c87: file /usr/src/contrib/bc/src/vm.c, line 311. (gdb) run Starting program: /usr/bin/bc=20 warning: Could not load shared library symbols for [vdso]. Do you need "set solib-search-path" or "set sysroot"? 2+2 4 Breakpoint 1, bc_vm_handleError (e=3DBC_ERR_FATAL_IO_ERR, line=3D0) at /usr/src/contrib/bc/src/vm.c:311 311 uchar id =3D bc_err_ids[e]; (gdb) bt #0 bc_vm_handleError (e=3DBC_ERR_FATAL_IO_ERR, line=3D0) at /usr/src/contrib/bc/src/vm.c:311 #1 0x0000000001036482 in bc_history_line (h=3D, vec=3D0x105= 7848 , prompt=3D0x102397c ">>> ") at /usr/src/contrib/bc/src/history.c:268 #2 0x000000000104f194 in bc_read_line (vec=3D0x1057848 , prompt=3D) at /usr/src/contrib/bc/src/read.c:236 #3 0x0000000001053c0b in bc_vm_readLine (clear=3D) at /usr/src/contrib/bc/src/vm.c:1053 #4 bc_vm_stdin () at /usr/src/contrib/bc/src/vm.c:1099 #5 0x0000000001052e9d in bc_vm_exec () at /usr/src/contrib/bc/src/vm.c:1420 #6 bc_vm_boot (argc=3D1, argv=3D0x7fffffffe6d0) at /usr/src/contrib/bc/src/vm.c:1570 #7 0x0000000001037334 in main (argc=3D1, argv=3D0x7fffffffe6d0) at /usr/src/contrib/bc/src/bc.c:60 (gdb) up #1 0x0000000001036482 in bc_history_line (h=3D, vec=3D0x105= 7848 , prompt=3D0x102397c ">>> ") at /usr/src/contrib/bc/src/history.c:268 268 bc_err(BC_ERR_FATAL_IO_ERR); (gdb) list - 263 { 264 // If this is true, there was an error. Otherwise, = it's just EOF. 265 if (len =3D=3D -1) 266 { 267 if (errno =3D=3D ENOMEM) bc_err(BC_ERR_FATAL_ALLOC_ERR); 268 bc_err(BC_ERR_FATAL_IO_ERR); 269 } 270 else 271 { 272 bc_file_printf(&vm.fout, "\n"); (gdb) p errno $1 =3D 4 which is EINTR As noted in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264010 edit= line integration is tough, but attempting to hide all the errors is not making things better :( Can't reproduce this with 5.2.2 versions from 13.1-RELEASE --=20 You are receiving this mail because: You are the assignee for the bug.=