ROCm / roctracer

ROCm Tracer Callback/Activity Library for Performance tracing AMD GPUs
https://rocm.docs.amd.com/projects/roctracer/en/latest/
Other
64 stars 30 forks source link

Memory Pool destructor uses allocator_default. #54

Closed louisespellacy-arm closed 1 year ago

louisespellacy-arm commented 3 years ago

In MemoryPool.h, the destructor uses allocator_default even if a allocator function has been provided via roctracer_properties_t and was used in the constructor.

https://github.com/ROCm-Developer-Tools/roctracer/blob/0876c253d8b6380a1d6bd1f2b34c5b4c1e8c94db/src/core/memory_pool.h#L91-L98

If custom memory management is carried out in properties.alloc_func, then the required custom free-ing of the memory cannot be matched when the allocator default is used in the destructor. This creates a double-free or other possible problems.

bertwesarg commented 2 years ago

@TimourPaltashev any progress here?

TimourPaltashev commented 2 years ago

Hi Kiumars, Do we have any activity on this issue?? https://github.com/ROCm-Developer-Tools/roctracer/issues/54

Many thanks, TT.

From: Bert Wesarg @.> Sent: Tuesday, June 14, 2022 11:50 AM To: ROCm-Developer-Tools/roctracer @.> Cc: Paltashev, Timour @.>; Mention @.> Subject: Re: [ROCm-Developer-Tools/roctracer] Memory Pool destructor uses allocator_default. (#54)

[CAUTION: External Email]

@TimourPaltashevhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FTimourPaltashev&data=05%7C01%7CTimour.Paltashev%40amd.com%7Ccc6cb0c65d5d4f40be8c08da4e36b087%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637908294263493089%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=2JSDS5%2BZwbqbu18DfK2MeTYcZMg6LnkokpWqXkiPFqg%3D&reserved=0 any progress here?

- Reply to this email directly, view it on GitHubhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FROCm-Developer-Tools%2Froctracer%2Fissues%2F54%23issuecomment-1155597758&data=05%7C01%7CTimour.Paltashev%40amd.com%7Ccc6cb0c65d5d4f40be8c08da4e36b087%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637908294263493089%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=LHh3XNFiPQiYVNqRWJtrHUY8drSjPSC7mW8GZZ2%2FhPU%3D&reserved=0, or unsubscribehttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAUTS6PPPULZCFALDMHLHNRLVPDH5TANCNFSM45BEZZOA&data=05%7C01%7CTimour.Paltashev%40amd.com%7Ccc6cb0c65d5d4f40be8c08da4e36b087%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637908294263493089%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JI%2B3IVbwsey%2BtHTR7v94XsusyqCwrBokk6EF%2Bf5UjRU%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>

TimourPaltashev commented 2 years ago

[AMD Official Use Only - General]

Hi Timour,

I think this code has changed for rocm-5.3, let me double check and send you update

Best regards, Kiumars

From: Paltashev, Timour @.> Sent: Tuesday, June 14, 2022 12:32 PM To: ROCm-Developer-Tools/roctracer @.>; ROCm-Developer-Tools/roctracer @.> Cc: Sabeti, Kiumars @.>; Bert Wesarg @.***> Subject: RE: [ROCm-Developer-Tools/roctracer] Memory Pool destructor uses allocator_default. (#54)

Hi Kiumars, Do we have any activity on this issue?? https://github.com/ROCm-Developer-Tools/roctracer/issues/54

Many thanks, TT.

From: Bert Wesarg @.**@.>> Sent: Tuesday, June 14, 2022 11:50 AM To: ROCm-Developer-Tools/roctracer @.**@.>> Cc: Paltashev, Timour @.**@.>>; Mention @.**@.>> Subject: Re: [ROCm-Developer-Tools/roctracer] Memory Pool destructor uses allocator_default. (#54)

[CAUTION: External Email]

@TimourPaltashevhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FTimourPaltashev&data=05%7C01%7CTimour.Paltashev%40amd.com%7Ccc6cb0c65d5d4f40be8c08da4e36b087%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637908294263493089%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=2JSDS5%2BZwbqbu18DfK2MeTYcZMg6LnkokpWqXkiPFqg%3D&reserved=0 any progress here?

- Reply to this email directly, view it on GitHubhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FROCm-Developer-Tools%2Froctracer%2Fissues%2F54%23issuecomment-1155597758&data=05%7C01%7CTimour.Paltashev%40amd.com%7Ccc6cb0c65d5d4f40be8c08da4e36b087%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637908294263493089%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=LHh3XNFiPQiYVNqRWJtrHUY8drSjPSC7mW8GZZ2%2FhPU%3D&reserved=0, or unsubscribehttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAUTS6PPPULZCFALDMHLHNRLVPDH5TANCNFSM45BEZZOA&data=05%7C01%7CTimour.Paltashev%40amd.com%7Ccc6cb0c65d5d4f40be8c08da4e36b087%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637908294263493089%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JI%2B3IVbwsey%2BtHTR7v94XsusyqCwrBokk6EF%2Bf5UjRU%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.**@.>>

bertwesarg commented 1 year ago

Fixed in 9d728f74a14cbce6aaa4fa8d74d6be1ab0cd9c84