From owner-freebsd-bugs Sat Feb 15 13:30:10 2003 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB18737B401 for ; Sat, 15 Feb 2003 13:30:07 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 029CD43FB1 for ; Sat, 15 Feb 2003 13:30:06 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h1FLU6NS058407 for ; Sat, 15 Feb 2003 13:30:06 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h1FLU63O058406; Sat, 15 Feb 2003 13:30:06 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E998D37B401 for ; Sat, 15 Feb 2003 13:23:48 -0800 (PST) Received: from hotmail.com (f114.pav2.hotmail.com [64.4.37.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8B7F443FAF for ; Sat, 15 Feb 2003 13:23:48 -0800 (PST) (envelope-from howcanthisbe300@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sat, 15 Feb 2003 13:23:48 -0800 Received: from 217.229.64.209 by pv2fd.pav2.hotmail.msn.com with HTTP; Sat, 15 Feb 2003 21:23:48 GMT Message-Id: Date: Sat, 15 Feb 2003 21:23:48 +0000 From: "How Can ThisBe" To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/48318: Segmentation fault in sh with attached script Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 48318 >Category: bin >Synopsis: Segmentation fault in sh with attached script >Confidential: yes >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Feb 15 13:30:06 PST 2003 >Closed-Date: >Last-Modified: >Originator: tigger >Release: FreeBSD 5.0-RELEASE-p1 i386 >Organization: Confidential: no Synopsis: Segmentation fault in sh >Environment: System: FreeBSD piglet.l--v--l.net 5.0-RELEASE-p1 FreeBSD 5.0-RELEASE-p1 #0: Tue Feb 4 23:45:23 CET 2003 tigger@piglet.l--v--l.net:/usr/obj/usr/src/sys/PIGLET i386 >Description: I was working a simple sh script when I was suprised that I was able to produce a Segmentation fault (core dumped) crash of /bin/sh >How-To-Repeat: The following script will repeat the crash on my system every time with the following command line sh $0 -Drv -- start script -- #!/bin/sh while getopts ":Ddhrv:" COMMAND_LINE_ARGUMENT do case "${COMMAND_LINE_ARGUMENT}" in D) d="YES" f="NO" ;; d) shift 1 d="YES" ;; h) shift 1 h="YES" ;; r) shift 1 r="YES" ;; v) shift 1 v="v" ;; esac done exit 0 -- end script -- Commenting out the 'shift 1' on the -r will prevent the crash - strange. There is a good chance that my syntax is wrong, but I'm teaching my self :] >Fix: Comment out the 'shift 1' on the -r section, not sure why that prevents the crash _________________________________________________________________ Hotmail now available on Australian mobile phones. Go to http://ninemsn.com.au/mobilecentral/hotmail_mobile.asp >Release-Note: >Audit-Trail: >Unformatted: >with attached script To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message