Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-1567

crash while dropping index

    • Type: Icon: Task Task
    • Resolution: Done
    • WT2.5.1
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Hi!

      I got a crash while dropping index:

      #include <assert.h>
      #include <stdio.h>
      #include <stdlib.h>
      #include <string.h>
      
      #include <wiredtiger.h>
      
      #define WT_HOME "drop_index.db"
      
      #define WT_CALL(call) \
          do { \
              const int __rc = call; \
              if (__rc != 0) { \
                  fprintf(stderr, # call " at (%s:%d) failed: %s [%d]\n", __FILE__, __LINE__, wiredtiger_strerror(__rc), __rc); \
                  exit(EXIT_FAILURE); \
              } \
          } while (0)
      
      int
      main(void)
      {
          WT_CONNECTION *conn;
          WT_SESSION *session;
      
          assert(system("rm -rf \"" WT_HOME "\" && mkdir \"" WT_HOME "\"") == 0);
      
          WT_CALL(wiredtiger_open(WT_HOME, NULL, "create", &conn));
          WT_CALL(conn->open_session(conn, NULL, NULL, &session));
      
          WT_CALL(session->create(session, "table:main", "columns=(k,v)"));
          WT_CALL(session->create(session, "index:main:index", "columns=(v)"));
      
          WT_CALL(conn->close(conn, NULL));
      
          /* Re-open and try to drop index */
          WT_CALL(wiredtiger_open(WT_HOME, NULL, NULL, &conn));
          WT_CALL(conn->open_session(conn, NULL, NULL, &session));
      
          WT_CALL(session->drop(session, "index:main:index", NULL));
      
          WT_CALL(conn->close(conn, NULL));
      
          return 0;
      }
      

      GDB session

      Program received signal SIGSEGV, Segmentation fault.
      0x00007ffff7dba7a1 in __drop_index (cfg=0x7fffffffd440, force=<optimized out>, uri=0x400e4f "index:main:index", session=0x6052b0) at src/schema/schema_drop.c:95
      95                      table->idx_complete = 0;
      Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.149.el6_6.4.x86_64
      (gdb) bt
      #0  0x00007ffff7dba7a1 in __drop_index (cfg=0x7fffffffd440, force=<optimized out>, uri=0x400e4f "index:main:index", session=0x6052b0) at src/schema/schema_drop.c:95
      WT-1  __wt_schema_drop (session=0x6052b0, uri=<optimized out>, cfg=0x7fffffffd440) at src/schema/schema_drop.c:177
      WT-2  0x00007ffff7dc85e7 in __session_drop (wt_session=0x6052b0, uri=0x400e4f "index:main:index", config=<optimized out>) at src/session/session_api.c:530
      WT-3  0x00000000004008e2 in main () at drop_index.c:39
      (gdb) p table
      $1 = (WT_TABLE *) 0x0
      

      Looks like

      Unable to find source-code formatter for language: __wt_schema_get_index. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      ()

      function called from

      Unable to find source-code formatter for language: __drop_index. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      ()

      doesn't set

      Unable to find source-code formatter for language: tablep. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      
      

      pointer when index isn't opened yet.

            Assignee:
            donald.anderson@mongodb.com Donald Anderson
            Reporter:
            dmitri-shubin Dmitri Shubin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: