[MDEV-2384] LP:956249 - mysql client started with \u or \U in prompt throws warnings about lost memory on exit Created: 2012-03-15  Updated: 2014-06-20  Resolved: 2012-10-04

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Trivial
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: Launchpad

Attachments: XML File LPexportBug956249.xml    

 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.


 Comments   
Comment by Elena Stepanova [ 2012-03-15 ]

Re: mysql client started with \u or \U in prompt throws warnings about lost memory on exit
Also filed in JIRA as MDEV-182

Comment by Rasmus Johansson (Inactive) [ 2012-03-16 ]

Launchpad bug id: 956249

Generated at Thu Feb 08 06:41:28 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.