public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Max Polk <maxpolk@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Patch for run-1.3.0-1 core dump
Date: Thu, 20 Feb 2014 01:18:00 -0000	[thread overview]
Message-ID: <530548A0.9060008@gmail.com> (raw)
In-Reply-To: <20140218091655.GD2246@calimero.vinschen.de>

On 2/18/2014 4:16 AM, Corinna Vinschen wrote:
> On Feb 17 17:25, Jon TURNEY wrote:
>>> ...
>>> I went to all the trouble of investigating this, discovering that
>>> run2_freeargv() is double-freeing the last element in newargv because the NULL
>>> terminator isn't moved when the arguments are shifted down over newargv[0],
>>> and writing a patch, before I noticed that we already had one :-(
>>>
>>> --- origsrc/run-1.3.0/src/run.c 2013-07-24 16:26:39.000000000 +0100
>>> +++ src/run-1.3.0/src/run.c     2014-02-17 17:08:49.125000000 +0000
>>> @@ -254,6 +254,7 @@ realMain(int argc, char* argv[])
>>>         free (newargv[0]);
>>>         for (newargc = 1; newargc < argc; newargc++)
>>>            newargv[newargc-1] = newargv[newargc];
>>> +      newargv[argc-1] = 0;
>>>         newargc = argc - 1;
>>>
>>>         /* update execname */
>> There's still something wrong.  I build run with this patch locally,
>> and it seems to fix the issue at first sight.  However, after the
>> child process of run exits, run throws an exception in free(), and
>> the stack looks broken (on 64 bit).  It seems there is a double free
>> or a free of an entirely unrelated address.
> Scratch that.  I managed to fat-finger a one-line patch.  Sorry.
>
> Corinna

Did my earlier patch get included?  I haven't seen a "run" new version yet.

http://www.cygwin.com/ml/cygwin/2013-12/msg00006.html

My patch was the one that properly quote arguments.  Maybe let's start 
with that before putting new stuff underneath it.  From Chuck: "I'll 
roll a new update fairly soon."

http://www.cygwin.com/ml/cygwin/2013-12/msg00045.html


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  reply	other threads:[~2014-02-20  0:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-10 17:35 foo
2013-08-12 14:22 ` Charles Wilson
2014-02-18  3:53   ` Jon TURNEY
2014-02-18  6:13     ` Charles Wilson
2014-02-18  9:16     ` Corinna Vinschen
2014-02-18  9:35       ` Corinna Vinschen
2014-02-20  1:18         ` Max Polk [this message]
2014-03-20 15:03           ` Patrick Herbst
2014-03-21  4:49             ` Max Polk
2014-06-09 15:47 Patrick Herbst

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=530548A0.9060008@gmail.com \
    --to=maxpolk@gmail.com \
    --cc=cygwin@cygwin.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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).