Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 79424 invoked from network); 14 Nov 2009 03:27:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Nov 2009 03:27:08 -0000 Received: (qmail 58616 invoked by uid 500); 14 Nov 2009 03:27:08 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 58552 invoked by uid 500); 14 Nov 2009 03:27:08 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 58543 invoked by uid 99); 14 Nov 2009 03:27:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Nov 2009 03:27:08 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Nov 2009 03:26:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0B87A23888FD; Sat, 14 Nov 2009 03:26:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r836111 - in /apr/apr/branches/1.3.x: CHANGES poll/unix/port.c Date: Sat, 14 Nov 2009 03:26:35 -0000 To: commits@apr.apache.org From: trawick@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091114032636.0B87A23888FD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: trawick Date: Sat Nov 14 03:26:34 2009 New Revision: 836111 URL: http://svn.apache.org/viewvc?rev=836111&view=rev Log: merge r836091 from trunk: Check that an event was actually filled in when port_getn() returns -1/EINTR with nget > 0. This resolves a crash when receiving a signal. PR: 48030 Modified: apr/apr/branches/1.3.x/CHANGES apr/apr/branches/1.3.x/poll/unix/port.c Modified: apr/apr/branches/1.3.x/CHANGES URL: http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/CHANGES?rev=836111&r1=836110&r2=836111&view=diff ============================================================================== --- apr/apr/branches/1.3.x/CHANGES [utf-8] (original) +++ apr/apr/branches/1.3.x/CHANGES [utf-8] Sat Nov 14 03:26:34 2009 @@ -5,6 +5,10 @@ [Jeff Trawick] *) Solaris pollset support: Fix a 1.3.9 regression in apr_pollset_poll() + which could result in a crash when the call was interrupted by a + signal. PR 48030. [Jeff Trawick] + + *) Solaris pollset support: Fix a 1.3.9 regression in apr_pollset_poll() which resulted in invalid return codes from the APR function. A work- around was needed for bad return codes from 32-bit port_getn() on Solaris 10 x86. PR 48029. [Jeff Trawick] Modified: apr/apr/branches/1.3.x/poll/unix/port.c URL: http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/poll/unix/port.c?rev=836111&r1=836110&r2=836111&view=diff ============================================================================== --- apr/apr/branches/1.3.x/poll/unix/port.c (original) +++ apr/apr/branches/1.3.x/poll/unix/port.c Sat Nov 14 03:26:34 2009 @@ -100,6 +100,10 @@ tvptr = &tv; } + list[0].portev_user = (void *)-1; /* so we can double check that an + * event was returned + */ + ret = port_getn(port, list, max, nget, tvptr); /* Note: 32-bit port_getn() on Solaris 10 x86 returns large negative * values instead of 0 when returning immediately. @@ -111,10 +115,12 @@ switch(rv) { case EINTR: case ETIME: - if (*nget > 0) { + if (*nget > 0 && list[0].portev_user != (void *)-1) { /* This confusing API can return an event at the same time * that it reports EINTR or ETIME. If that occurs, just - * report the event. + * report the event. With EINTR, nget can be > 0 without + * any event, so check that portev_user was filled in. + * * (Maybe it will be simplified; see thread * http://mail.opensolaris.org * /pipermail/networking-discuss/2009-August/011979.html