From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25894 invoked by alias); 5 Jan 2018 10:23:34 -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: 42225 Received: (qmail 22509 invoked by uid 1010); 5 Jan 2018 10:23:34 -0000 X-Qmail-Scanner-Diagnostics: from mailout1.w1.samsung.com 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(210.118.77.11):SA:0(-6.9/5.0):. Processed in 4.509491 secs); 05 Jan 2018 10:23:34 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,T_DKIM_INVALID, T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: p.stephenson@samsung.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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= X-AuditID: cbfec7f4-f790c6d0000075d3-21-5a4f521a5b32 Date: Fri, 05 Jan 2018 10:23:18 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: [BUG] Segfault if zcompile followed by source, on large file Message-id: <20180105102318.492dfa5e@pwslap01u.europe.root.pri> In-reply-to: Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrAIsWRmVeSWpSXmKPExsWy7djP87pSQf5RBtMfClgcbH7I5MDoserg B6YAxigum5TUnMyy1CJ9uwSujIdrF7EVnOas2PJoBmsD4332LkZODgkBE4kVS5exQthiEhfu rWfrYuTiEBJYyijRe+skI4TTyyRxce9hRpiOZZu3sEIkljFK7Hp8ixnCmcYkMePdOqiW04wS 8w80skA4ZxglDn09yAzSzyKgKvG6by2YzSZgKDF102ywuSIC4hJn155nAbGFBTwl3m2aChbn FbCXmDT5DJjNKWAusWD/DiYQm19AX+Lq309MEDfZS8y8cgaqXlDix+R7YHOYBXQktm17zA5h y0tsXvMW7FQJgRlsEru2tEGDwEViy7UTzBC2sMSr41ug4jISnR0HoRb0M0o86faFamaUOH1m BxtEwlqi7/ZFRogNfBKTtk0HGsQBFOeV6GgTgijxkJj38zhUuaPEtj+LoEHUxSjxZUo/8wRG hVlIDp+F5PBZSA5fwMi8ilEktbQ4Nz212ESvODG3uDQvXS85P3cTIzAdnP53/MsOxsXHrA4x CnAwKvHwrlD3ixJiTSwrrsw9xCjBwawkwstpBBTiTUmsrEotyo8vKs1JLT7EKM3BoiTOaxvV FikkkJ5YkpqdmlqQWgSTZeLglGpgdL95fOIxk/+RzE9PaTmx14oY1la2Z83816n/ftLqn+c7 y6pOx/+9qqfoMflQxb5glwXX5VIaP6x5qjBnzd4W3ee7X2ksnDwz39Y388IvRaFDe5bseyaX zXW88ZvIopUTp+9NSbnduiHV9IrTxQ19wbGRa973XWKv3qkR4Tdv8hl5pvlvTfZsl1diKc5I NNRiLipOBABg7WBwAwMAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrILMWRmVeSWpSXmKPExsVy+t/xa7qSQf5RBr/uGVgcbH7I5MDoserg B6YAxigum5TUnMyy1CJ9uwSujIdrF7EVnOas2PJoBmsD4332LkZODgkBE4llm7ewQthiEhfu rWfrYuTiEBJYwijRcfUzC4Qzg0miaccnZgjnNKPEju2zoZwzjBK/O96D9bMIqEq87lvLDGKz CRhKTN00mxHEFhEQlzi79jwLiC0s4CnxbtNUsDivgL3EpMlnwGxOAXOJBft3MEEM7WGUuNY9 EWwQv4C+xNW/n5ggDrSXmHnlDFSzoMSPyffAhjILaEls3tbECmHLS2xe8xasV0hAXeLG3d3s ExiFZyFpmYWkZRaSlgWMzKsYRVJLi3PTc4sN9YoTc4tL89L1kvNzNzECA3rbsZ+bdzBe2hh8 iFGAg1GJh5dByy9KiDWxrLgy9xCjBAezkggvpxFQiDclsbIqtSg/vqg0J7X4EKM0B4uSOG/v ntWRQgLpiSWp2ampBalFMFkmDk6pBsY2tdbJX5Q3n5Yy+yyQbNbAX/SXPcE40eIMh2qW1tSE WZkeT3aIu7J+9/EtKd3yY5Jt9UflVI7CyyptBx5sOaMftk2mNsLG2PZU6jwxT5Z1iSFbj2f+ 3vA5IiE790nfrbKo2l3PN7+cOdNiwxdbpqfXXHu8go5wpG/pOH+b9c2idcWKW9N7/ZVYijMS DbWYi4oTAS2eIkhkAgAA X-CMS-MailID: 20180105102321eucas1p2f70db423aeb0e47b14058ce1c649f21f X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180102145007epcas2p35349fe256ab195853ed923c0f84f900b X-RootMTR: 20180102145007epcas2p35349fe256ab195853ed923c0f84f900b References: On Tue, 2 Jan 2018 15:49:22 +0100 Sebastian Gniazdowski wrote: > I noticed that zcompiling a 4.29 MiB source and then sourcing it > causes segfault. > Daniel Shahaf 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