From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20702 invoked from network); 4 Jan 2008 09:27:57 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Jan 2008 09:27:57 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 90993 invoked from network); 4 Jan 2008 09:27:50 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Jan 2008 09:27:50 -0000 Received: (qmail 1107 invoked by alias); 4 Jan 2008 09:27:46 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24351 Received: (qmail 1086 invoked from network); 4 Jan 2008 09:27:45 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 4 Jan 2008 09:27:45 -0000 Received: from virusfilter.dotsrc.org (bifrost [127.0.0.1]) by spamfilter.dotsrc.org (Postfix) with ESMTP id E1EFF8058FF2 for ; Fri, 4 Jan 2008 10:27:41 +0100 (CET) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.185]) by bifrost.dotsrc.org (Postfix) with ESMTP for ; Fri, 4 Jan 2008 10:27:41 +0100 (CET) Received: by rv-out-0910.google.com with SMTP id b22so4076895rvf.21 for ; Fri, 04 Jan 2008 01:27:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=kZdC7TpigFS6rerd1tKQIRFMwwCfAfelxDE/Aal58iU=; b=KTEX2lJitkh6/Pn3JGR+Ty8lSnHLuk7NUpp0eGYRRcIdq5/x1vtgcmVpnmgHTEBlELXV9gvshuvbbigaEmBShq1jFmqmrvDnwDNtDY00KUQS9fArm1RvQKTmIgVJ8uuDV2kCIVZ+zmEaC8gR8XUNn6GLk2aukZYDKt24leFMOxE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=bBQkn1eaWN42sl5jPRW8lj1i6fuTuWJKK4D7KQNt59ZLXEJPudjFdzCpIfm1cpqrVdWH1FpMizPxLfF5weTiOd19Lm10lzRcqfMikRJ4BndEoTGFvthK6IWB4Y4Eihcn3qxdbMLxvrS9ntGoX2SzXOW82ZLzpxNShddpaLIZ25A= Received: by 10.141.115.6 with SMTP id s6mr8701560rvm.4.1199438860110; Fri, 04 Jan 2008 01:27:40 -0800 (PST) Received: by 10.140.127.7 with HTTP; Fri, 4 Jan 2008 01:27:40 -0800 (PST) Message-ID: <237967ef0801040127k49e92485rf09ce72c47d076c5@mail.gmail.com> Date: Fri, 4 Jan 2008 10:27:40 +0100 From: "Mikael Magnusson" To: zsh-workers Subject: Crash with =~ in script, but not interactively MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: ClamAV using ClamSMTP I was going to make a wrapper script that replaces the :43: in gcc warnings with +43 so i can open in vim easierly, but ran into some problems. #!/bin/zsh #this makes zsh segfault if [[ $#@ = 1 ]]; then if [[ $1 =~ /?[^/]+:[0-9]+:$ ]]; then echo hello fi fi If i save that in a file and run 'zsh file' it crashes, but if i run 'source file' in an open shell it works as expected. Here's a backtrace with -g3 -O0 Program received signal SIGSEGV, Segmentation fault. 0x080d0d16 in taddstr (s=0xc93fa008
) at text.c:68 68 int sl = strlen(s); (gdb) bt #0 0x080d0d16 in taddstr (s=0xc93fa008
) at text.c:68 #1 0x080d1ce2 in gettext2 (state=0xafb7dc3c) at text.c:538 #2 0x080d1008 in getjobtext (prog=0xa7f11480, c=0xa7f114bc) at text.c:172 #3 0x0807656b in execpline2 (state=0xafb7e22c, pcode=259, how=18, input=0, output=0, last1=0) at exec.c:1481 #4 0x0807597b in execpline (state=0xafb7e22c, slcode=26626, how=18, last1=0) at exec.c:1275 #5 0x080751df in execlist (state=0xafb7e22c, dont_change_job=0, exiting=0) at exec.c:1081 #6 0x08074dee in execode (p=0xa7f11480, dont_change_job=0, exiting=0) at exec.c:939 #7 0x0808ddb6 in loop (toplevel=1, justonce=0) at init.c:181 #8 0x08090f15 in zsh_main (argc=2, argv=0xafb7e384) at init.c:1352 #9 0x0805ead6 in main (argc=Cannot access memory at address 0xffffffff ) at ./main.c:93 (gdb) bt full #0 0x080d0d16 in taddstr (s=0xc93fa008
) at text.c:68 sl = -918577144 c = 0 '\0' #1 0x080d1ce2 in gettext2 (state=0xafb7dc3c) at text.c:538 end = (Wordcode) 0xaa0b5378 s = (Tstack) 0x0 n = (Tstack) 0x819bd30 stack = 0 code = 959262863 c1 = {0x815d5ab "=", 0x815d5ad "!=", 0x815d5b0 "<", 0x815d5b2 ">", 0x815d5b4 "-nt", 0x815d5b8 "-ot", 0x815d5bc "-ef", 0x815d5c0 "-eq", 0x815d5c4 "-ne", 0x815d5c8 "-lt", 0x815d5cc "-gt", 0x815d5d0 "-le", 0x815d5d4 "-ge", 0x815d5d8 "=~"} #2 0x080d1008 in getjobtext (prog=0xa7f11480, c=0xa7f114bc) at text.c:172 s = {prog = 0xa7f11480, pc = 0xa7f11534, strs = 0xa7f11524 "/\224\217\206/\220+:\2170-9\220+:\205"} jbuf = "if [[ \205\204@ = 1 ]]; then; if [[ \2051 =~ /\224\217\206/\220+:\2170-9\220+:\205 ]]; then; echo hello; \005rE " #3 0x0807656b in execpline2 (state=0xafb7e22c, pcode=259, how=18, input=0, output=0, last1=0) at exec.c:1481 pid = 134828847 pipes = {2, -1346904904} #4 0x0807597b in execpline (state=0xafb7e22c, slcode=26626, how=18, last1=0) at exec.c:1275 ipipe = {0, 0} opipe = {0, 0} pj = 0 newjob = 1 old_simple_pline = 0 slflags = 0 code = 259 ---Type to continue, or q to quit--- lastwj = 0 lpforked = 0 #5 0x080751df in execlist (state=0xafb7e22c, dont_change_job=0, exiting=0) at exec.c:1081 donedebug = 0 next = (Wordcode) 0xa7f11520 code = 26626 ret = -1346903576 cj = 0 csp = 0 ltype = 18 old_pline_level = 0 old_list_pipe = 0 oldlineno = 8 oldnoerrexit = 0 donetrap = 0 #6 0x08074dee in execode (p=0xa7f11480, dont_change_job=0, exiting=0) at exec.c:939 s = {prog = 0xa7f11480, pc = 0xa7f114bc, strs = 0xa7f11524 "/\224\217\206/\220+:\2170-9\220+:\205"} #7 0x0808ddb6 in loop (toplevel=1, justonce=0) at init.c:181 toksav = 1 prog = (Eprog) 0xa7f11480 #8 0x08090f15 in zsh_main (argc=2, argv=0xafb7e384) at init.c:1352 t = (char **) 0xafb7e38c t0 = 157 #9 0x0805ead6 in main (argc=Cannot access memory at address 0xffffffff ) at ./main.c:93 No locals. Using revision 'Based on 24334: Documentation for run-help improvements.' which is currently the latest. -- Mikael Magnusson