Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tao idl memory leaks related to annotations #811

Closed
jwillemsen opened this issue Jan 27, 2019 · 7 comments

Comments

3 participants
@jwillemsen
Copy link
Member

commented Jan 27, 2019

Indirect leak of 1792 byte(s) in 7 object(s) allocated from:
#0 0x7f740fe8b9e8 in operator new[](unsigned long, std::nothrow_t const&) (/lib64/libasan.so.5+0xf19e8)
#1 0x7f740f2898fc in ACE_6_5_4::ACE_New_Allocator::malloc(unsigned long) (/home/build/jenkins/workspace/fc_axcioma_addresssanitizer/BUILD/DOC_ROOT/ACE/lib/libACE.so.6.5.4+0x1b28fc)
#2 0x7f740f51c26b in ACE_6_5_4::ACE_Array_Base<AST_Annotation_Appl*>::ACE_Array_Base(unsigned long, ACE_6_5_4::ACE_Allocator*) (/home/build/jenkins/workspace/fc_axcioma_addresssanitizer/BUILD/DOC_ROOT/ACE/lib/libTAO_IDL_FE.so.2.5.4+0xcf26b)
#3 0x7f740f5c23a9 in tao_yyparse() (/home/build/jenkins/workspace/fc_axcioma_addresssanitizer/BUILD/DOC_ROOT/ACE/lib/libTAO_IDL_FE.so.2.5.4+0x1753a9)
#4 0x7f740f5a25bd in FE_yyparse() (/home/build/jenkins/workspace/fc_axcioma_addresssanitizer/BUILD/DOC_ROOT/ACE/lib/libTAO_IDL_FE.so.2.5.4+0x1555bd)
#5 0x4167d3 in DRV_drive(char const*) (/home/build/jenkins/workspace/fc_axcioma_addresssanitizer/BUILD/DOC_ROOT/TAO/TAO_IDL/tao_idl+0x4167d3)
#6 0x4067fe in main (/home/build/jenkins/workspace/fc_axcioma_addresssanitizer/BUILD/DOC_ROOT/TAO/TAO_IDL/tao_idl+0x4067fe)
#7 0x7f740ebca412 in __libc_start_main (/lib64/libc.so.6+0x24412)

Indirect leak of 1536 byte(s) in 6 object(s) allocated from:
#0 0x7f740fe8b9e8 in operator new[](unsigned long, std::nothrow_t const&) (/lib64/libasan.so.5+0xf19e8)
#1 0x7f740f2898fc in ACE_6_5_4::ACE_New_Allocator::malloc(unsigned long) (/home/build/jenkins/workspace/fc_axcioma_addresssanitizer/BUILD/DOC_ROOT/ACE/lib/libACE.so.6.5.4+0x1b28fc)
#2 0x7f740f5d9e8b in ACE_6_5_4::ACE_Array_Base<AST_Decl*>::ACE_Array_Base(unsigned long, ACE_6_5_4::ACE_Allocator*) (/home/build/jenkins/workspace/fc_axcioma_addresssanitizer/BUILD/DOC_ROOT/ACE/lib/libTAO_IDL_FE.so.2.5.4+0x18ce8b)
#3 0x7f740f5cee44 in tao_yyparse() (/home/build/jenkins/workspace/fc_axcioma_addresssanitizer/BUILD/DOC_ROOT/ACE/lib/libTAO_IDL_FE.so.2.5.4+0x181e44)
#4 0x7f740f5a25bd in FE_yyparse() (/home/build/jenkins/workspace/fc_axcioma_addresssanitizer/BUILD/DOC_ROOT/ACE/lib/libTAO_IDL_FE.so.2.5.4+0x1555bd)
#5 0x4167d3 in DRV_drive(char const*) (/home/build/jenkins/workspace/fc_axcioma_addresssanitizer/BUILD/DOC_ROOT/TAO/TAO_IDL/tao_idl+0x4167d3)
#6 0x4067fe in main (/home/build/jenkins/workspace/fc_axcioma_addresssanitizer/BUILD/DOC_ROOT/TAO/TAO_IDL/tao_idl+0x4067fe)
#7 0x7f740ebca412 in __libc_start_main (/lib64/libc.so.6+0x24412)
@jwillemsen

This comment has been minimized.

Copy link
Member Author

commented Jan 27, 2019

See #809

@jwillemsen jwillemsen assigned jwillemsen and unassigned jwillemsen Jan 27, 2019

@jwillemsen

This comment has been minimized.

Copy link
Member Author

commented Jan 27, 2019

Also add some docu to the members that are shared

@jwillemsen

This comment has been minimized.

Copy link
Member Author

commented Jan 27, 2019

@iguessthislldo added this issue

@mitza-oci

This comment has been minimized.

Copy link
Member

commented Jan 28, 2019

ACE_Strong_Bound_Ptr could be useful here. Or adding another node to the AST to represent the individual "reference" (binding an Annotation Application to its target Decl).

Also, as a general note... I think last I checked tao_idl wasn't asan-clean before these changes.

@jwillemsen

This comment has been minimized.

Copy link
Member Author

commented Jan 28, 2019

We have an internal build with address-sanitizer=1 in platform_macros.GNU, before the TAO_IDL changes for annotations there where no reported leaks on tao_idl, right now we have the ones as mentioned in the first comment

@iguessthislldo

This comment has been minimized.

Copy link
Contributor

commented Jan 28, 2019

@jwillemsen

It's possible that the address sanitizer said it was clean but memory management in tao_idl is a mess in general. The usage of dynamically allocated memory is ridiculously high, which might be understandable, but on top of it there's the completely strange pattern of using a destroy method on everything.

@mitza-oci

I'm not sure I want to add a new ast node for this, but ACE_Strong_Bound_Ptr is a god send.

@jwillemsen

This comment has been minimized.

Copy link
Member Author

commented Feb 4, 2019

Can confirm these are fixed

@jwillemsen jwillemsen closed this Feb 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.