[ https://issues.apache.org/jira/browse/AXIS2C-1448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bill Blough resolved AXIS2C-1448. --------------------------------- Resolution: Fixed > 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: 1.7.0 > > > 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-unsubscr...@axis.apache.org For additional commands, e-mail: c-dev-h...@axis.apache.org