From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Mar 14 14:13:10 2007 Return-Path: X-Original-To: freebsd-ports-bugs@FreeBSD.org Delivered-To: freebsd-ports-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 680F316A401; Wed, 14 Mar 2007 14:13:10 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from pobox.codelabs.ru (pobox.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 1FFA413C484; Wed, 14 Mar 2007 14:13:10 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from codelabs.ru (pobox.codelabs.ru [144.206.177.45]) by pobox.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1HRUE0-00022A-7z; Wed, 14 Mar 2007 17:13:08 +0300 Date: Wed, 14 Mar 2007 17:13:03 +0300 From: Eygene Ryabinkin To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org Message-ID: <20070314141303.GB99047@codelabs.ru> References: <200703131500.l2DF0CDO095066@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <200703131500.l2DF0CDO095066@freefall.freebsd.org> Sender: rea-fbsd@codelabs.ru X-Spam-Status: No, score=-3.4 required=4.0 tests=ALL_TRUSTED,AWL,BAYES_00 Cc: Subject: Re: ports/110270: backport patch for ftp/curl from CURL's CVS X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2007 14:13:10 -0000 As was found yesterday and reported to Peter, I've found one more SEGV in the curl code that was fixed in the CVS release -- git's HTTP push utility provoked the SEGV. Tracked the problem to the specific commit to the CVS and backported the patch for the 7.16.1. See http://cool.haxx.se/cvs.cgi/curl/lib/url.c.diff?r2=1.585&r1=1.584&diff_format=u The new patch (not a patch to a patch, but a complete patchfile) for lib/url.c is below. Peter, I will appreciate the information about 'data->set.no_signal = TRUE'. --- lib/url.c.orig Wed Mar 14 16:48:31 2007 +++ lib/url.c Wed Mar 14 16:48:22 2007 @@ -553,6 +553,10 @@ data->set.httpauth = CURLAUTH_BASIC; /* defaults to basic */ data->set.proxyauth = CURLAUTH_BASIC; /* defaults to basic */ +#if defined(__FreeBSD_version) + data->set.no_signal = TRUE; /* different handling of signals and threads */ +#endif /* __FreeBSD_version */ + /* This no longer creates a connection cache here. It is instead made on the first call to curl_easy_perform() or when the handle is added to a multi stack. */ @@ -1993,7 +1997,8 @@ from the multi */ } - infof(data, "Examining connection #%ld for reuse\n", check->connectindex); + DEBUGF(infof(data, "Examining connection #%ld for reuse\n", + check->connectindex)); if(check->inuse && !canPipeline) { /* can only happen within multi handles, and means that another easy @@ -2019,11 +2024,11 @@ continue; } - if (data->state.is_in_pipeline && check->bits.close) { - /* Don't pick a connection that is going to be closed */ - infof(data, "Connection #%ld has been marked for close, can't reuse\n", - check->connectindex); - continue; + if (check->bits.close) { + /* Don't pick a connection that is going to be closed. */ + infof(data, "Connection #%ld has been marked for close, can't reuse\n", + check->connectindex); + continue; } if((needle->protocol&PROT_SSL) != (check->protocol&PROT_SSL)) @@ -4092,8 +4097,9 @@ CURLcode Curl_done(struct connectdata **connp, - CURLcode status, bool premature) /* an error if this is called after an - error was detected */ + CURLcode status, /* an error if this is called after an + error was detected */ + bool premature) { CURLcode result; struct connectdata *conn = *connp; @@ -4151,9 +4157,6 @@ if(data->set.reuse_forbid || conn->bits.close) { CURLcode res2 = Curl_disconnect(conn); /* close the connection */ - *connp = NULL; /* to make the caller of this function better detect that - this was actually killed here */ - /* If we had an error already, make sure we return that one. But if we got a new error, return that. */ if(!result && res2) @@ -4169,6 +4172,9 @@ conn->connectindex, conn->bits.httpproxy?conn->proxy.dispname:conn->host.dispname); } + + *connp = NULL; /* to make the caller of this function better detect that + this was actually killed here */ return result; }