You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Chris Steinbeck (JIRA)" <ji...@apache.org> on 2011/07/30 05:04:10 UTC

[jira] [Created] (AXIS2C-1557) Socket not closed when host name resolution fails in network_handler.c

Socket not closed when host name resolution fails in network_handler.c
----------------------------------------------------------------------

                 Key: AXIS2C-1557
                 URL: https://issues.apache.org/jira/browse/AXIS2C-1557
             Project: Axis2-C
          Issue Type: Bug
          Components: util
    Affects Versions: 1.6.0
         Environment: QNX 6.4 (built from source WSO2 WSF C++)
            Reporter: Chris Steinbeck
            Priority: Minor


This is a boundary case but we found that when the host name could not be resolved the a socket was leaked and the server eventually exceeded the maximum number of open files.

The leak is in axutil_network_handler_open_socket in network_handler.c. The socket is created on line 68 (non-Win32) and receives a file descriptor. If the server is identified by a host name as opposed to an IP address the call to getbyhostname should resolve the name. If this call fails, AXIS2_INVALID_SOCKET is returned on line 99 but the file descriptor is not closed. A call to AXIS2_CLOSE_SOCKET should be added - as is done in the next error case on lines 108-110.

(Line numbers based on Axis2/C 1.6 and confirmed in trunk revision 1152415)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: c-dev-help@axis.apache.org


[jira] [Updated] (AXIS2C-1557) Socket not closed when host name resolution fails in network_handler.c

Posted by "Chris Steinbeck (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-1557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Steinbeck updated AXIS2C-1557:
------------------------------------

    Attachment: AXIS2C-1557.patch

Patch to add missing call to socket close.

> Socket not closed when host name resolution fails in network_handler.c
> ----------------------------------------------------------------------
>
>                 Key: AXIS2C-1557
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1557
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 1.6.0
>         Environment: QNX 6.4 (built from source WSO2 WSF C++)
>            Reporter: Chris Steinbeck
>            Priority: Minor
>         Attachments: AXIS2C-1557.patch
>
>
> This is a boundary case but we found that when the host name could not be resolved the a socket was leaked and the server eventually exceeded the maximum number of open files.
> The leak is in axutil_network_handler_open_socket in network_handler.c. The socket is created on line 68 (non-Win32) and receives a file descriptor. If the server is identified by a host name as opposed to an IP address the call to getbyhostname should resolve the name. If this call fails, AXIS2_INVALID_SOCKET is returned on line 99 but the file descriptor is not closed. A call to AXIS2_CLOSE_SOCKET should be added - as is done in the next error case on lines 108-110.
> (Line numbers based on Axis2/C 1.6 and confirmed in trunk revision 1152415)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: c-dev-help@axis.apache.org


[jira] [Resolved] (AXIS2C-1557) Socket not closed when host name resolution fails in network_handler.c

Posted by "Samisa Abeysinghe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2C-1557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Samisa Abeysinghe resolved AXIS2C-1557.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.7.0
         Assignee: Samisa Abeysinghe

Applied the given patch. Thanks for the patch. 

Committed revision 1163227.

> Socket not closed when host name resolution fails in network_handler.c
> ----------------------------------------------------------------------
>
>                 Key: AXIS2C-1557
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1557
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 1.6.0
>         Environment: QNX 6.4 (built from source WSO2 WSF C++)
>            Reporter: Chris Steinbeck
>            Assignee: Samisa Abeysinghe
>            Priority: Minor
>             Fix For: 1.7.0
>
>         Attachments: AXIS2C-1557.patch
>
>
> This is a boundary case but we found that when the host name could not be resolved the a socket was leaked and the server eventually exceeded the maximum number of open files.
> The leak is in axutil_network_handler_open_socket in network_handler.c. The socket is created on line 68 (non-Win32) and receives a file descriptor. If the server is identified by a host name as opposed to an IP address the call to getbyhostname should resolve the name. If this call fails, AXIS2_INVALID_SOCKET is returned on line 99 but the file descriptor is not closed. A call to AXIS2_CLOSE_SOCKET should be added - as is done in the next error case on lines 108-110.
> (Line numbers based on Axis2/C 1.6 and confirmed in trunk revision 1152415)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: c-dev-help@axis.apache.org