From nobody Tue Dec 06 23:24:54 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 4NRc2Z6D31z4kCwB for ; Tue, 6 Dec 2022 23:24:54 +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 4NRc2Z3Xxqz3Qt9 for ; Tue, 6 Dec 2022 23:24:54 +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=1670369094; 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: in-reply-to:in-reply-to:references:references; bh=E2uxiKRdgC+mR4rgpX1oRwqR5bvI2TpcyWmm9GVC0rA=; b=MctM9Oy5fz3mQ9s9InlIlmIA5p3mBsS3knxKHTKfsHJ4eQgZeysX0WJP+qKsVNymwUsttT 6aGfYoe77UcnLBQ0NV+qT3uh/ISTGEIo2CVIje9Hbwz/g5ILiF60w4x7tp+QeKQUVaO/XX GOSsqbOPLerpJZJorW7nId8YKjHSRdgVPjcnhI2NC2G0kZirjvVMIrWLMTHbgYTl6pdDzG xe74Uabq0uto63Xz1tY2JiQMh8bSizv8Q9MR2+4VDxS46IS5rVDVIzTfgE/qZR2PaWwL1H ZjnwZa3Hz3ub/Ic7uHupkiQVZZtZtF45BMDXWYuaAITE4U42kEH4yd9lTD7hjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670369094; a=rsa-sha256; cv=none; b=V9umUitf6Xc2gTOwv8MvXQGWmn45EjVNiOAhszSAlFnFeqa2YmRyLafUjQaQuTN5LUkSzS QCJvWmxiGD/LcEp/iFRv83JXmAyLiwZopCbqitqjXLWJjCq80vZu+cFmxYqhMuczgiA1o/ 1hNi6DunILYnV5MS9+7B/PCInjcPcIg3SUERTObwf8LLRaKLhLYqaUXDvalRL4u35uWB8J l3+3YsIBf3MPRRZhtjqjpox72YBz9I9yAnZjlMPfJO1Z0dcI4ZLFXh6XaYyzpyuHhqXbGI FptHrA6wQEDvVHTEbAJPeEpn0gPVCiQrKpwHD220gXpfDodgBIdCEkrsqox/WA== 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 4NRc2Z2bVzzw2C for ; Tue, 6 Dec 2022 23:24:54 +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 2B6NOsfk012983 for ; Tue, 6 Dec 2022 23:24:54 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2B6NOsWN012982 for bugs@FreeBSD.org; Tue, 6 Dec 2022 23:24:54 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: Tue, 06 Dec 2022 23:24:54 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: crash X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: saper@saper.info X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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 --- Comment #14 from Marcin Cie=C5=9Blak --- I have set a breakpoint on the signal handler and single-stepped it a bit: +b bc_vm_sig Note: breakpoint 1 also set at pc 0x23a66b. Breakpoint 2 at 0x23a66b: file ./src/vm.c, line 123. +run Starting program: /usr/home/saper/src/bc/bin/bc=20 warning: Could not load shared library symbols for [vdso]. Do you need "set solib-search-path" or "set sysroot"? Breakpoint 1, bc_vm_sig (sig=3D28) at ./src/vm.c:123 123 if (vm->status =3D=3D (sig_atomic_t) BC_STATUS_QUIT || vm->= sig !=3D 0) +p *vm $2 =3D {status =3D 0, sig_pop =3D 0, prs =3D {l =3D {buf =3D 0x0, i =3D 0, = line =3D 1, len =3D 0,=20 t =3D BC_LEX_EOF, last =3D BC_LEX_EOF, str =3D {v =3D 0x800a2a0e0 '\2= 45' ,=20 len =3D 0, cap =3D 32, size =3D 1, dtor =3D 0}, mode =3D BC_MODE_EX= PRS}, flags =3D { v =3D 0x800a43040 "", len =3D 1, cap =3D 32, size =3D 2, dtor =3D 0},= exits =3D { v =3D 0x800a5d300 '\245' ..., len =3D 0, cap =3D 3= 2, size =3D 24,=20 dtor =3D 0}, conds =3D {v =3D 0x800a50700 '\245' .= .., len =3D 0, cap =3D 32,=20 size =3D 8, dtor =3D 0}, ops =3D {v =3D 0x800a09000 '\245' , len =3D 0,=20 cap =3D 32, size =3D 4, dtor =3D 0}, buf =3D {v =3D 0x800a2a0c0 '\245= ' ,=20 len =3D 0, cap =3D 32, size =3D 1, dtor =3D 0}, prog =3D 0x23ea00 ,=20 func =3D 0x800a47000, fidx =3D 0, auto_part =3D false}, prog =3D {globa= ls =3D {10, 10, 0, 10},=20 globals_v =3D {{v =3D 0x800a50000 "\n", len =3D 1, cap =3D 32, size =3D= 8, dtor =3D 0}, { v =3D 0x800a50100 "\n", len =3D 1, cap =3D 32, size =3D 8, dtor =3D= 0}, {v =3D 0x800a50200 "",=20 len =3D 1, cap =3D 32, size =3D 8, dtor =3D 0}, {v =3D 0x800a50300 = "\n", len =3D 1, cap =3D 32,=20 size =3D 8, dtor =3D 0}}, rng =3D {v =3D {v =3D 0x800a54000 "", len= =3D 1, cap =3D 32, size =3D 32,=20 dtor =3D 0}}, results =3D {v =3D 0x800a57000 '\245' ..., len =3D 0,=20 cap =3D 32, size =3D 48, dtor =3D 6}, stack =3D {v =3D 0x800a5d000 ""= , len =3D 1, cap =3D 32,=20 size =3D 24, dtor =3D 0}, consts =3D {v =3D 0x800a60000 '\245' ...,=20 len =3D 0, cap =3D 32, size =3D 56, dtor =3D 5}, const_map =3D { v =3D 0x800a44c00 '\245' ..., len =3D 0, cap =3D 3= 2, size =3D 16,=20 dtor =3D 0}, strs =3D {v =3D 0x800a50600 '\245' ..= ., len =3D 0, cap =3D 32,=20 size =3D 8, dtor =3D 0}, str_map =3D {v =3D 0x800a44e00 '\245' ...,=20 len =3D 0, cap =3D 32, size =3D 16, dtor =3D 0}, fns =3D {v =3D 0x800= a47000 "\200\240\242",=20 len =3D 2, cap =3D 32, size =3D 120, dtor =3D 3}, fn_map =3D {v =3D 0= x800a44200 "", len =3D 2,=20 cap =3D 32, size =3D 16, dtor =3D 0}, vars =3D {v =3D 0x800a54400 '\2= 45' ...,=20 len =3D 0, cap =3D 32, size =3D 32, dtor =3D 1}, var_map =3D { v =3D 0x800a44800 '\245' ..., len =3D 0, cap =3D 3= 2, size =3D 16,=20 dtor =3D 0}, arrs =3D {v =3D 0x800a54800 '\245' ..= ., len =3D 0, cap =3D 32,=20 size =3D 32, dtor =3D 1}, arr_map =3D {v =3D 0x800a44a00 '\245' ...,=20 len =3D 0, cap =3D 32, size =3D 16, dtor =3D 0}, tail_calls =3D {v = =3D 0x0, len =3D 0, cap =3D 0,=20 size =3D 0, dtor =3D 0}, strmb =3D {num =3D 0x23ecd8 , = rdx =3D 0, scale =3D 0,=20 len =3D 1, cap =3D 8}, asciify =3D {num =3D 0x800a2a040, rdx =3D 0, s= cale =3D 0, len =3D 0,=20 cap =3D 8}, last =3D {num =3D 0x800a2a060, rdx =3D 0, scale =3D 0, le= n =3D 0, cap =3D 8},=20 strmb_num =3D {256, 0, 0, 0, 0, 0, 0, 0}}, line_buf =3D {v =3D 0x800a2a= 800 "", len =3D 1,=20 cap =3D 32, size =3D 1, dtor =3D 0}, buffer =3D {v =3D 0x800a2a100 "", = len =3D 1, cap =3D 32,=20 size =3D 1, dtor =3D 0}, read_prs =3D {l =3D {buf =3D 0x0, i =3D 0, lin= e =3D 0, len =3D 0,=20 t =3D BC_LEX_EOF, last =3D BC_LEX_EOF, str =3D {v =3D 0x0, len =3D 0,= cap =3D 0, size =3D 0,=20 dtor =3D 0}, mode =3D BC_MODE_EXPRS}, flags =3D {v =3D 0x0, len =3D= 0, cap =3D 0, size =3D 0,=20 dtor =3D 0}, exits =3D {v =3D 0x0, len =3D 0, cap =3D 0, size =3D 0, = dtor =3D 0}, conds =3D {v =3D 0x0,=20 len =3D 0, cap =3D 0, size =3D 0, dtor =3D 0}, ops =3D {v =3D 0x0, le= n =3D 0, cap =3D 0, size =3D 0,=20 dtor =3D 0}, buf =3D {v =3D 0x0, len =3D 0, cap =3D 0, size =3D 0, dt= or =3D 0}, prog =3D 0x0,=20 func =3D 0x0, fidx =3D 0, auto_part =3D false}, read_buf =3D {v =3D 0x0= , len =3D 0, cap =3D 0,=20 size =3D 0, dtor =3D 0}, jmp_bufs =3D {v =3D 0x800a32000 "!\250!", len = =3D 2, cap =3D 32, size =3D 96,=20 dtor =3D 0}, temps_len =3D 0, file =3D 0x20ab00 "",=20 sigmsg =3D 0x20a120 "\ninterrupt (type \"quit\" to exit)\n", sig_lock =3D 1,=20 sig =3D 0, siglen =3D 33 '!', read_ret =3D 77 'M', flags =3D 15808, nchar= s =3D 0, line_len =3D 69,=20 no_exprs =3D false, exit_exprs =3D false, eof =3D false, mode =3D 2 '\002= ', no_redefine =3D false,=20 files =3D {v =3D 0x0, len =3D 0, cap =3D 0, size =3D 0, dtor =3D 0}, expr= s =3D {v =3D 0x0, len =3D 0, cap =3D 0, size =3D 0, dtor =3D 0}, name =3D 0x7fffffffea8b "bc"= , help =3D 0x2059b0 "usage: %s [options] [file...]\n\nbc is a command-line, arbitrary-precision calculator with a Turing-complete\nlanguage. For detail= s, use `man %s` or see the online documentation at\nhttps://git.yzena.com/"..., history =3D {el =3D 0x800a6a000, hist =3D 0x800a67000, badTerm =3D false}, = next =3D 0x2113a0 , parse =3D 0x2126c0 , expr =3D 0x21= 3430 , func_header =3D 0x80027f32c "Function:", err_ids =3D {0x80= 027f336 "Math error:", 0x80027f342 "Parse error:", 0x80027f34f "Runtime error:", 0x80027f35e "Fatal error:", 0x80027f36b "Warning:"}, err_msgs =3D {0x80027f= 374 "negative number", 0x80027f384 "non-integer number", 0x80027f397 "overflow: number does not fit into a hardware number", 0x80027f3cc "divide by 0", 0x80027fa7c "memory allocation failed", 0x80027fa95 "I/O error", 0x80027fa9f "cannot open file: %s", 0x80027fab4 "file is not text: %s", 0x80027fac9 "pa= th is a directory: %s", 0x80027fae1 "invalid command-line option: \"%s\"", 0x80027fb03 "option requires an argument: '%c' (\"%s\")", 0x80027fb2c "opti= on takes no arguments: '%c' (\"%s\")", 0x80027fb53 "invalid command-line option argument: \"%s\"", 0x80027f901 "invalid ibase: must be [%lu, %lu]", 0x80027= f923 "invalid obase: must be [%lu, %lu]", 0x80027f945 "invalid scale: must be [%= lu, %lu]", 0x80027f967 "invalid read() expression", 0x80027f981 "recursive read= () call", 0x80027f997 "variable or array element is the wrong type", 0x80027f9= c3 "stack has too few elements", 0x80027f9de "stack for register \"%s\" has too few elements", 0x80027fa0b "wrong number of parameters; need %zu, have %zu", 0x80027fa3a "undefined function: %s()", 0x80027fa53 "cannot use a void valu= e in an expression", 0x80027f3d8 "end of file", 0x80027f3e4 "invalid character '%c'", 0x80027f3fb "string end cannot be found", 0x80027f416 "comment end cannot be found", 0x80027f432 "invalid token", 0x80027f440 "invalid expression", 0x80027f453 "empty expression", 0x80027f464 "invalid print or stream statement", 0x80027f486 "invalid function definition", 0x80027f4a2 "invalid assignment: left side must be scale, ibase, obase, seed, last, var= , or array element", 0x80027f4ff "no auto variable found", 0x80027f516 "function parameter or auto \"%s%s\" already exists", 0x80027f547 "block end cannot be found", 0x80027f561 "cannot return a value from void function: %s()", 0x80027f590 "var cannot be a reference: %s", 0x80027f5ae "POSIX does not al= low names longer than 1 character: %s", 0x80027f5e5 "POSIX does not allow '#' script comments", 0x80027f60e "POSIX does not allow the following keyword: = %s", 0x80027f63d "POSIX does not allow a period ('.') as a shortcut for the last result", 0x80027f683 "POSIX requires parentheses around return expressions", 0x80027f6b8 "POSIX does not allow the following operator: %s", 0x80027f6e8 "POSIX does not allow comparison operators outside if statements or loops", 0x80027f731 "POSIX requires 0 or 1 comparison operators per condition", 0x80027f76a "POSIX requires all 3 parts of a for loop to be non-empty", 0x80027f7a3 "POSIX requires a newline between a semicolon and a function definition", 0x80027f7ea "POSIX does not allow exponential notation", 0x80027f814 "POSIX does not allow array references as function parameters", 0x80027f851 "POSIX does not allow void functions", 0x80027f875 "POSIX requi= res the left brace be on the same line as the function header", 0x80027f8be "PO= SIX does not allow strings to be assigned to variables or arrays"}, locale =3D 0x8004a9380 "pl_PL.UTF-8/pl_PL.UTF-8/pl_PL.UTF-8/pl_PL.UTF-8/pl_PL.UTF-8/C", maxes =3D {36, 1000000000, 18446744073709551614, 18446744073709551615, 0}, last_base =3D 0, last_pow =3D 0, last_exp =3D 0, last_rem =3D 0, env_args_b= uffer =3D 0x0, env_args =3D {v =3D 0x0, len =3D 0, cap =3D 0, size =3D 0, dtor =3D 0}, zer= o =3D {num =3D 0x23f27c , rdx =3D 0, scale =3D 0, len =3D 0, cap =3D 1}, one= =3D {num =3D 0x23f278 , rdx =3D 0, scale =3D 0, len =3D 1, cap =3D 1}, max= =3D {num =3D 0x23f238 , rdx =3D 0, scale =3D 0, len =3D 3, cap =3D 8}, max= 2 =3D {num =3D 0x23f258 , rdx =3D 0, scale =3D 0, len =3D 5, cap =3D 8}, max= _num =3D {709551616, 446744073, 18, 0, 0, 0, 0, 0}, max2_num =3D {768211456, 3746074= 31, 938463463, 282366920, 340, 0, 0, 0}, one_num =3D {1}, zero_num =3D {0}, fou= t =3D {f =3D 0x8004a1b08}, ferr =3D {f =3D 0x8004a1c40}, catalog =3D 0x800a42000, buf = =3D 0x2402f0 "", buf_len =3D 0, slabs =3D {v =3D 0x800a44000 "", len =3D 1= , cap =3D 32, size =3D 16, dtor =3D 4}, redefined_kws =3D {false }, tem= ps_buf =3D {0x0 }} +p errno $3 =3D 2 +n 131 if (sig =3D=3D SIGWINCH) +n 133 if (BC_TTY) +n 135 el_resize(vm->history.el); +n 136 } +n 144 return; +n 198 } +n _read () at _read.S:4 4 _read.S: No such file or directory. +n cerror () at /usr/src/lib/libc/amd64/sys/cerror.S:52 52 pushq %rax +n cerror () at /usr/src/lib/libc/amd64/sys/cerror.S:53 53 call PIC_PLT(CNAME(__error)) +bt #0 cerror () at /usr/src/lib/libc/amd64/sys/cerror.S:53 #1 0x0000000000000004 in ?? () #2 0x00000008002a4365 in read_char (el=3D0x800a6a000,=20 cp=3D0x7fffffffe294 L"\b\xffffe334=E7=BF=BF\x86587f0\x9d83834d\xffffe6a0=E7=BF=BF\xffffe688=E7= =BF=BF") at /usr/src/contrib/libedit/read.c:287 #3 0x00000008002a47af in el_wgetc (el=3Del@entry=3D0x800a6a000,=20 cp=3Dcp@entry=3D0x7fffffffe294 L"\b\xffffe334=E7=BF=BF\x86587f0\x9d83834d\xffffe6a0=E7=BF=BF\xffffe688=E7= =BF=BF") at /usr/src/contrib/libedit/read.c:406 #4 0x00000008002a49ab in read_getcmd (el=3D, cmdnum=3D,=20 ch=3D) at /usr/src/contrib/libedit/read.c:233 #5 el_wgets (el=3D0x800a6a000, nread=3D0x7fffffffe334) at /usr/src/contrib/libedit/read.c:519 #6 0x000000080029b199 in el_gets (el=3D0x0, nread=3D0x7fffffffe18a) at /usr/src/contrib/libedit/eln.c:75 #7 0x00000000002187e2 in bc_history_line (h=3D0x23ef10 ,=20 vec=3D0x23ecf8 , prompt=3D0x201cbd ">>> ") at ./src/histo= ry.c:259 #8 0x0000000000235870 in bc_read_line (vec=3D0x23ecf8 , prompt=3D0x201cbd ">>> ") at ./src/read.c:250 #9 0x0000000000238d3e in bc_vm_readLine (clear=3Dtrue) at ./src/vm.c:1123 #10 0x000000000023b6f0 in bc_vm_stdin () at ./src/vm.c:1174 #11 0x000000000023a64d in bc_vm_exec () at ./src/vm.c:1510 #12 0x000000000023996e in bc_vm_boot (argc=3D1, argv=3D0x7fffffffe690) at ./src/vm.c:1700 #13 0x000000000021138c in bc_main (argc=3D1, argv=3D0x7fffffffe690) at ./src/bc.c:62 #14 0x000000000021a8c9 in main (argc=3D1, argv=3D0x7fffffffe690) at ./src/main.c:108 +q What happens here is that the signal handler does not do too much, it tells libedit to resize and then exits with an early "return". Since we are in a read() system call, it will be interrupted. --=20 You are receiving this mail because: You are the assignee for the bug.=