Axis2C内存泄漏?

Axis2C内存泄漏?,c,valgrind,axis2c,C,Valgrind,Axis2c,我正在使用Axis2C。我正在用一个简单的web服务客户端进行一些测试,以测试这个框架 我使用Apache提供的一些示例和文档编写了客户机。客户端工作正常,我决定用valgrind对其进行测试,以确保内存管理正确 我使用示例和文档中提到的函数来释放内存(在本例中): 我的代码中没有任何“狂野”的新代码或malloc 然而,valgrind报告如下: LEAK SUMMARY: ==2287== definitely lost: 56 bytes in 3 blocks ==2287==

我正在使用Axis2C。我正在用一个简单的web服务客户端进行一些测试,以测试这个框架

我使用Apache提供的一些示例和文档编写了客户机。客户端工作正常,我决定用valgrind对其进行测试,以确保内存管理正确

我使用示例和文档中提到的函数来释放内存(在本例中):

我的代码中没有任何“狂野”的新代码或malloc

然而,valgrind报告如下:

LEAK SUMMARY:
==2287==    definitely lost: 56 bytes in 3 blocks
==2287==    indirectly lost: 156 bytes in 5 blocks
==2287==      possibly lost: 0 bytes in 0 blocks
==2287==    still reachable: 20 bytes in 1 blocks
==2287==         suppressed: 0 bytes in 0 blocks
我使用--leak check=full重新运行Valgind,但据我所知,内存问题位于axis2c*.so文件中

HEAP SUMMARY:
==2292==     in use at exit: 232 bytes in 9 blocks
==2292==   total heap usage: 13,180 allocs, 13,171 frees, 760,422 bytes allocated
==2292== 
==2292== 68 (16 direct, 52 indirect) bytes in 1 blocks are definitely lost in loss record 7 of 9
==2292==    at 0x400677E: malloc (vg_replace_malloc.c:195)
==2292==    by 0x40C2032: axutil_allocator_malloc_impl (in /home/EMBT/Downloads/axis2c-bin-1.6.0-linux/lib/libaxutil.so.0.6.0)
==2292==    by 0x40C5C07: axutil_string_create (in /home/EMBT/Downloads/axis2c-bin-1.6.0-linux/lib/libaxutil.so.0.6.0)
==2292==    by 0x804E024: axis2_stub_start_op_PoCPCIServiceService_GetEncryptedData (axis2_stub_PoCPCIServiceService.c:493)
==2292==    by 0x804E759: main (main.c:59)
==2292== 
==2292== 72 (20 direct, 52 indirect) bytes in 1 blocks are definitely lost in loss record 8 of 9
==2292==    at 0x400677E: malloc (vg_replace_malloc.c:195)
==2292==    by 0x40C2032: axutil_allocator_malloc_impl (in /home/EMBT/Downloads/axis2c-bin-1.6.0-linux/lib/libaxutil.so.0.6.0)
==2292==    by 0x40C74F5: axutil_qname_create (in /home/EMBT/Downloads/axis2c-bin-1.6.0-linux/lib/libaxutil.so.0.6.0)
==2292==    by 0x804D515: axis2_stub_populate_services_for_PoCPCIServiceService (axis2_stub_PoCPCIServiceService.c:91)
==2292==    by 0x804D395: axis2_stub_create_PoCPCIServiceService (axis2_stub_PoCPCIServiceService.c:48)
==2292==    by 0x804E6ED: main (main.c:46)
==2292== 
==2292== 72 (20 direct, 52 indirect) bytes in 1 blocks are definitely lost in loss record 9 of 9
==2292==    at 0x400677E: malloc (vg_replace_malloc.c:195)
==2292==    by 0x40C2032: axutil_allocator_malloc_impl (in /home/EMBT/Downloads/axis2c-bin-1.6.0-linux/lib/libaxutil.so.0.6.0)
==2292==    by 0x40C74F5: axutil_qname_create (in /home/EMBT/Downloads/axis2c-bin-1.6.0-linux/lib/libaxutil.so.0.6.0)
==2292==    by 0x804D64F: axis2_stub_populate_services_for_PoCPCIServiceService (axis2_stub_PoCPCIServiceService.c:111)
==2292==    by 0x804D395: axis2_stub_create_PoCPCIServiceService (axis2_stub_PoCPCIServiceService.c:48)
==2292==    by 0x804E6ED: main (main.c:46)
如果我是对的,有办法解决吗

谢谢你的帮助


问候。

没有代码,这只是猜测。我使用了axis2c(svn中的1.7.x),没有注意到任何泄漏(在vc中检查)

我只释放了服务客户端和环境。

根据注释,您与“axis2_svc_client_send_receive”(在generatd代码中使用)绑定的数据由服务客户端释放。

不幸的是,axis2/C已经释放

我们启动了一个项目,以提供比原始版本更稳定的Axis2/C构建


该项目中存在漏洞。

不幸的是,Axis2/C充满了内存泄漏,至少从服务器端的角度来看(我没有使用Axis编写客户端):1)从WSDL生成的服务器端服务代码存在漏洞;2) “简单HTTP服务器”存在漏洞;3) CGI模块有漏洞(只要它作为标准CGI使用,这就不是问题,但如果您尝试重用代码,或者在FastCGI之类的内部运行代码,则会变得非常关键)。我已经将我发现/修复的所有漏洞的补丁发布到Axis2/C JIRA上,但该项目没有得到积极维护:审查和提交简单的修复需要几个月的时间。
HEAP SUMMARY:
==2292==     in use at exit: 232 bytes in 9 blocks
==2292==   total heap usage: 13,180 allocs, 13,171 frees, 760,422 bytes allocated
==2292== 
==2292== 68 (16 direct, 52 indirect) bytes in 1 blocks are definitely lost in loss record 7 of 9
==2292==    at 0x400677E: malloc (vg_replace_malloc.c:195)
==2292==    by 0x40C2032: axutil_allocator_malloc_impl (in /home/EMBT/Downloads/axis2c-bin-1.6.0-linux/lib/libaxutil.so.0.6.0)
==2292==    by 0x40C5C07: axutil_string_create (in /home/EMBT/Downloads/axis2c-bin-1.6.0-linux/lib/libaxutil.so.0.6.0)
==2292==    by 0x804E024: axis2_stub_start_op_PoCPCIServiceService_GetEncryptedData (axis2_stub_PoCPCIServiceService.c:493)
==2292==    by 0x804E759: main (main.c:59)
==2292== 
==2292== 72 (20 direct, 52 indirect) bytes in 1 blocks are definitely lost in loss record 8 of 9
==2292==    at 0x400677E: malloc (vg_replace_malloc.c:195)
==2292==    by 0x40C2032: axutil_allocator_malloc_impl (in /home/EMBT/Downloads/axis2c-bin-1.6.0-linux/lib/libaxutil.so.0.6.0)
==2292==    by 0x40C74F5: axutil_qname_create (in /home/EMBT/Downloads/axis2c-bin-1.6.0-linux/lib/libaxutil.so.0.6.0)
==2292==    by 0x804D515: axis2_stub_populate_services_for_PoCPCIServiceService (axis2_stub_PoCPCIServiceService.c:91)
==2292==    by 0x804D395: axis2_stub_create_PoCPCIServiceService (axis2_stub_PoCPCIServiceService.c:48)
==2292==    by 0x804E6ED: main (main.c:46)
==2292== 
==2292== 72 (20 direct, 52 indirect) bytes in 1 blocks are definitely lost in loss record 9 of 9
==2292==    at 0x400677E: malloc (vg_replace_malloc.c:195)
==2292==    by 0x40C2032: axutil_allocator_malloc_impl (in /home/EMBT/Downloads/axis2c-bin-1.6.0-linux/lib/libaxutil.so.0.6.0)
==2292==    by 0x40C74F5: axutil_qname_create (in /home/EMBT/Downloads/axis2c-bin-1.6.0-linux/lib/libaxutil.so.0.6.0)
==2292==    by 0x804D64F: axis2_stub_populate_services_for_PoCPCIServiceService (axis2_stub_PoCPCIServiceService.c:111)
==2292==    by 0x804D395: axis2_stub_create_PoCPCIServiceService (axis2_stub_PoCPCIServiceService.c:48)
==2292==    by 0x804E6ED: main (main.c:46)
 axis2_svc_client_free(svc, env);
 axutil_env_free(env);