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

DBUG_XXX interface fails on async api

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 2.3.1
    • None
    • None
    • None
    • windows x64

    Description

      DBUG_XXX interfaces rely on thread local storage.
      but.. async api use coroutine (in windows, use Fiber, user mode thread)
      It has own stack and own local storage.

      If you use async apis on windows, debug mode library, 2 more connection on one thread,
      your program will be killed silenty by DbugExit (dbug.c, 1295 line)
      CODE_STATE *cs from thread local storage..

      void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_)
      {
        int save_errno=errno;
        uint _slevel_= _stack_frame_->level & ~TRACE_ON;
        CODE_STATE *cs;
        get_code_state_or_return;
       
        if (cs->framep != _stack_frame_)
        {
          char buf[512];
          my_snprintf(buf, sizeof(buf), ERR_MISSING_RETURN, cs->func);
          DbugExit(buf);
        }
      

      resolve)
      1. do not use DBUG_XXX interface (use release version library)
      2. fix DBUG_XXX interface. do not use thread local storage, use fiber local storage or move debug interface to each connection or other storage...

      Attachments

        Activity

          People

            georg Georg Richter
            sphawk Sewon Park
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.