From nobody Wed Nov 2 16:19:30 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 4N2XCQ4vSrz4gHcH for ; Wed, 2 Nov 2022 16:19:30 +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 4N2XCQ2ZYpz3kS3 for ; Wed, 2 Nov 2022 16:19:30 +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 4N2XCQ1ddZz134J for ; Wed, 2 Nov 2022 16:19:30 +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 2A2GJUw5046298 for ; Wed, 2 Nov 2022 16:19:30 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2A2GJU01046297 for ports-bugs@FreeBSD.org; Wed, 2 Nov 2022 16:19:30 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 267527] bash crashes with segfault if LC_CTYPE or LC_ALL not set Date: Wed, 02 Nov 2022 16:19:30 +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 Some People X-Bugzilla-Who: ralph@lr.los-gatos.ca.us X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-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: 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=1667405970; 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=ZvTVUaMSlaFlGC68UVZUV6XnUEXcaMMiRCteKnl8Q+w=; b=PGSfXTeVyzCAvSNmNWAbJ3jxeeOCUvV9OH0Pu2uHvss00m77JIFHJeUkLCqrDuBozsWvL1 ALixZ0XSS2uKLtnYE8thVK1JGAlHlLF62rhUghconAi3Uq4QZyE/f40Jq4VnLeL6Ij4ymJ IMS1NNlM9BiIrBWgfDtiZoT4RYUgVBLblBxdPjImHmmXUMntiZBOlj4M/q7eJJr/lVeMpS OGW9v4lZPZcwdhAxh+tipwkCKvdMbykIrUV6qi3bb4l3OoVlCXnaUdmQ/qbWvgouwLg0e3 FwrSKNbVTpVH0xCrdPC3pcvTJaXsKdxQTFtIcj+UVcgAPJA97EmATk92xtRTQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667405970; a=rsa-sha256; cv=none; b=jE3uZwTMkKqY4zUbv664Nu7ZhFMv4OU5siQW4F3hLKhI8arMRJ/YZ7VD7dnrlO375TixPN qN9ZCtgd19EK+M5Rtk9JFlDtXdB0ioiNv+9VaNeqj+OCv5LFH2UJb0UCYrjlxzhPLwzZ9f tSwnrCkfHSgsvrClMNkuV3NhiH4SMOHLdoVzFF7vma8ZgSKwMFtVikEJZfOkOL8Vbf18iV DuFKL+E7LMMKP3LF1Nbs6nnbrGj+fTeN8s8HDYVb/Cl5tX3CxxSVs6xB0YGXzIcnwDQ3vl BOORxhs5K9M79Fn+ynQbrg7HcEXs58UZb4tN7e8FpVI8wcCdfyKaTUxFkGUY3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267527 Bug ID: 267527 Summary: bash crashes with segfault if LC_CTYPE or LC_ALL not set Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: Individual Port(s) Assignee: ports-bugs@FreeBSD.org Reporter: ralph@lr.los-gatos.ca.us Applies to bash 5.2_3. Problem did not exist on 5.1_16. Problem observed on FreeBSD 12.3-RELEASE-p6, on both architectures i386 and amd64. Problem star= ted after upgrading bash. Using packages, not built from ports. Bash crashes with a segfault, unless the variable LC_CTYPE or LC_ALL are se= t to a valid value (I have tried C, C.UTF-8, and en_US.UTF-8), before any "other" commands are executed. So it works if you start it as "LC_CTPYE=3DC /usr/local/bin/bash", or it works if you have "LC_CTPYE=3DC" as the first executed line of .bashrc (and exactly equivalent with LC_ALL). By "first executed line" I mean the first first non-comment line. If LC_CTYPE is set to a syntactically valid but non-existing locale (for example "C.XXX-8" instead of UTF), and that setting is not an environment variable set when bash starts, but happens in the first line of .bashrc, th= en bash first prints an error message (and then segfaults): bash: warning: setlocale: LC_CTYPE: cannot change locale (C.XXX-8): Invalid argument Temporary workaround: Add LC_CTYPE=3D... (something valid) as the first lin= e of .bashrc for all users.=20 What's the impact of this? If a system has users who use bash as their login shell, they become locked out. And in a fashion that's hard to debug, since= the only indication that is left is an error message in /var/log/auth.log. More discussion can be found in the forum, with some traces that _martin collected, can be found in here: https://forums.freebsd.org/threads/bash-is-broken-after-upgrade-to-5-2_3.86= 938/ --=20 You are receiving this mail because: You are the assignee for the bug.=