[MDEV-31461] mariadb SIGSEGV when built with -DCLIENT_PLUGIN_DIALOG=STATIC Created: 2023-06-11  Updated: 2023-06-23  Resolved: 2023-06-23

Status: Closed
Project: MariaDB Server
Component/s: Authentication and Privilege System
Affects Version/s: 11.0.2
Fix Version/s: 10.4.31, 10.5.22, 10.6.15, 10.9.8, 10.10.6, 10.11.5, 11.0.3

Type: Bug Priority: Minor
Reporter: Tom Donovan Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: crash
Environment:

Debian GNU/Linux 12 (bookworm) x86_64
gcc (Debian 12.2.0-14) 12.2.0 cmake version 3.25.1



 Description   

If the dialog pluging is statically linked into the mariadb client app, it crashes when prompting for a password (-p),:

Program received signal SIGSEGV, Segmentation fault.
__memset_sse2_unaligned_erms () at ../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S:252
252	../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S: No such file or directory.
(gdb) where
#0  __memset_sse2_unaligned_erms () at ../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S:252
#1  0x00005555555d017e in get_password (file=0x555555b1a220, buffer=0x5555556addaf "my_strdup", length=-6240)
    at /home/tomd/mariadb/mariadb-11.0.2/libmariadb/libmariadb/get_password.c:59
#2  0x00005555555d0372 in get_tty_password (prompt=0x0, buffer=0x5555556addaf "my_strdup", length=-6240)
    at /home/tomd/mariadb/mariadb-11.0.2/libmariadb/libmariadb/get_password.c:162
#3  0x00005555555c03da in get_options (argc=1, argv=0x555555b19f90)
    at /home/tomd/mariadb/mariadb-11.0.2/client/mysql.cc:2138
#4  0x00005555555bebec in main (argc=7, argv=0x555555b19f88)
    at /home/tomd/mariadb/mariadb-11.0.2/client/mysql.cc:1267

libmariadb/plugins/auth/dialog.c calls get_tty_password with three arguments, intending the 3-argument function in libmariadb/libmariadb/get_password.c.

When statically linked, the identically named function in mysys/get_password.c apparently causes the problem.

If the get_tty_password function is renamed in both libmariadb/plugins/auth/dialog.c and libmariadb/libmariadb/get_password.c, the mariadb client works correctly.


Generated at Thu Feb 08 10:24:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.