From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4748 invoked by alias); 16 Feb 2017 11:46:27 -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: X-Seq: 40553 Received: (qmail 4007 invoked from network); 16 Feb 2017 11:46:27 -0000 X-Qmail-Scanner-Diagnostics: from new1-smtp.messagingengine.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(66.111.4.221):SA:0(-0.4/5.0):. Processed in 1.177922 secs); 16 Feb 2017 11:46:27 -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=-0.4 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: psprint2@fastmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at spf.messagingengine.com designates 66.111.4.221 as permitted sender) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=Qiz4EzNmieQ5vRNCL0jHTUHcfd w=; b=DjL8ZT6EeDlCTgzwD3+rPWPZbDaEGSEEXQQ6tRMLE1dvKI3u/K1Xa9mp7L JX56kHP+4TfX6WxoAjgG4ce6pNNZeRKtT+sCchk234HiCxz0+BSqTYDmlAT37kBY Ob7mqS53sW/T4K8AMChwSdh8olrBPnHHWffLXVUKF8N+yawqs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=smtpout; bh=Qi z4EzNmieQ5vRNCL0jHTUHcfdw=; b=cuxUJ3X1yJLhVVgtBBDILho4Vh2kEXCIHm 3dJU+Hf6N9Pv01jGwTkSALMHWwlTo422DjD2Ii2D8fpf8/vS7ksyJoak5mtd+old I54+V2eqsQmFovnQjt7mL7llGN+gHOomQiMDzxCkhgO70vVOOo0U5T/GVlMMc6VP I348UuljQ= X-ME-Sender: Message-Id: <1487245575.1843244.882932424.59844A89@webmail.messagingengine.com> From: Sebastian Gniazdowski To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-7cfc9722 Subject: Re: [PATCH] db/gdbm rewrite In-Reply-To: <20170216101658.46555c47@pwslap01u.europe.root.pri> Date: Thu, 16 Feb 2017 03:46:15 -0800 References: <1487074831.317363.880495280.04595B08@webmail.messagingengine.com> <1487154163.615323.881647656.040AB25F@webmail.messagingengine.com> <20170216101658.46555c47@pwslap01u.europe.root.pri> On Thu, Feb 16, 2017, at 02:16 AM, Peter Stephenson wrote: > On Wed, 15 Feb 2017 02:22:43 -0800 > Sebastian Gniazdowski wrote: > Thanks. >=20 > I've fixed the following warnings (which are trivial). Sorry, turns out no -Wall by default > I've added the stack trace; the key context will be frame 2: it's the > first zsfree() in gdbmsetfn(). Is it simply counting of terminating > '\0's again, or should it not actually be treating the data as a > string at all? Rejection of facts is IMO always futile in such situation, but just to state facts on db_gdbm: =E2=80=93 The parameter "testkey" in the hash should be empty as it is its = first use. It comes from getgdbmnode(): val_pm =3D (Param) zshcalloc( sizeof (*val_pm) ); val_pm->node.flags =3D PM_SCALAR | PM_HASHELEM; /* no PM_UPTODATE */ val_pm->gsu.s =3D (GsuScalar) ht->tmpdata; ht->addnode( ht, ztrdup( name ), val_pm ); // sets pm->node.nam =E2=80=93 zshcalloc() should result in "pm->u.str" to be set to NULL =E2=80=93=C2=A0so the "first zsfree() in gdbmsetfn()" should not run: if (pm->u.str) { zsfree(pm->u.str); ... Maybe zshcalloc() with enable-zsh-mem somehow doesn't zero the memory? I cannot reproduce. My `make TESTNUM=3DV11` ends with other core dump and backtrace: * frame #0: 0x000000010bdf7cf1 zsh-5.3.1-dev-0`malloc(size=3D8) + 321 at mem.c:1264 frame #1: 0x000000010bdf5b14 zsh-5.3.1-dev-0`zalloc(size=3D4) + 68 at mem.c:966 frame #2: 0x000000010be2fc29 zsh-5.3.1-dev-0`ztrdup(s=3D"off") + 57 at string.c:82 ... frame #9: 0x000000010bdb6bef zsh-5.3.1-dev-0`runshfunc(prog=3D0x000000010c0e37c8, wrap=3D0x0000000000000000, name=3D"ZTST_execchunk") + 575 at exec.c:5647 So it's test suite code. I think it's cool to test with zsh-mem to stress test the code and find boundary cases, but maybe, at least on my machine, zsh-mem seems to be not fully ready and db_gdbm might not have error.. That's for futile defensive speech.. PS. Had to add ulimit -c unlimited to "%prep" section of V11*, maybe doing this by default would cause more with-backtrace reports. --=20 Sebastian Gniazdowski psprint2@fastmail.com