2012-04-11 1 views
0

Axis2C에서 작업하고 있습니다. 이 프레임 워크를 테스트하기 위해 간단한 웹 서비스 클라이언트로 몇 가지 테스트를하고있다.Axis2C 메모리 누수가 있습니까?

저는 Apache에서 제공 한 몇 가지 예제와 설명서를 사용하여 클라이언트를 작성했습니다. 클라이언트가 잘 작동하고 valgrind를 사용하여 메모리 관리가 올바른지 확인하기로 결정했습니다.

나는 (이 특정 경우) 사용 가능한 메모리에 대한 예제와 문서에 언급 된 기능을 사용 :

// to free the requst struct. 
adb_EncryptRequest_free(request, env); 

// to free the stub. 
axis2_stub_free(stub, env); 

// to free the environment. 
axutil_env_free((axutil_env_t*) env); 

나는 코드에있는 "야생"새로운 또는 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 검사 =으로 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) 

내가 맞다면 해결할 수있는 방법이 있습니까?

도움 주셔서 감사합니다.

감사합니다.

+0

아쉽게도 Axis2/C는 적어도 서버 측 관점 (Axis로 클라이언트를 작성하지 않음)에서 메모리 누수가 가득합니다. 1) WSDL에서 생성 된 서버 측 서비스 코드에 누출이 있습니다. 2) "단순 HTTP 서버"에 누수가 있습니다. 3) CGI 모듈에는 누출이 있습니다 (표준 CGI로 사용되는 한 문제가 아니지만 코드를 재사용하거나 FastCGI와 같은 내부에서 실행하는 경우 중요합니다). 지금까지 Axis2/C JIRA에서 찾거나 수정 한 모든 누출에 대한 패치를 게시했지만 프로젝트는 적극적으로 유지 관리되지 않았습니다. 간단한 수정 사항을 검토하고 커밋하는 데 몇 달이 걸립니다. – vond

답변

0

코드 없이는 추측 할 수 없습니다. axis2c (svn에서 1.7.x)를 사용하여 누수를 감지하지 못했습니다 (vc에서 visual leak detector으로 확인).

서비스 클라이언트와 환경 만 해제했습니다. 당신이합니다 (generatd 코드 내부에 사용되는)은 "axis2_svc_client_send_receive"로 결합 데이터 commentar header에 따르면

axis2_svc_client_free(svc, env); 
axutil_env_free(env); 

은 서비스 클라이언트가 해제됩니다.