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

Race with the sweep server ends up with segfault

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: dhandles
    • Labels:
    • 5
    • StorEng - Defined Pipeline

      This work should be a strictly time boxed investigation into the root cause. The work here may be informed (or inform) any work in WT-12118.

      The following reproducer generates a segfault.

      Code diff that makes the sweep server aggressive:

      diff --git a/test/csuite/wt2323_join_visibility/main.c b/test/csuite/wt2323_join_visibility/main.c
      index 326908bdeb..b0610a2f40 100644
      --- a/test/csuite/wt2323_join_visibility/main.c
      +++ b/test/csuite/wt2323_join_visibility/main.c
      @@ -113,7 +113,9 @@ main(int argc, char *argv[])
           testutil_snprintf(sharedopts->joinuri, sizeof(sharedopts->joinuri), "join:%s", opts->uri);
       
           testutil_check(wiredtiger_open(opts->home, NULL,
      -      "create,cache_size=1G,statistics=(all),statistics_log=(json,on_close,wait=1)", &opts->conn));
      +      "create,cache_size=1G,statistics=(all),statistics_log=(json,on_close,wait=1),file_manager=("
      +      "close_scan_interval=1,close_idle_time=1,close_handle_minimum=0)",
      +      &opts->conn));
       
           test_join(opts, sharedopts, true, true);
           test_join(opts, sharedopts, true, false);
      

      Test to execute:

      cd ./test/csuite/wt2323_join_visibility
      ./test_wt2323_join_visibility 
      

      Output:

        join thread 0 did 2624 joins
        join thread 1 did 2540 joins
        insert thread 0 did 417224 inserts, 82744 removes, 0 notfound, 32 rollbacks
        insert thread 1 did 417738 inserts, 82211 removes, 0 notfound, 51 rollbacks
      Segmentation fault (core dumped)
      

      Stack trace:

      #0  0x00007f664dc84c92 in __wt_schema_get_index (session=session@entry=0x7f664e335c78, uri=uri@entry=0x7fffa86a6fe0 "index:test_wt2323_join_visibility:flag", invalidate=invalidate@entry=true, quiet=quiet@entry=false, indexp=indexp@entry=0x7fffa86a6018) at ../src/schema/schema_open.c:542
      #1  0x00007f664dc81886 in __drop_index (session=session@entry=0x7f664e335c78, uri=uri@entry=0x7fffa86a6fe0 "index:test_wt2323_join_visibility:flag", force=force@entry=false, cfg=cfg@entry=0x7fffa86a6510) at ../src/schema/schema_drop.c:83
      #2  0x00007f664dc81ebf in __schema_drop (session=0x7f664e335c78, uri=uri@entry=0x7fffa86a6fe0 "index:test_wt2323_join_visibility:flag", cfg=cfg@entry=0x7fffa86a6510) at ../src/schema/schema_drop.c:345
      #3  0x00007f664dc816a0 in __wt_schema_drop (session=session@entry=0x7f664e335c78, uri=uri@entry=0x7fffa86a6fe0 "index:test_wt2323_join_visibility:flag", cfg=cfg@entry=0x7fffa86a6510) at ../src/schema/schema_drop.c:393
      #4  0x00007f664dc989fd in __session_drop (wt_session=0x7f664e335c78, uri=0x7fffa86a6fe0 "index:test_wt2323_join_visibility:flag", config=<optimized out>) at ../src/session/session_api.c:1249
      #5  0x0000000000402c1b in test_join (opts=opts@entry=0x7fffa86a6ac0, sharedopts=sharedopts@entry=0x7fffa86a6de0, bloom=bloom@entry=true, sometimes_remove=sometimes_remove@entry=true) at ../test/csuite/wt2323_join_visibility/main.c:214
      #6  0x0000000000403b9e in main (argc=<optimized out>, argv=<optimized out>) at ../test/csuite/wt2323_join_visibility/main.c:120
      

      Gdb shows that the indices array has been freed:

      (gdb) p table->nindices
      $1 = 3
      (gdb) p table->indices
      $2 = (WT_INDEX **) 0x0
      (gdb) p table->idx_alloc
      $3 = 0
      

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            etienne.petrel@mongodb.com Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: