From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14613 invoked by alias); 23 Jul 2015 21:53:02 -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: 35875 Received: (qmail 22096 invoked from network); 23 Jul 2015 21:52:58 -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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=eBZfYsDDmWiA0Q5PSqN3S2bJmdA=; b=w7S5lS pDe+Y1hxMlwJLqb3fqIcVBDfBmzPwaYn1rpYuIv0924w99EQd/CxHM+dOEXCFYiF xi5K1OcSRdpbKNdq80mugPtIZzO6RF/bgalr+xaS/1Wem1s3PZERiQdTubrIAZKE cijbyzOKTuRegQ0mxOOUczfQRtDPtaSVMtKdk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=eBZfYsDDmWiA0Q5PSqN3S2bJmdA=; b=I+dF9 bGYHqcGXWVhdmMO8A4LJ+6G57RCD7UmeTQD09Nj0SSP5/mrvnpe83b5hYuNmGBKl oTw3KOdn6z1zT7F2CjALz7mKnVZansFXsDgwoeUNYz5o7zCRgfY8uZL2Ppe9jGbk uN79FWS7zUmJyH3Tab36UY2cIJm/66osAPP3bw= X-Sasl-enc: tvoONJzMmU5GFSEm/3kK1r3kQ+9in6CvXJ7BmiFeKA64 1437688372 Date: Thu, 23 Jul 2015 21:52:50 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Cc: Kamil Dudka Subject: SEGV with alias\ Message-ID: <20150723215250.GG1847@tarsus.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.21 (2010-09-15) [CCing reporter of the recent ihungetc() issue] Typing may segfault if 'ls' is aliased. The segfault is: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff6fe31d5 in _int_malloc (av=0x7ffff72f1e40, bytes=2) at malloc.c:4308 4308 malloc.c: No such file or directory. (gdb) bt #0 0x00007ffff6fe31d5 in _int_malloc (av=0x7ffff72f1e40, bytes=2) at malloc.c:4308 #1 0x00007ffff6fe5a70 in *__GI___libc_malloc (bytes=2) at malloc.c:3660 #2 0x00000000004694f3 in zshcalloc (size=2) at mem.c:918 #3 0x000000000045464b in inungetc (c=10) at input.c:442 #4 0x0000000000449a53 in ihungetc (c=10) at hist.c:926 #5 0x000000000044993b in ihungetc (c=92) at hist.c:908 #6 0x0000000000449949 in ihungetc (c=92) at hist.c:908 #7 0x0000000000449949 in ihungetc (c=92) at hist.c:908 #8 0x0000000000449949 in ihungetc (c=92) at hist.c:908 #9 0x0000000000449949 in ihungetc (c=92) at hist.c:908 #10 0x0000000000449949 in ihungetc (c=92) at hist.c:908 Another behaviour is this: ### Short expansion: two warnings $ zsh -f % alias ls=: % ls\ > Warning: backing up wrong character. Warning: backing up wrong character. ### Long expansion: infinite loop % alias ls=:\ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz % ls\ > Warning: backing up wrong character. Warning: backing up wrong character. Warning: backing up wrong character. ... ^C Warning: backing up wrong c% haracter. ### The '%' in the next-to-last line is in reverse video. I'm not completely sure what's the distinction — my 'print $ZSH_PATCHLEVEL' statements were acting up (!), reporting sometimes a commit before the ihungetc fix and sometimes after it. So I'm guessing the segfault is pre-35854 and the warning after it. Reported by 'thm' on IRC. Cheers, Daniel