apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 43000] - ./testall always freeze on testsockets
Date Fri, 16 Nov 2007 01:58:25 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43000>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43000





------- Additional Comments From henryjen@ztune.net  2007-11-15 17:58 -------
Created an attachment (id=21136)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21136&action=view)
Fix for port.c bugs on Solaris

A couple issues in the port.c implementation for Solaris:

1. When calling port_dissociate with a file descriptor has not been associated,
port_dissociate will return -1 and set errno to ENOENT.

Per the man page for port_dissociate:
> The port_dissociate() function will fail if:
>
>      EACCES	 The process is not the owner of the association.
>
>
>      ENOENT	 The specified object is not  associated  with	the
>		 port.

2. The apr_pollcb_poll should also re-associate the fd with port. Per the man
page:

> When an event for a PORT_SOURCE_FD object is retrieved,  the
> object  no  longer  has  an  association with the port.  The
> event can be processed without the possibility that  another
> thread  can retrieve a subsequent event for the same object.
> After processing of the file descriptor  is  completed,  the
> port_associate()  function  can be called to reassociate the
> object with the port.

3. POLLIN Event is generated at the time port_associate is called and at most
one event can be generated, and that causes testpoll to fail. Per the man page
of port_associate:

> Objects of type PORT_SOURCE_FD  are  file  descriptors.  The
> event  types	for  PORT_SOURCE_FD  objects  are described in
> poll(2).  At most one event notification will  be  generated
> per  associated  file  descriptor.   For  example, if a file
> descriptor is associated with  a  port  for  the  POLLRDNORM
> event  and  data  is available on the file descriptor at the
> time the port_associate() function is called,  an  event  is
> immediately  sent to the port. If data is not yet available,
> one event is sent to the port when data first becomes avail-
> able.

This explains the first event only has POLLOUT flagged, as sendto is
called after port_associate. Attached patch basically minimize the timing
window to make a port_associate before someone is trying to retrieve events
from the
port.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Mime
View raw message