Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-2384

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Trivial
    • Resolution: Fixed
    • None
    • None
    • None

    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.

      Attachments

        Activity

          People

            serg Sergei Golubchik
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.