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

crash while dropping index

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Resolution: Done
    • None
    • WT2.5.1
    • None
    • None

    Description

      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

      ()

      function called from

      ()

      doesn't set

       

      pointer when index isn't opened yet.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: