Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Sep 5, 2019

Callers of mono_reflection_create_custom_attr_data_args_noalloc were leaking some of the returned information. Accessed attributes are FixedBufferAttribute and UnmanagedFunctionPointerAttribute.

Callers of mono_reflection_create_custom_attr_data_args_noalloc were leaking some of the returned information. Accessed attributes are FixedBufferAttribute and UnmanagedFunctionPointerAttribute.
@CoffeeFlux
Copy link
Contributor

Where is the allocation actually happening? Apologies, but I'm very familiar with this part of the codebase and the logic around mono_reflection_create_custom_attr_data_args_noalloc and the functions it calls is proving difficult to follow.

@BrzVlad
Copy link
Member Author

BrzVlad commented Sep 5, 2019

@CoffeeFlux the freed values are allocated in load_cattr_value. There are some malloc's there for primitive types

Copy link
Contributor

@CoffeeFlux CoffeeFlux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. LGTM.

@BrzVlad BrzVlad merged commit e49be5b into mono:master Sep 6, 2019
@MattL0
Copy link

MattL0 commented Sep 14, 2019

hi, Would it be possible to backport this to https://github.com/mono/mono/commits/2019-02

@BrzVlad
Copy link
Member Author

BrzVlad commented Sep 16, 2019

@monojenkins backport 2019-08
@monojenkins backport 2019-06

@monojenkins
Copy link
Contributor

@BrzVlad backporting to 2019-06 failed, the patch results in conflicts:

Applying: [metadata] Fix leaks when handling a few attributes
Using index info to reconstruct a base tree...
M	mono/metadata/marshal-ilgen.c
M	mono/metadata/marshal.c
M	mono/mini/debugger-agent.c
Falling back to patching base and 3-way merge...
Auto-merging mono/mini/debugger-agent.c
CONFLICT (content): Merge conflict in mono/mini/debugger-agent.c
Auto-merging mono/metadata/marshal.c
Auto-merging mono/metadata/marshal-ilgen.c
error: Failed to merge in the changes.
Patch failed at 0001 [metadata] Fix leaks when handling a few attributes

Please backport manually!

BrzVlad added a commit to BrzVlad/mono that referenced this pull request Sep 16, 2019
Callers of mono_reflection_create_custom_attr_data_args_noalloc were leaking some of the returned information. Accessed attributes are FixedBufferAttribute and UnmanagedFunctionPointerAttribute.
BrzVlad added a commit that referenced this pull request Sep 16, 2019
Callers of mono_reflection_create_custom_attr_data_args_noalloc were leaking some of the returned information. Accessed attributes are FixedBufferAttribute and UnmanagedFunctionPointerAttribute.
monojenkins added a commit that referenced this pull request Sep 17, 2019
[2019-08] [metadata] Fix leaks when handling a few attributes

Callers of mono_reflection_create_custom_attr_data_args_noalloc were leaking some of the returned information. Accessed attributes are FixedBufferAttribute and UnmanagedFunctionPointerAttribute.

Backport of #16675.

/cc @BrzVlad
@BrzVlad
Copy link
Member Author

BrzVlad commented Sep 18, 2019

@MattL0 Forgot to answer, sorry. 2019-02 is already done. This fix will be in the following release / preview.

@MattL0
Copy link

MattL0 commented Sep 21, 2019

Thanks !

ManickaP pushed a commit to ManickaP/runtime that referenced this pull request Jan 20, 2020
Callers of mono_reflection_create_custom_attr_data_args_noalloc were leaking some of the returned information. Accessed attributes are FixedBufferAttribute and UnmanagedFunctionPointerAttribute.

Commit migrated from mono/mono@e49be5b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants