zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: "Zsh Hackers' List" <zsh-workers@zsh.org>
Subject: Re: grammar triviality with '&&'
Date: Wed, 4 Mar 2015 23:05:44 +0100	[thread overview]
Message-ID: <CAHYJk3QwN+DHpD3ZCMFjOeZ7Wq+krHzx7rTWBQG071PoYe_q=g@mail.gmail.com> (raw)
In-Reply-To: <20150304151830.5e20d732@pwslap01u.europe.root.pri>

On Wed, Mar 4, 2015 at 4:18 PM, Peter Stephenson
<p.stephenson@samsung.com> wrote:
> On Wed, 4 Mar 2015 15:47:56 +0100
> Vincent Lefevre <vincent@vinc17.net> wrote:
>> I've found a bug:
>>
>> % alias '&&=(){ return $? } && '
>> % && echo OK
>> zsh: parse error near `&&'
>
> (Moved to zsh-workers)
>
> I was keeping very quiet about this, but it looks like it's not as hairy
> as I thought it might be and the new code is actually slightly cleaner...
>
> Now waiting for obscure failures elsewhere...

All I have to do is press ctrl-c at a prompt, and it crashes:

Core was generated by `zsh -f'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000435477 in hasher (str=0x1 <error: Cannot access memory
at address 0x1>)
    at hashtable.c:85
85        while ((c = *((unsigned char *) str++)))
(gdb) bt
#0  0x0000000000435477 in hasher (str=0x1 <error: Cannot access memory
at address 0x1>)
    at hashtable.c:85
#1  0x0000000000435490 in gethashnode (ht=0x1a9b6a0, nam=0x0) at hashtable.c:231
#2  0x00000000004484fc in checkalias () at lex.c:1743
#3  0x000000000044ae74 in exalias () at lex.c:1784
#4  0x000000000044b0b7 in zshlex () at lex.c:272
#5  0x0000000000467d93 in parse_event (endtok=endtok@entry=37) at parse.c:538
#6  0x000000000043dc29 in loop (toplevel=toplevel@entry=1,
justonce=justonce@entry=0)
    at init.c:145
#7  0x0000000000440a32 in zsh_main (argc=<optimized out>,
argv=0x7fffef4307d8) at init.c:1674
#8  0x000000000040f1c6 in main (argc=<optimized out>, argv=<optimized
out>) at ./main.c:93

(Note that if you run it inside gdb, you need to change the settings
for 'handle SIGINT' with the command:
(gdb) handle SIGINT nostop noprint pass
or gdb will eat the ctrl-c)

-- 
Mikael Magnusson


  parent reply	other threads:[~2015-03-04 22:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <54F33934.2070607@eastlink.ca>
     [not found] ` <13666281425228233@web7o.yandex.ru>
     [not found]   ` <54F345D3.9010204@eastlink.ca>
     [not found]     ` <D0509295-7DA9-4F18-9E3D-D50C0A756998@larryv.me>
     [not found]       ` <20150302022754.GA7449@xvii.vinc17.org>
     [not found]         ` <CABx2=D8efL3X2tfB+_+VweY2yye6EhaMNbJa3b3jJeVMp=7gaQ@mail.gmail.com>
     [not found]           ` <20150302104619.GC6869@xvii.vinc17.org>
     [not found]             ` <20150302110610.2e2c7e86@pwslap01u.europe.root.pri>
     [not found]               ` <CAH+w=7YoHjN85hqOZVywOfYGZqvU74vZrbE84Ln+V2HQi-6nSA@mail.gmail.com>
     [not found]                 ` <20150304144756.GA27231@ypig.lip.ens-lyon.fr>
2015-03-04 15:18                   ` Peter Stephenson
2015-03-04 21:13                     ` Daniel Shahaf
2015-03-04 22:05                     ` Mikael Magnusson [this message]
2015-03-05  9:46                       ` Peter Stephenson
     [not found]                   ` <150304175112.ZM19818@torch.brasslantern.com>
     [not found]                     ` <20150305100638.55631238@pwslap01u.europe.root.pri>
2015-03-05 17:07                       ` Aliasing separators (Re: grammar triviality with '&&') Bart Schaefer
2015-03-05 17:40                         ` Peter Stephenson
2015-03-06  1:42                           ` Bart Schaefer
2015-03-06  4:13                             ` Mikael Magnusson
2015-03-06 16:43                               ` Vincent Lefevre
2015-03-06  9:40                             ` Peter Stephenson
2015-03-06 19:26                               ` Bart Schaefer
2015-03-07 15:52                                 ` Peter Stephenson
2015-03-07 17:18                                   ` Ray Andrews
2015-03-07 21:10                                   ` Bart Schaefer
2015-03-09 11:46                                     ` Vincent Lefevre
2015-03-09 16:33                                       ` Peter Stephenson
2015-03-09 17:03                                         ` Bart Schaefer
2015-03-09 17:39                                           ` Peter Stephenson
2015-03-09 17:47                                           ` Ray Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHYJk3QwN+DHpD3ZCMFjOeZ7Wq+krHzx7rTWBQG071PoYe_q=g@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).