From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25750 invoked by alias); 20 Oct 2015 17:30:15 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36901 Received: (qmail 27600 invoked from network); 20 Oct 2015 17:30:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=yDqPOPw8O2WFQ6imeTQA+yS7cj7ibSrN9P8cqGluP+M=; b=bhzK6yGguJGNewVtphDGMD8w3DdVh7VTBveqJH+kIII9LmgxLh5lN/rCIAz+W2XHgd vKiItYPh6hQCJp+zT8/Zk1yyr7HvVguhLpndtDN/Q957Xpxcc9ku09SsY0EGP9acIfa1 Y/3ukzkqt611Cj6DcLcfsxXNwR8Bb7vzeAdQGHLQfz/v1YGoURfay+SwhisyDrBtVc8v obY0jdum7vvZkAu6ZN4qAtFARTJtZ5XhQYR3TNWBr7OaXXdQnuEw/m1hStxIvSAeLWbx oU/I8Dpcm7dHjV2QaQtgKZtu2dwS+Jhf1HBCPVBssbBF1ckXFa3He+TDLEoTrlbjWlhx 5OZA== X-Gm-Message-State: ALoCoQlpX8GdvwTq6vJ+GKg6jWunnwCsKDyHHTZQHuvdrS4WxYgfcZ33Vcx8NbFTMnZMKWts2wte X-Received: by 10.202.71.214 with SMTP id u205mr2779353oia.52.1445362208188; Tue, 20 Oct 2015 10:30:08 -0700 (PDT) From: Bart Schaefer Message-Id: <151020103005.ZM1642@torch.brasslantern.com> Date: Tue, 20 Oct 2015 10:30:05 -0700 In-Reply-To: <56261BBA.9000805@allegrodvt.com> Comments: In reply to Dorian Haglund "Bug report: zsh crashes when expanding long command from history." (Oct 20, 12:47pm) References: <56261BBA.9000805@allegrodvt.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Bug report: zsh crashes when expanding long command from history. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 20, 12:47pm, Dorian Haglund wrote: } } That means if I type something like : } } '$ !8349' } } and hit the TAB button, zsh crashes. For me it exits cleanly but with "fatal error: out of heap memory" } The command is attached (it is 41111 characters long so I won't copy } paste it here). The history mechanism is using a short integer to track the position of each word in the command line, so any command line longer than the maximum value of a signed short is going to cause problems. I don't have time today to dive further into this, but either we need to change all the "short" to something larger in hist.c, or we need to detect overflow and error out sooner, or most likely both.