X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; q=dns; s=default; b=Gk4CNUBNElKZZ2RngVMI2w4ml0U4i8cq5+YsRDsZadL 0Ytjq+qUhhcjO94xvxJ4jBJMT4TMxdBTllZWnKg6QEcYWigKN4K2SsuJltOhh1YN XuHvT8gXr4Qzw+ScPwOPQTwdHxQLAjjZo2m3xnN6RbP470s9b4SHQatgecm+b+CA = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; s=default; bh=F6w6pNodFA8Q71ru2ateXeeCS6E=; b=NQJIRFsJ6Hy+hl1+4 HLDDWjRmBZffP1DJqzVgHC8aVo2ZAqa6SjXCoeskp+meuO6Fh9YsNuNFT9jHUZiz jvnAhnWboKaKik3jMirgZOGR/gs5DuG9Yo19F8uDhiB+4nt9y6SmcBP7EJRPfe0y rczEMgscCsGchxBK/eq1Wrk65Q= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f46.google.com X-Received: by 10.224.172.68 with SMTP id k4mr5687584qaz.92.1392855198178; Wed, 19 Feb 2014 16:13:18 -0800 (PST) Message-ID: <530548A0.9060008@gmail.com> Date: Wed, 19 Feb 2014 19:13:20 -0500 From: Max Polk User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Patch for run-1.3.0-1 core dump References: <5208EF91 DOT 7070504 AT cwilson DOT fastmail DOT fm> <53024604 DOT 3080904 AT dronecode DOT org DOT uk> <20140218090524 DOT GC2246 AT calimero DOT vinschen DOT de> <20140218091655 DOT GD2246 AT calimero DOT vinschen DOT de> In-Reply-To: <20140218091655.GD2246@calimero.vinschen.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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