Bug #115120 Provide memory debugging macro implementations for AddressSanitizer
Submitted: 24 May 16:25 Modified: 22 Oct 8:26
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Compiling Severity:S4 (Feature request)
Version:8.4.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[24 May 16:25] Laurynas Biveinis
Description:
include/memory_debugging.h defines several macros to help with heap debugging: MEM_MALLOCLIKE_BLOCK, MEM_FREELIKE_BLOCK, MEM_UNDEFINED, MEM_NOACCESS, MEM_CHECK_ADDRESSABLE, etc. These macros have implementations for Valgrind.

AddressSanitizer has user request facility too. It does not map to Valgrind ones exactly but I believe it is possible to do something meaningful for all of the above macros.

One macro which does not map nicely to ASan user requests is MEM_DEFINED_IF_ADDRESSABLE. Luckily, it is also never used, so it is an option to simply remove it.

How to repeat:
See above

Suggested fix:
Will attach. The testsuite completes with no regression with the patch and ASan enabled
[24 May 16:26] Laurynas Biveinis
Bug 115120 patch for 8.4.0

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: bug115120-8.4.0.patch (application/octet-stream, text), 2.60 KiB.

[25 May 15:44] MySQL Verification Team
Hello Laurynas,

Thank you for the report and contribution.

regards,
Umesh
[9 Jul 12:59] Laurynas Biveinis
My contributed patch applies cleanly on 9.0.0 and passes the tests.
[22 Oct 8:26] Laurynas Biveinis
The contributed patch applies on 9.1.0 cleanly and passes the tests.