Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-590

c-connector bind / execute mess up memory allocation

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 3.0.2
    • None
    • Prepared Statements
    • archlinux kernel 5.2.13
      gcc (GCC) 9.1.0
      mariadb 10.7.3 downloaded and compiled on host
      same behavior on upgraded version 10.4.8

    Description

      i'm using mariadb c-connector with prepare, bind and execute. it works usualy. but one case end up in "corrupted unsorted chunks" and core dumping when freeing bind buffer. i suggest the whole malloc organisation is messed up after calling mysql_stmt_execute(). my test's MysqlDynamic.c show:

      • the problem only is connected to x509cert variable bound by bnd[9]
      • freeing memory only fails if bnd[9].is_null = 0, if is_null execute end normally
      • freeing memory (using FreeStmt()) after bind and before execute end normally
      • print of bnd[9].buffer before execute show (void*) is connected to the correct string buffer
      • same behavior for setting bnd[9].buffer_length to STMT_INDICATOR_NTS or strlen()
      • other similar bindings (picture, bnd[10]) do not lead to corrupted memory and core dump.

      for more detailed explanation please see link stackoverflow.
      i'm opening this issue after i did not get any useful answers.

      please verify code MysqlDynamic.c and compile it. i especialy wrote for debugging purposes after running randomly into troubles. please let me know if <MysqlDynamic -i> run without problems.

      thank you

      Attachments

        1. MysqlDynamic.c
          20 kB
        2. ch.png
          ch.png
          0.2 kB
        3. cert.pem
          2 kB

        Activity

          People

            georg Georg Richter
            SwissGeorge Juerg Oehler
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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