Bug #117772 Debug code in pfs_get_thread_statement_locker_vc() leaking to release builds
Submitted: 22 Mar 8:41 Modified: 24 Mar 4:12
Reporter: Alexey Kopytov Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S5 (Performance)
Version:8.0, 8.4., 9.2.0 OS:Any
Assigned to: CPU Architecture:Any

[22 Mar 8:41] Alexey Kopytov
Description:
pfs_get_thread_statement_locker_vc() contains the following code:

#ifndef DBUG_OFF
  /* Detect uses of uninitialized data. */
  memset(state, 0xFF, sizeof(PSI_statement_locker_state));
#endif /* DBUG_OFF */

The intention was obviously to include it only into debug builds. However, DBUG_OFF is no longer used in the server code, so it's never defined.

How to repeat:
Code analysis.

Suggested fix:
Use NDEBUG instead of DBUG_OFF like the rest of the server code does.
[24 Mar 4:12] MySQL Verification Team
Hello Alexey Kopytov,

Thank you for the report and feedback.

regards,
Umesh