Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: "" Newsgroups: gnu.bash.bug Subject: Large compound commands resulting in a segfault Date: Fri, 21 Jun 2019 20:22:46 +0100 Lines: 16 Approved: bug-bash@gnu.org Message-ID: References: <20190621202246.18fcb57ce720acc9095d3e0f@plushkava.net> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1561150003 14787 209.51.188.17 (21 Jun 2019 20:46:43 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plushkava.net; h=date:from:to:subject:message-id:mime-version:content-type :content-transfer-encoding; s=fm3; bh=1k9vPfk2a52CfIzxCCAgKPofna 6UU/QfBvIhqLEqdyk=; b=eNV8PWGcNid7rq6YkB4Xq7yBixA1rDm0VBzvQ+l9+F 6IiOypeLOCsSEoLVyRPQ6p1GRGoMNb7VTr5EZq6LDW00mb7dd/fWf8qo5hjMxmdB WIEh3ZQAn09E2wkkf11g2Omjv2LtBWh66wHeOhz/tSxYR68D1OlPTGaVRuW77kMP XBi7vnzTohoOSVDdmTr3yQXtXy0ZKin+gCrSHhmg+Qq+Ibqk1HWUORVDUPWpIhz/ 8G4MiuA1lan/KPuOwbQkDSnxd9MaQL+7ovq+xVXircqn2kuHtnnMij2r2BGHER09 ddq5zNNu0Ho/reHWB48mn95/1Q/FlDq7nWfDe7owDuHA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=1k9vPf k2a52CfIzxCCAgKPofna6UU/QfBvIhqLEqdyk=; b=jIGVIteStmIZSXVJM4DDQ4 XPlR5Sb8j2S3W5Gvpdl4TH121eo+ZGF2AGjFrQR/Oc09jPeHU4CdI93zL1E/JfVx 821pUDi8jUd1puLuGEyS6K2FebsrHnejKQkWt1/ZgOk6cOSjIans7meYMdmfKK6t 1HgbFAP7kx9f01R5RxPlxIwPl0Smq4oxjuizevrHQ7pnRhmHaEn8TystD5aXjL4f 1zbYy2yYbINAH0Bk4fEgUnN9lkwFcxGDmni/LqFTRx+JUbta/JxA32jG483VF0S8 b2lkM8EB8t4bcXg68DS0Wd8Ul0bFSZwuM+nvxLJqwSgTf8oem7zkOoW5JDmiX/KA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtdeigddugedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgogfhmphhthietlhhirghsucdlfeelmdenucfjug hrpeffhffvuffkofggtgfgsehtjeertdfjtddvnecuhfhrohhmpedffdcuoehkfhhmsehp lhhushhhkhgrvhgrrdhnvghtqeenucfkphepudelfedrudefkedrvddukedrudeltdenuc frrghrrghmpehmrghilhhfrhhomhepkhhfmhesphhluhhshhhkrghvrgdrnhgvthenucev lhhushhtvghrufhiiigvpedt X-ME-Proxy: X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.147.123.24 X-Mailman-Approved-At: Fri, 21 Jun 2019 16:46:40 -0400 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <20190621202246.18fcb57ce720acc9095d3e0f@plushkava.net> Xref: csiph.com gnu.bash.bug:15064 Hi, The following script generates a compound command consisting of many instances of the : command. I have found that it reproducibly induces a segfault in all versions of bash from 2 onwards. I tested various other shells - several more than are implied here - all of which could handle the generated code without issue. #!/bin/bash shells=('busybox sh' dash posh ksh mksh bash) code=$(printf '{ '; printf '%.s:; ' {1..50000}; printf '}') for shell in "${shells[@]}"; do type "${shell%% *}" &>/dev/null || continue echo "testing: $shell" echo "$code" | $shell || echo "$shell failed" done -- Kerin Millar