Bug #110452 mysqldump SEGV
Submitted: 21 Mar 2023 12:29 Modified: 12 May 2023 16:50
Reporter: Pedro Ferreira Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S3 (Non-critical)
Version:8.0.32 OS:Ubuntu (22.04)
Assigned to: CPU Architecture:x86 (x86_64)
Tags: mysqldump

[21 Mar 2023 12:29] Pedro Ferreira
Description:
Run these statements;

CREATE SCHEMA test;
USE test;
CREATE TABLE t1 (c0 CHAR);
CREATE UNIQUE INDEX i1 ON t1 (c0, (TIME '-1:0:0'));

Then run mysqldump

mysqldump --user=... --order-by-primary --databases test t0

During the dump, the address sanitizer will report a SEGV:

client/mysqldump.cc:1788:10: runtime error: load of null pointer of type 'char'
AddressSanitizer:DEADLYSIGNAL
=================================================================
==1724037==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x55637e8fb485 bp 0x7fff92294a20 sp 0x7fff922949e0 T0)
==1724037==The signal is caused by a READ memory access.
==1724037==Hint: address points to the zero page.
    #0 0x55637e8fb485 in quote_name client/mysqldump.cc:1788
    #1 0x55637e8fbff4 in primary_key_fields client/mysqldump.cc:5419
    #2 0x55637e914596 in dump_table client/mysqldump.cc:3743
    #3 0x55637e9180e7 in dump_all_tables_in_db client/mysqldump.cc:4672
    #4 0x55637e919bbc in dump_databases client/mysqldump.cc:4512
    #5 0x55637e91c8b4 in main client/mysqldump.cc:5980
    #6 0x7f38f9029d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #7 0x7f38f9029e3f in __libc_start_main_impl ../csu/libc-start.c:392
    #8 0x55637e8f9224 in _start (/home/ferreira/repositories/mysql-server-default/BUILD/bin/mysqldump+0xd81224)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV client/mysqldump.cc:1788 in quote_name
==1724037==ABORTING

The compilation parameters are the same as issue 108148:

-DWITH_DEBUG=1 -DWITH_ASAN=ON -DWITH_UBSAN=ON and boost library version 1.77

How to repeat:
Run the statements above.
[21 Mar 2023 13:05] MySQL Verification Team
Hello Pedro Ferreira,

Thank you for the report and feedback.

regards,
Umesh
[12 May 2023 16:50] Philip Olson
Posted by developer:
 
Fixed as of the upcoming MySQL 8.1.0 release, and here's the proposed changelog entry from the documentation team:

For mysqldump: usage would unexpectedly halt when used against tables
with functional indexes.

Thank you for the bug report.