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

Double-free crash in libmariadb.so: mysql_options()

Details

    Description

      Fresh compilation with 10.2, using exact same code as 10.1, we get a crash in mysql_options():

      ==31368==ERROR: AddressSanitizer: attempting double-free on 0x61600000e780 in thread T0:
          #0 0x7f07af355527 in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x54527)
          #1 0x7f07a38e9688 in _mariadb_read_options /home/buildbot/buildbot/build/libmariadb/libmariadb/ma_default.c:218
          #2 0x7f07a38eebcd in mthd_my_real_connect /home/buildbot/buildbot/build/libmariadb/libmariadb/mariadb_lib.c:1201
          #3 0x7f07a38ec0b9 in mysql_real_connect /home/buildbot/buildbot/build/libmariadb/libmariadb/mariadb_lib.c:1168
          #4 0x7f07a3f0b70e in doConnect /home/sf/genero/devel/fgl/fgl/src/sqldriver/mysql/mys.c:495
      ...
      

      Attachments

        Issue Links

          Activity

            georg Georg Richter added a comment -

            Fixed in Connector/C branch master:
            commit 6bec9204f0cbcb0d1b1256f0bfccf4bf293e1c32
            Author: Georg Richter <georg@mariadb.com>
            Date: Mon Mar 20 07:29:51 2017 +0100

            georg Georg Richter added a comment - Fixed in Connector/C branch master: commit 6bec9204f0cbcb0d1b1256f0bfccf4bf293e1c32 Author: Georg Richter <georg@mariadb.com> Date: Mon Mar 20 07:29:51 2017 +0100
            sebflaesch FLAESCH Sebastien added a comment - - edited

            Just testing 10.2.5....

            mysql_options() is no longer crashing, but it looks like it does not load user-defined config for "client" section when doing:

            mysql_options(cn->dbcHandle, MYSQL_READ_DEFAULT_GROUP, "client")
            

            I have a ~/my.cnf file with following content:

            [client]
            default-character-set="utf8"
            

            But when executing SQL with UTF-8 characters the parser gets confused as if I am using another encoding:

            CREATE TABLE tutf8_é日 (pk INTEGER NOT NULL PRIMARY KEY,c1_é日 CHAR (10),vc1_é日 VARCHAR (10))
            

            Error:

            You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '�日 (pk integer NOT NULL PRIMARY KEY,c1_é日 char(10),vc1_é��' at line 1
            

            Same code works fine with Oracle MySQL 5.7.

            New bug created: MDEV-12578

            sebflaesch FLAESCH Sebastien added a comment - - edited Just testing 10.2.5.... mysql_options() is no longer crashing, but it looks like it does not load user-defined config for "client" section when doing: mysql_options(cn->dbcHandle, MYSQL_READ_DEFAULT_GROUP, "client") I have a ~/my.cnf file with following content: [client] default-character-set="utf8" But when executing SQL with UTF-8 characters the parser gets confused as if I am using another encoding: CREATE TABLE tutf8_é日 (pk INTEGER NOT NULL PRIMARY KEY,c1_é日 CHAR (10),vc1_é日 VARCHAR (10)) Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '�日 (pk integer NOT NULL PRIMARY KEY,c1_é日 char(10),vc1_é��' at line 1 Same code works fine with Oracle MySQL 5.7. New bug created: MDEV-12578

            Verified with 10.2.8

            sebflaesch FLAESCH Sebastien added a comment - Verified with 10.2.8

            People

              georg Georg Richter
              sebflaesch FLAESCH Sebastien
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.