Bug #90983 UBSan: misaligned std::uint32_t store on x.performance_schema_sockets
Submitted: 23 May 2018 7:58 Modified: 13 Jun 2018 11:05
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Document Store: X Plugin Severity:S3 (Non-critical)
Version:8.0.11 OS:Any
Assigned to: CPU Architecture:Any

[23 May 2018 7:58] Laurynas Biveinis
Description:
XCode 9.3.1 UBSan build:

x.performance_schema_sockets             [ fail ]
...
Check if clinet_socket are reported in proper way in PFS
+/Users/laurynas/percona/mysql-server/plugin/x/client/xprotocol_impl.cc:374:3: runtime error: store to misaligned address 0x7ffeeeb18ba1 for type 'std::uint32_t' (aka 'unsigned int'), which requires 4 byte alignment
+0x7ffeeeb18ba1: note: pointer points here
+ 00 00 00  28 00 00 00 00 00 0a 0d  53 48 41 32 35 36 5f 4d  45 4d 4f 52 59 00 00 00  28 95 b1 ee fe
+              ^ 
+SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/laurynas/percona/mysql-server/plugin/x/client/xprotocol_impl.cc:374:3 in 
 Verify [Checking if X Plugin reports 1 connections]
...
 No socket should be reported by X Plugin
+/Users/laurynas/percona/mysql-server/plugin/x/client/xprotocol_impl.cc:374:3: runtime error: store to misaligned address 0x7ffee2169ba1 for type 'std::uint32_t' (aka 'unsigned int'), which requires 4 byte alignment
+0x7ffee2169ba1: note: pointer points here
+ 00 00 00  28 00 00 00 00 00 0a 0d  53 48 41 32 35 36 5f 4d  45 4d 4f 52 59 00 00 00  28 a5 16 e2 fe
+              ^ 
+SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/laurynas/percona/mysql-server/plugin/x/client/xprotocol_impl.cc:374:3 in 
 Verify [Checking if data in column `COUNT_READ` had increased]

How to repeat:
Same CMake options as in bug 90968
[23 May 2018 17:13] Umesh Shastry
Hello Laurynas,

Thank you for the report and feedback.

Thanks,
Umesh
[23 May 2018 17:16] Umesh Shastry
Results

Attachment: Bug90968_90883.rtf (text/rtf), 148.98 KiB.

[13 Jun 2018 11:05] Margaret Fisher
Posted by developer:
 
Changelog entry added for MySQL 8.0.13:
Incorrect copying of an integer value by &mysqlxplugin; caused an error relating to misaligned memory access.  The issue has now been fixed.