Bug #117772 Debug code in pfs_get_thread_statement_locker_vc() leaking to release builds

Submitted: 22 Mar 2025 8:41 Modified: 17 Jun 2025 15:55
Reporter: Alexey Kopytov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S5 (Performance)
Version:8.0, 8.4., 9.2.0 OS:Any
Assigned to: Marc ALFF CPU Architecture:Any

[22 Mar 2025 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 2025 4:12] MySQL Verification Team
Hello Alexey Kopytov,

Thank you for the report and feedback.

regards,
Umesh
[13 May 2025 7:59] Marc ALFF
Thanks for the report.
[17 Jun 2025 15:55] Edward Gilmore
Posted by developer:
 
Added the following note to the MySQL Server 9.4.0 release notes:
	
The pfs_get_thread_statement_locker_vc() function contained debugging code that was 
inadvertently included in release builds.
[1 Apr 9:12] Edward Gilmore
Posted by developer:
 
Bug reopened by merges. Closing.
[7 Aug 15:19] Edward Gilmore
Posted by developer:
 
Updated release notes for 8.4.9 backport.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.056 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.