From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7899 invoked from network); 30 Apr 2007 09:23:28 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.8 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 30 Apr 2007 09:23:28 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 13884 invoked from network); 30 Apr 2007 09:23:22 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 30 Apr 2007 09:23:22 -0000 Received: (qmail 116 invoked by alias); 30 Apr 2007 09:23:20 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23361 Received: (qmail 106 invoked from network); 30 Apr 2007 09:23:19 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 30 Apr 2007 09:23:19 -0000 Received: (qmail 13565 invoked from network); 30 Apr 2007 09:23:19 -0000 Received: from cluster-d.mailcontrol.com (217.69.20.190) by a.mx.sunsite.dk with SMTP; 30 Apr 2007 09:23:15 -0000 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly17d.srv.mailcontrol.com (MailControl) with ESMTP id l3U9LTr6018272 for ; Mon, 30 Apr 2007 10:23:11 +0100 Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.1830); Mon, 30 Apr 2007 10:22:42 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.13.8/8.13.4) with ESMTP id l3U9Mf0G032735 for ; Mon, 30 Apr 2007 10:22:41 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.13.8/8.13.8/Submit) with ESMTP id l3U9MfJj032732 for ; Mon, 30 Apr 2007 10:22:41 +0100 Message-Id: <200704300922.l3U9MfJj032732@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: Zsh Hackers Subject: Re: PATCH: and query for malloc(0). In-reply-to: <20070430032948.GA2612@primenet.com.au> References: <200704272135.l3RLZE1d005051@pwslaptop.csr.com> <20070430032948.GA2612@primenet.com.au> Comments: In-reply-to Geoff Wing message dated "Mon, 30 Apr 2007 13:29:48 +1000." Date: Mon, 30 Apr 2007 10:22:41 +0100 From: Peter Stephenson X-OriginalArrivalTime: 30 Apr 2007 09:22:42.0082 (UTC) FILETIME=[1A9D2020:01C78B09] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-06-00-00 (www.mailcontrol.com) on 10.68.0.127 Geoff Wing wrote: > On Saturday 2007-04-28 07:36 +1000, Peter Stephenson output: > :Playing with POSIX regexes, I found some errors coming from zsh's memory > :allocation with debugging on. These turned out to resolve to some > :malloc()s and free()s for zero length and the following oddity in > :malloc(): > : /* some systems want malloc to return the highest valid address plus one > : if it is called with an argument of zero */ > : if (!size) > : return (MALLOC_RET_T) m_high; >... > Given the above, I guess the patch is a reasonable fix. Thanks, I think I'll commit it and see what happens; under most circumstances that will be very little. > We are not actually calling malloc(0) in-house, are we? No, that should be trapped up above in zalloc(), etc. I've only seen the problem when linked with a C library function that's calling malloc(0). -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview