Skip site navigation (1)Skip section navigation (2)
Date:      Fri,  4 Aug 2006 12:08:38 +0200 (CEST)
From:      Simun Mikecin <numisemis@yahoo.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        sem@ciam.ru, sem@FreeBSD.org
Subject:   ports/101352: [fix] FD_SETSIZE checking is wrong: some client apps dont work
Message-ID:  <20060804100838.4EC2B26D049@mail.logos.hr>
Resent-Message-ID: <200608041010.k74AAA63093434@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         101352
>Category:       ports
>Synopsis:       [fix] FD_SETSIZE checking is wrong: some client apps dont work
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 04 10:10:10 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Simun Mikecin
>Release:        FreeBSD 5.2.1-RELEASE-p9 i386
>Organization:
>Environment:
System: FreeBSD mail.logos.hr 5.2.1-RELEASE-p9 FreeBSD 5.2.1-RELEASE-p9 #1: Mon Jul 26 14:07:00 CEST 2004 root@mail.logos.hr:/usr/obj/usr/src.5.2.1-R/sys/MAIL i386
>Description:
gsoap 2.7.8c has file descriptor checking like this:
        if ((int)soap->socket > FD_SETSIZE)
          return SOAP_FD_EXCEEDED;      /* Hint: MUST increase FD_SETSIZE */
and on FreeBSD FD_SETSIZE is defined in /usr/include/sys/select.h like this:
#define FD_SETSIZE      1024U
unlike many other systems where it doesn't have 'U' suffix which makes it an "unsigned" type.

Problem is that comparing:
	if ((int) -1 > 1024U)
returns true, so the function call fails, but it shouldn't cause soap->socket initially has a value of -1.

I already reported this bug on the gsoap project tracker.
>How-To-Repeat:
As a consequence of this bug, I have experienced that SOAP calls from client
SOAP applications in some situations (like using HTTP keep-alive and one-way
message parsing) return with SOAP_FD_EXCEEDED instead of SOAP_OK.
>Fix:
diff -urN gsoap.orig/Makefile gsoap/Makefile
--- gsoap.orig/Makefile	Sat Jul 22 13:33:18 2006
+++ gsoap/Makefile	Fri Aug  4 11:36:41 2006
@@ -7,6 +7,7 @@
 
 PORTNAME=	gsoap
 PORTVERSION=	2.7.8c
+PORTREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	gsoap2
@@ -21,5 +22,11 @@
 WRKSRC=		${WRKDIR}/${PORTNAME}-2.7
 
 ONLY_FOR_ARCHS=	i386 amd64
+
+post-patch:
+	${SED} 's/> FD_SETSIZE/> (int)FD_SETSIZE/g' ${WRKSRC}/soapcpp2/stdsoap2.c > ${WRKDIR}/stdsoap2.c
+	${SED} 's/> FD_SETSIZE/> (int)FD_SETSIZE/g' ${WRKSRC}/soapcpp2/stdsoap2.cpp > ${WRKDIR}/stdsoap2.cpp
+	${MV} ${WRKDIR}/stdsoap2.c ${WRKSRC}/soapcpp2/stdsoap2.c
+	${MV} ${WRKDIR}/stdsoap2.cpp ${WRKSRC}/soapcpp2/stdsoap2.cpp
 
 .include <bsd.port.mk>
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060804100838.4EC2B26D049>