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 "Bill Blough (Jira)" <ji...@apache.org> on 2020/04/07 16:45:00 UTC
[jira] [Reopened] (AXIS2C-1448) file descriptor leak in
axis2_http_transport_utils_get_services_static_wsdl
[ https://issues.apache.org/jira/browse/AXIS2C-1448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bill Blough reopened AXIS2C-1448:
---------------------------------
Assignee: (was: Don Samisa Abeysinghe)
Reopening to update fix version (not possible from "closed" status)
> file descriptor leak in axis2_http_transport_utils_get_services_static_wsdl
> ---------------------------------------------------------------------------
>
> Key: AXIS2C-1448
> URL: https://issues.apache.org/jira/browse/AXIS2C-1448
> Project: Axis2-C
> Issue Type: Bug
> Components: core/transport
> Affects Versions: 1.5.0, 1.6.0
> Environment: All
> Reporter: Matt Mason
> Priority: Blocker
> Fix For: Current (Nightly)
>
>
> This problem affects at least 1.5.0 and 1.6.0. I haven't checked any earlier versions.
> When viewing the wsdl via services/ServiceName?wsdl
> the wsdl is opened with a call to fopen and the result assigned to a local FILE* variable. However there is no corresponding call to fclose.
> We have a monitoring script that periodically requests the wsdl to check that the service is available.
> The process (currently) has a limit of 1024 open file handles, eventually this leak causes that number to be exceeded.
> The client library we use to connect to the service also requests the wsdl file when connecting to the service.
> With reference to the code in the 1.6.0 release, here is the 1 liner to plug the leak.
> Regards,
> Matt
> core/transport/http/util/http_transport_utils.c
> 1882 wsdl_file = fopen(wsdl_path, "r");
> 1883 if (wsdl_file)
> 1884 {
> 1885 c = fgetc(wsdl_file);
> 1886 while (c != EOF)
> 1887 {
> 1888 if (i >= size)
> 1889 {
> 1890 size = size * 3;
> 1891 tmp = (axis2_char_t *) AXIS2_MALLOC(env->allocator, size);
> 1892 memcpy(tmp, content, i);
> 1893 AXIS2_FREE(env->allocator, content);
> 1894 content = tmp;
> 1895 }
> 1896 content[i++] = (axis2_char_t)c;
> 1897 c = fgetc(wsdl_file);
> 1898 }
> 1899 content[i] = AXIS2_ESC_NULL;
> 1900 wsdl_string = (axis2_char_t *)content;
> 1901 fclose(wsdl_file); <---- Added this line
> 1902 }
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: c-dev-help@axis.apache.org