From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6172 Path: news.gmane.org!not-for-mail From: Justin Cormack Newsgroups: gmane.linux.lib.musl.general Subject: Re: LUA + musl, garbage collection issue? Date: Sun, 21 Sep 2014 11:16:13 +0100 Message-ID: References: <20140921043831.GF23797@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1411294593 26239 80.91.229.3 (21 Sep 2014 10:16:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Sep 2014 10:16:33 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6185-gllmg-musl=m.gmane.org@lists.openwall.com Sun Sep 21 12:16:28 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XVeBt-0002Id-Po for gllmg-musl@plane.gmane.org; Sun, 21 Sep 2014 12:16:25 +0200 Original-Received: (qmail 7851 invoked by uid 550); 21 Sep 2014 10:16:25 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 7843 invoked from network); 21 Sep 2014 10:16:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=specialbusservice.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=wjHAPp9R28PQBIdXyl9GT+69DUOEGcJbJQZCFMXdaU8=; b=QunWlWvo5BVty/3+qL1QDiGuwPxMzxo2nG6yhvlTGVgWFYeoYOd1qqTIxqNvS/B6FE IXU3cHlY8QYJVLcqgTYucGPxQZ68MTVkeWxApsGY5jwn4h+uNj4tPOdoqRBFW9n5kAMx EnEjTuXOfJOMS15Yqxus6S2N+a4jEndJ+EZ7A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=wjHAPp9R28PQBIdXyl9GT+69DUOEGcJbJQZCFMXdaU8=; b=Wj1z+L7vR+fwFiQRrxosUXLDTI28l5DY951XZ4KqrAnHrocrEjjfe7VEqt3pqT1bFE jiN92HZDSX8R+ITMxWpYwL3lskUFUvN1M8mv7E3xDyxXtjBWCJP8mvCarCC61j9HWCI5 44VircKcjuxWf7sdqbEtIv+LjafGNvVIZTJsF0cpPb2Qf8aob9wT2828Y0wrStlxsCie m4kIqQF4WcFkxsHR9B2qJNjkxh5PWJ/FGk1ue1mVMFHym2c2YBJgXJHeWEOTyjO+QV6J bC+bZZNl2IIWjHdZmOktN3gtXlIa1yzWdPi87AiVsrL41Aul1pBS3gR41L2MFLW1XYzL +v5w== X-Gm-Message-State: ALoCoQkvggxSxumD/DVm+DUkoA6v25vuRk8N+tIoqxFFwQT9pC+esKuK2XyeGnjDf+vSMt9RhaSi X-Received: by 10.152.2.41 with SMTP id 9mr18333787lar.79.1411294573673; Sun, 21 Sep 2014 03:16:13 -0700 (PDT) In-Reply-To: <20140921043831.GF23797@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:6172 Archived-At: On Sun, Sep 21, 2014 at 5:38 AM, Rich Felker wrote: > On Sat, Sep 20, 2014 at 04:41:14PM -1000, Scott Valentine wrote: >> I noticed that in order to free memory, it basically calls realloc >> with 0 as the new size. Is this something musl doesn't handle well? >> >> I'm trying a rebuild with a check for n == 0 in musl's realloc >> function to just free the pointer, and I'll report back. >> >> What is "the right thing to do" to fix this? Should lua not be using >> realloc to free memory, or should musl handle the case better, if, >> in fact this is the problem? > > This is a bug in lua; it's depending on a bug in glibc. POSIX attempts As pointed out on lua-l but not copied here, Lua is not doing this, it does call free() in the 0 case, so something else is the issue... (openwrt does use a patched Lua, might be worth testing with upstream). Justin