From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19066 invoked by alias); 3 Jan 2018 06:40:17 -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: 42203 Received: (qmail 3157 invoked by uid 1010); 3 Jan 2018 06:40:17 -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 2.67433 secs); 03 Jan 2018 06:40:17 -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 (17) Date: Wed, 3 Jan 2018 07:40:09 +0100 From: Sebastian Gniazdowski To: zsh-workers@zsh.org Message-ID: In-Reply-To: References: Subject: Re: [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 On 2 Jan 2018 at 15:49:22, Sebastian Gniazdowski (psprint=40zdharma.org) = wrote: > I exponentially enlarged the file starting from 1 line, and first segfa= ult occurred =20 > at 292k lines, 146k was fine. Ran valgrind, expecting that something will came up in zcompile, some hea= p corruption. However it's sourcing that yields something, and it's the t= hing known from backtrace: =3D=3D49954=3D=3D Memcheck, a memory error detector =3D=3D49954=3D=3D Copyright (C) 2002-2017, and GNU GPL'd, by Julian Sewar= d et al. =3D=3D49954=3D=3D Using Valgrind-3.13.0 and LibVEX; rerun with -h for cop= yright info =3D=3D49954=3D=3D Command: zsh-5.4.2-dev-0 ./test2.src.script =3D=3D49954=3D=3D =3D=3D49954=3D=3D Invalid read of size 4 =3D=3D49954=3D=3D =C2=A0 =C2=A0at 0x100019C3A: addvars (in /usr/local/bin= /zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x100015784: execsimple (in /usr/local/= bin/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x10001506D: execlist (in /usr/local/bi= n/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x100014C=463: execode (in /usr/local/b= in/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x1000351=46E: source (in /usr/local/bi= n/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x10000EB09: bin=5Fdot (in /usr/local/b= in/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x100001D25: execbuiltin (in /usr/local= /bin/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x10001=460E2: execcmd=5Fexec (in /usr/= local/bin/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x10001A9EE: execpline2 (in /usr/local/= bin/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x100015B80: execpline (in /usr/local/b= in/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x100015307: execlist (in /usr/local/bi= n/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x100014C=463: execode (in /usr/local/b= in/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0Address 0x1016c4000 is not stack'd, malloc'd or (= recently) free'd =3D=3D49954=3D=3D Process terminating with default action of signal 11 (S= IGSEGV): dumping core =3D=3D49954=3D=3D =C2=A0Access not within mapped region at address 0x1016= C4000 =3D=3D49954=3D=3D =C2=A0 =C2=A0at 0x100019C3A: addvars (in /usr/local/bin= /zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x100015784: execsimple (in /usr/local/= bin/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x10001506D: execlist (in /usr/local/bi= n/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x100014C=463: execode (in /usr/local/b= in/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x1000351=46E: source (in /usr/local/bi= n/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x10000EB09: bin=5Fdot (in /usr/local/b= in/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x100001D25: execbuiltin (in /usr/local= /bin/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x10001=460E2: execcmd=5Fexec (in /usr/= local/bin/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x10001A9EE: execpline2 (in /usr/local/= bin/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x100015B80: execpline (in /usr/local/b= in/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x100015307: execlist (in /usr/local/bi= n/zsh-5.4.2-dev-0) =23zcompile test2.src =3D=3D49954=3D=3D =C2=A0 =C2=A0by 0x100014C=463: execode (in /usr/local/b= in/zsh-5.4.2-dev-0) =3D=3D49954=3D=3D =C2=A0If you believe this happened as a result of a sta= ck =3D=3D49954=3D=3D =C2=A0overflow in your program's main thread (unlikely = but =3D=3D49954=3D=3D =C2=A0possible), you can try to increase the size of th= e =3D=3D49954=3D=3D =C2=A0main thread stack using the --main-stacksize=3D f= lag. =3D=3D49954=3D=3D =C2=A0The main thread stack size used in this run was 8= 388608. Valgrind hints that this might be a stack overflow: =3D=3D52921=3D=3D =C2=A0If you believe this happened as a result of a sta= ck =3D=3D52921=3D=3D =C2=A0overflow in your program's main thread (unlikely = but =3D=3D52921=3D=3D =C2=A0possible), you can try to increase the size of th= e =3D=3D52921=3D=3D =C2=A0main thread stack using the --main-stacksize=3D f= lag. =3D=3D52921=3D=3D =C2=A0The main thread stack size used in this run was 8= 388608. However I ran it again with=C2=A0--main-stacksize=3D9388608 and 19388608,= and the issue repeated. -- =20 Sebastian Gniazdowski psprint /at/ zdharma.org