mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Justin Cormack <justin@specialbusservice.com>
To: musl@lists.openwall.com
Subject: Re: LUA + musl, garbage collection issue?
Date: Sun, 21 Sep 2014 11:16:13 +0100	[thread overview]
Message-ID: <CAK4o1WxbXubw3DxXL4JDS1yoqTp83Kwmz0m9HYvzPr22BR_2kQ@mail.gmail.com> (raw)
In-Reply-To: <20140921043831.GF23797@brightrain.aerifal.cx>

On Sun, Sep 21, 2014 at 5:38 AM, Rich Felker <dalias@libc.org> 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


  parent reply	other threads:[~2014-09-21 10:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-21  2:41 Scott Valentine
2014-09-21  4:38 ` Rich Felker
2014-09-21  9:58   ` Scott Valentine
2014-09-21 10:16   ` Justin Cormack [this message]
2014-09-24  5:25     ` Scott Valentine
2014-09-24  5:50       ` Szabolcs Nagy
2014-09-24  6:14         ` Scott Valentine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAK4o1WxbXubw3DxXL4JDS1yoqTp83Kwmz0m9HYvzPr22BR_2kQ@mail.gmail.com \
    --to=justin@specialbusservice.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).