From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26950 invoked by alias); 2 Jan 2018 14:49:31 -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: List-Unsubscribe: X-Seq: 42196 Received: (qmail 11054 invoked by uid 1010); 2 Jan 2018 14:49:31 -0000 X-Qmail-Scanner-Diagnostics: from aok120.rev.netart.pl by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(85.128.245.120):SA:0(-1.9/5.0):. Processed in 3.596318 secs); 02 Jan 2018 14:49:31 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) 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.1 X-Envelope-From: psprint@zdharma.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Virus-Scanned: by amavisd-new using ClamAV (21) Date: Tue, 2 Jan 2018 15:49:22 +0100 From: Sebastian Gniazdowski To: zsh-workers@zsh.org Message-ID: Subject: [BUG] Segfault if zcompile followed by source, on large file X-Mailer: Airmail (442) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello I noticed that zcompiling a 4.29 MiB source and then sourcing it causes s= egfault. The file is:=C2=A0https://github.com/zdharma/hacking-private/blo= b/master/eval-room/srctest.zsh. It contains only assigns. Restarting shell and sourcing the already compiled file =E2=80=93 no segf= ault. Ran bt in lldb: =C2=A0 * frame =230: 0x00000001090d6c3a zsh-5.4.2-dev-0=60addvars(state=3D= 0x00007fff56b3d290, pc=3D, addflags=3D) + 1482 = at exec.c:2435 =C2=A0 =C2=A0 frame =231: 0x00000001090d2785 zsh-5.4.2-dev-0=60execsimple= (state=3D0x00007fff56b3d290) + 245 at exec.c:1209 The code: (lldb) down frame =230: 0x00000001090d6c3a zsh-5.4.2-dev-0=60addvars(state=3D0x00007f= ff56b3d290, pc=3D, addflags=3D) + 1482 at exec.= c:2435 =C2=A0 =C2=A02432 doneps4 =3D 1; =C2=A0 =C2=A02433 =C2=A0 =C2=A0=7D =C2=A0 =C2=A02434 =C2=A0 =C2=A0state->pc =3D pc; -> 2435 =C2=A0 =C2=A0while (wc=5Fcode(ac =3D *state->pc++) =3D=3D WC=5FA= SSIGN) =7B =C2=A0 =C2=A02436 int myflags =3D flags; =C2=A0 =C2=A02437 name =3D ecgetstr(state, EC=5FDUPTOK, &htok); =C2=A0 =C2=A02438 if (htok) A dubious try to narrow a cause: (lldb) p *state->pc error: Couldn't apply expression side effects : Couldn't dematerialize a = result variable: couldn't read its memory I exponentially enlarged the file starting from 1 line, and first segfaul= t occurred at 292k lines, 146k was fine. -- =20 Sebastian Gniazdowski psprint /at/ zdharma.org