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

Client crash on undefined charsetsdir

Details

    Description

      bash-5.1# mariadb --default-character-set=ascii -u dbadmin -p asterisk
      Enter password: 
      Welcome to the MariaDB monitor.  Commands end with ; or \g.
      Your MariaDB connection id is 429
      Server version: 10.5.8-MariaDB Source distribution
       
      Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
       
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
       
      MariaDB [asterisk]> select * from blacklist;
      Segmentation fault
      

      Location of segfault:
      ---------------------
      in find_command (name=0x5555559e80c0 "select * from blacklist;") at /sources/mariadb-10.5.8/client/mysql.cc:2207
      due to Nullptr in charset_info

      Expected behavior:
      -----------------
      Sensible error message, about missing character-sets-dir vs. requested charset

      Workaround:
      -----------
      Specify option character-sets-dir on commandline or in (client) config file

      [client]
      character-sets-dir=/usr/share/mysql/charsets
      

      Attachments

        Activity

          I cannot repeat that, there is no crash for me, charset_info isn't NULL, because ascii is a compiled-in charset, so it does not need any character-sets-dir.

          How did you compile?

          serg Sergei Golubchik added a comment - I cannot repeat that, there is no crash for me, charset_info isn't NULL, because ascii is a compiled-in charset, so it does not need any character-sets-dir. How did you compile?
          mjo24 Michael Joost added a comment -

          This was compiled from unmodified sources. According to hints found at BLFS, compile option -DWITH_EXTRA_CHARSETS=complex was used.
          There seems to exist no further documentation on that option, but apparently that mode incorporates built-in latin1, latin2, etc., but not ascii (see mariadb-10.5.8/cmake/character_sets.cmake).
          To reproduce the segfault, it is of course necessary that the specified or default of character-sets-dir does not exist, eg. like running the client from a different environment than compiled to.

          mjo24 Michael Joost added a comment - This was compiled from unmodified sources. According to hints found at BLFS, compile option -DWITH_EXTRA_CHARSETS=complex was used. There seems to exist no further documentation on that option, but apparently that mode incorporates built-in latin1, latin2, etc., but not ascii (see mariadb-10.5.8/cmake/character_sets.cmake). To reproduce the segfault, it is of course necessary that the specified or default of character-sets-dir does not exist, eg. like running the client from a different environment than compiled to.

          People

            serg Sergei Golubchik
            mjo24 Michael Joost
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.