Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] Segfault if zcompile followed by source, on large file
- X-seq: zsh-workers 42225
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [BUG] Segfault if zcompile followed by source, on large file
- Date: Fri, 05 Jan 2018 10:23:18 +0000
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180105102323euoutp01de62b0149d13d20272631e90742dc952~G4uZN6UIZ2190921909euoutp01J
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1515147803; bh=qWsOt6i5GUfWFHkbg674/LSlwjmKDNpVBnj3EYVGqPU=; h=Date:From:To:Subject:In-reply-to:References:From; b=WlI4Ekv/Evw/FSFRMp7HTmIT/BDmr/RDZpm4Vc8PM/jvtMgHNQscKNpA8ccb/4U1U H2X6HiCx/FunlQm3mMb4mpN3NHgyZ5e9v4KUf6vuNnqNNQZFzS1yTKKPzr4JIwITkn QI0yzH/79uh7/fy7+ymc2kj7Wysc7Mf9yOFaEOJU=
- In-reply-to: <etPan.5a4b9bf3.5f062768.13d7@zdharma.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CGME20180102145007epcas2p35349fe256ab195853ed923c0f84f900b@epcas2p3.samsung.com> <etPan.5a4b9bf3.5f062768.13d7@zdharma.org>
On Tue, 2 Jan 2018 15:49:22 +0100
Sebastian Gniazdowski <psprint@xxxxxxxxxxx> wrote:
> I noticed that zcompiling a 4.29 MiB source and then sourcing it
> causes segfault.
>
Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote
> For the archives, that file contains the output of `repeat 300000 echo
> "a=1; b=2; c=3;"`.
I don't think anyone now understands quite how this works, but the
failure comes the first time prog->strs is referred to. Short strings
are hidden within the word code itself, so prog->strs is only used
for long strings. It's not clear that should actually be needed here
with the assignments in question.
In any case, tracking through check_dump_file suggests that prog->strs
is empty --- at least, it's being set to point to the end of the valid
mapped ragne, so accessing it at all is invalid. That may mean
the compiler (which I haven't walked through) also thought it wasn't
needed.
I suspect it's simply that this file is too long for word code
compilation, as word code has intrinisic limits on valid says based
around 32-bit values, with some bits taken away for special encoding so
you don't necessarily get the full range. However, there are no checks
internally.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author