mysql client started with \u or \U in prompt throws warnings about lost memory on exit

Bug #956249 reported by Elena Stepanova
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Committed
Low
Sergei Golubchik

Bug Description

MariaDB client, if started in interactive mode with \u or \U in the --prompt string, produces the warnings on exit:

Bye
Warning: 8 bytes lost, allocated at sql-common/client.c:4027, libmysql/libmysql.c:4882, client/mysql.cc:5068, client/mysql.cc:4966, client/mysql.cc:1913, client/mysql.cc:1245, ??:0
Warning: 92 bytes lost, allocated at sql-common/client.c:4021, libmysql/libmysql.c:4882, client/mysql.cc:5068, client/mysql.cc:4966, client/mysql.cc:1913, client/mysql.cc:1245, ??:0
Warning: 8164 bytes lost, allocated at mysys/my_alloc.c:217, sql-common/client.c:1450, sql-common/client.c:3912, sql-common/client.c:3946, libmysql/libmysql.c:714, client/mysql.cc:5068, client/mysql.cc:4966, client/mysql.cc:1913
Memory lost: 8264 bytes in 3 chunks

If it is run with valgrind, then in additional to the "usual" warnings (upstream bug http://bugs.mysql.com/bug.php?id=47688), there are also

Warning: 8 bytes lost, allocated at ==31367== Conditional jump or move depends on uninitialised value(s)
==31367== at 0x42488FA: vfprintf (in /lib/libc-2.11.2.so)
==31367== by 0x424A397: buffered_vfprintf (in /lib/libc-2.11.2.so)
==31367== by 0x424528A: vfprintf (in /lib/libc-2.11.2.so)
==31367== by 0x424FB6E: fprintf (in /lib/libc-2.11.2.so)
==31367== by 0x80AA698: print_stack (safemalloc.c:230)
==31367== by 0x80AA9D8: sf_terminate (safemalloc.c:330)
==31367== by 0x423577E: __run_exit_handlers (in /lib/libc-2.11.2.so)
==31367== by 0x42357DC: exit (in /lib/libc-2.11.2.so)
==31367== by 0x80621DA: mysql_end (mysql.cc:1297)
==31367== by 0x8061F37: main (mysql.cc:1248)
==31367==
==31367== Syscall param write(buf) points to uninitialised byte(s)
==31367== at 0x42C991B: ??? (in /lib/libc-2.11.2.so)
==31367== by 0x42707D0: _IO_file_write@@GLIBC_2.1 (in /lib/libc-2.11.2.so)
==31367== by 0x42704B3: new_do_write (in /lib/libc-2.11.2.so)
==31367== by 0x427076D: _IO_file_xsputn@@GLIBC_2.1 (in /lib/libc-2.11.2.so)
==31367== by 0x424A436: buffered_vfprintf (in /lib/libc-2.11.2.so)
==31367== by 0x424528A: vfprintf (in /lib/libc-2.11.2.so)
==31367== by 0x424FB6E: fprintf (in /lib/libc-2.11.2.so)
==31367== by 0x80AA698: print_stack (safemalloc.c:230)
==31367== by 0x80AA9D8: sf_terminate (safemalloc.c:330)
==31367== by 0x423577E: __run_exit_handlers (in /lib/libc-2.11.2.so)
==31367== by 0x42357DC: exit (in /lib/libc-2.11.2.so)
==31367== by 0x80621DA: mysql_end (mysql.cc:1297)
==31367== Address 0xbef035f0 is on thread 1's stack

bzr version-info
revision-id: <email address hidden>
date: 2012-03-15 00:37:37 +0100
build-date: 2012-03-15 21:43:37 +0400
revno: 3331

Not reproducible on MariaDB 5.3 (revno 3459).
Not reproducible on MySQL trunk (revno 3706).

To reproduce,

- build a debug version of MariaDB client;
- start MariaDB or MySQL server;
- start the client as mysql --prompt="\u " <other valid connection parameters>
- say 'exit' in the prompt
=> see the warnings.

Revision history for this message
Elena Stepanova (elenst) wrote :

Also filed in JIRA as MDEV-182

Changed in maria:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.