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

row-store can pass garbage keys to collator functions

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: WT2.7.0
    • Fix Version/s: WT2.8.0
    • Labels:
      None
    • # Replies:
      8
    • Last comment by Customer:
      true

      Description

      The attached program collator_index_test.c sets up a collator on an index. During the second insertion, the collator compare is called with the expected key from the insertion, but with an unexpected key from the tree, a single null byte. The collator doesn't know what to make of this - it doesn't look like a (value,key) pair that can be decoded.

      The caller of the callback is row_srch.c:294, which seems to be handling appends in a fast-path. If the fast-path code is commented out, it gives normal callbacks.

      This test case is derived from attachment jcurs_u_extr_index_coll.c in WT-2308

      1. collator_index_test.c
        3 kB
        Donald Anderson

        Issue Links

          Activity

          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'keithbostic', u'name': u'Keith Bostic', u'email': u'keith@wiredtiger.com'}

          Message: WT-2368: row-store can pass garbage keys to collator functions

          When searching internal pages, row-store search does a fast check to see
          if we're appending to a tree. We weren't ignoring the internal page's 0th
          key in that code, that is, we were handing it to the collator. Since the
          0th key may not even exist, it has to be ignored.
          Branch: develop
          https://github.com/wiredtiger/wiredtiger/commit/8a638319268a5fde3cac531ae2f816c2e1cadb86

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'keithbostic', u'name': u'Keith Bostic', u'email': u'keith@wiredtiger.com'} Message: WT-2368 : row-store can pass garbage keys to collator functions When searching internal pages, row-store search does a fast check to see if we're appending to a tree. We weren't ignoring the internal page's 0th key in that code, that is, we were handing it to the collator. Since the 0th key may not even exist, it has to be ignored. Branch: develop https://github.com/wiredtiger/wiredtiger/commit/8a638319268a5fde3cac531ae2f816c2e1cadb86
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'michaelcahill', u'name': u'Michael Cahill', u'email': u'michael.cahill@mongodb.com'}

          Message: Merge pull request #2467 from wiredtiger/wt-2368

          WT-2368: row-store can pass garbage keys to collator functions
          Branch: develop
          https://github.com/wiredtiger/wiredtiger/commit/d83202a630d157ae8655d6d98399cbea77858606

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'michaelcahill', u'name': u'Michael Cahill', u'email': u'michael.cahill@mongodb.com'} Message: Merge pull request #2467 from wiredtiger/wt-2368 WT-2368 : row-store can pass garbage keys to collator functions Branch: develop https://github.com/wiredtiger/wiredtiger/commit/d83202a630d157ae8655d6d98399cbea77858606
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexg@wiredtiger.com'}

          Message: Import wiredtiger-wiredtiger-2.7.0-592-gcc96d99.tar.gz from wiredtiger branch mongodb-3.4

          ref: 7fea169..cc96d99

          WT-60 Big endian port
          WT-2130 Improve on-disk page utlilization with random workloads
          WT-2215 WT_LSN needs to support atomic reads and updates
          WT-2295 WT_SESSION.create does a full-scan of the main table
          WT-2352 Allow build and test without requiring lz4
          WT-2356 Log scan advances to next log file on partially written record
          WT-2363 Remove built in support for bzip2
          WT-2368 Row-store can pass garbage keys to collator functions
          WT-2369 Use C compiler to detect headers instead of C++ compiler
          WT-2371 Parent split cannot access the page after page-index swap
          WT-2372 WiredTiger windows builder fails with C4005 against the "inline" macro
          WT-2377 WTPERF doesn't compile in Windows under MSVC
          WT-2378 Tasks time out on LSM builder
          SERVER-22388 WiredTiger changes for MongoDB 3.3.2
          SERVER-22437 Coverity analysis defect 77704: Redundant test
          SERVER-22438 Coverity analysis defect 77705: Dereference before null check
          Branch: master
          https://github.com/mongodb/mongo/commit/79a378bddf664714190dc9d0a34b1d8cd4951588

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexg@wiredtiger.com'} Message: Import wiredtiger-wiredtiger-2.7.0-592-gcc96d99.tar.gz from wiredtiger branch mongodb-3.4 ref: 7fea169..cc96d99 WT-60 Big endian port WT-2130 Improve on-disk page utlilization with random workloads WT-2215 WT_LSN needs to support atomic reads and updates WT-2295 WT_SESSION.create does a full-scan of the main table WT-2352 Allow build and test without requiring lz4 WT-2356 Log scan advances to next log file on partially written record WT-2363 Remove built in support for bzip2 WT-2368 Row-store can pass garbage keys to collator functions WT-2369 Use C compiler to detect headers instead of C++ compiler WT-2371 Parent split cannot access the page after page-index swap WT-2372 WiredTiger windows builder fails with C4005 against the "inline" macro WT-2377 WTPERF doesn't compile in Windows under MSVC WT-2378 Tasks time out on LSM builder SERVER-22388 WiredTiger changes for MongoDB 3.3.2 SERVER-22437 Coverity analysis defect 77704: Redundant test SERVER-22438 Coverity analysis defect 77705: Dereference before null check Branch: master https://github.com/mongodb/mongo/commit/79a378bddf664714190dc9d0a34b1d8cd4951588
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'keithbostic', u'name': u'Keith Bostic', u'email': u'keith@wiredtiger.com'}

          Message: WT-2368: row-store can pass garbage keys to collator functions

          When searching internal pages, row-store search does a fast check to see
          if we're appending to a tree. We weren't ignoring the internal page's 0th
          key in that code, that is, we were handing it to the collator. Since the
          0th key may not even exist, it has to be ignored.
          Branch: mongodb-3.2
          https://github.com/wiredtiger/wiredtiger/commit/8a638319268a5fde3cac531ae2f816c2e1cadb86

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'keithbostic', u'name': u'Keith Bostic', u'email': u'keith@wiredtiger.com'} Message: WT-2368 : row-store can pass garbage keys to collator functions When searching internal pages, row-store search does a fast check to see if we're appending to a tree. We weren't ignoring the internal page's 0th key in that code, that is, we were handing it to the collator. Since the 0th key may not even exist, it has to be ignored. Branch: mongodb-3.2 https://github.com/wiredtiger/wiredtiger/commit/8a638319268a5fde3cac531ae2f816c2e1cadb86
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'michaelcahill', u'name': u'Michael Cahill', u'email': u'michael.cahill@mongodb.com'}

          Message: Merge pull request #2467 from wiredtiger/wt-2368

          WT-2368: row-store can pass garbage keys to collator functions
          Branch: mongodb-3.2
          https://github.com/wiredtiger/wiredtiger/commit/d83202a630d157ae8655d6d98399cbea77858606

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'michaelcahill', u'name': u'Michael Cahill', u'email': u'michael.cahill@mongodb.com'} Message: Merge pull request #2467 from wiredtiger/wt-2368 WT-2368 : row-store can pass garbage keys to collator functions Branch: mongodb-3.2 https://github.com/wiredtiger/wiredtiger/commit/d83202a630d157ae8655d6d98399cbea77858606
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'keithbostic', u'name': u'Keith Bostic', u'email': u'keith@wiredtiger.com'}

          Message: WT-2368: row-store can pass garbage keys to collator functions

          When searching internal pages, row-store search does a fast check to see
          if we're appending to a tree. We weren't ignoring the internal page's 0th
          key in that code, that is, we were handing it to the collator. Since the
          0th key may not even exist, it has to be ignored.
          Branch: mongodb-3.2
          https://github.com/wiredtiger/wiredtiger/commit/8a638319268a5fde3cac531ae2f816c2e1cadb86

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'keithbostic', u'name': u'Keith Bostic', u'email': u'keith@wiredtiger.com'} Message: WT-2368 : row-store can pass garbage keys to collator functions When searching internal pages, row-store search does a fast check to see if we're appending to a tree. We weren't ignoring the internal page's 0th key in that code, that is, we were handing it to the collator. Since the 0th key may not even exist, it has to be ignored. Branch: mongodb-3.2 https://github.com/wiredtiger/wiredtiger/commit/8a638319268a5fde3cac531ae2f816c2e1cadb86
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'username': u'michaelcahill', u'name': u'Michael Cahill', u'email': u'michael.cahill@mongodb.com'}

          Message: Merge pull request #2467 from wiredtiger/wt-2368

          WT-2368: row-store can pass garbage keys to collator functions
          Branch: mongodb-3.2
          https://github.com/wiredtiger/wiredtiger/commit/d83202a630d157ae8655d6d98399cbea77858606

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'username': u'michaelcahill', u'name': u'Michael Cahill', u'email': u'michael.cahill@mongodb.com'} Message: Merge pull request #2467 from wiredtiger/wt-2368 WT-2368 : row-store can pass garbage keys to collator functions Branch: mongodb-3.2 https://github.com/wiredtiger/wiredtiger/commit/d83202a630d157ae8655d6d98399cbea77858606
          Hide
          xgen-internal-githook Githook User added a comment -

          Author:

          {u'name': u'Ramon Fernandez', u'email': u'ramon@mongodb.com'}

          Message: Import wiredtiger-wiredtiger-2.7.0-650-g5cdd3e3.tar.gz from wiredtiger branch mongodb-3.2

          ref: 07966a4..5cdd3e3

          SERVER-22437 Coverity analysis defect 77704: Redundant test
          SERVER-22438 Coverity analysis defect 77705: Dereference before null check
          SERVER-22676 WiredTiger fails to open databases created by 3.0.0 or 3.0.1
          WT-2130 Improve on-disk page utlilization with random workloads
          WT-2215 WT_LSN needs to support atomic reads and updates
          WT-2295 WT_SESSION.create does a full-scan of the main table
          WT-2352 Allow build and test without requiring lz4
          WT-2356 log scan advances to next log file on partially written record
          WT-2363 Remove built in support for bzip2
          WT-2368 row-store can pass garbage keys to collator functions
          WT-2369 Use C compiler to detect headers instead of C++ compiler
          WT-2371 parent split cannot access the page after page-index swap
          WT-2372 WiredTiger windows builder fails with C4005 against the "inline" macro
          WT-2377 WTPERF doesn't compile in Windows under MSVC
          WT-2378 Tasks time out on LSM builder
          WT-2397 Cursor traversal from end of the tree skips records.
          WT-60 Big endian port
          Branch: v3.2
          https://github.com/mongodb/mongo/commit/f77630a9e971cae1f921292ea31d9d40a4b096b8

          Show
          xgen-internal-githook Githook User added a comment - Author: {u'name': u'Ramon Fernandez', u'email': u'ramon@mongodb.com'} Message: Import wiredtiger-wiredtiger-2.7.0-650-g5cdd3e3.tar.gz from wiredtiger branch mongodb-3.2 ref: 07966a4..5cdd3e3 SERVER-22437 Coverity analysis defect 77704: Redundant test SERVER-22438 Coverity analysis defect 77705: Dereference before null check SERVER-22676 WiredTiger fails to open databases created by 3.0.0 or 3.0.1 WT-2130 Improve on-disk page utlilization with random workloads WT-2215 WT_LSN needs to support atomic reads and updates WT-2295 WT_SESSION.create does a full-scan of the main table WT-2352 Allow build and test without requiring lz4 WT-2356 log scan advances to next log file on partially written record WT-2363 Remove built in support for bzip2 WT-2368 row-store can pass garbage keys to collator functions WT-2369 Use C compiler to detect headers instead of C++ compiler WT-2371 parent split cannot access the page after page-index swap WT-2372 WiredTiger windows builder fails with C4005 against the "inline" macro WT-2377 WTPERF doesn't compile in Windows under MSVC WT-2378 Tasks time out on LSM builder WT-2397 Cursor traversal from end of the tree skips records. WT-60 Big endian port Branch: v3.2 https://github.com/mongodb/mongo/commit/f77630a9e971cae1f921292ea31d9d40a4b096b8

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                1 year, 4 weeks, 6 days ago
                Date of 1st Reply: