The following issues were found

src/third_party/boost/boost/spirit/home/classic/phoenix/tuples.hpp
32 issues
access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 139 Column: 12 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              namespace impl {

    template <typename T>
    struct access {

        typedef const T& ctype;
        typedef T& type;
    };


            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 146 Column: 12 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  };

    template <typename T>
    struct access<T&> {

        typedef T& ctype;
        typedef T& type;
    };
}

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 188 Column: 28 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              struct tuple_element<0, TupleT>
{
    typedef typename TupleT::a_type type;
    typedef typename impl::access<type>::type rtype;
    typedef typename impl::access<type>::ctype crtype;

    static rtype    get(TupleT& t)          { return t.a; }
    static crtype   get(TupleT const& t)    { return t.a; }
};

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 189 Column: 28 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              {
    typedef typename TupleT::a_type type;
    typedef typename impl::access<type>::type rtype;
    typedef typename impl::access<type>::ctype crtype;

    static rtype    get(TupleT& t)          { return t.a; }
    static crtype   get(TupleT const& t)    { return t.a; }
};


            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 200 Column: 28 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              struct tuple_element<1, TupleT>
{
    typedef typename TupleT::b_type type;
    typedef typename impl::access<type>::type rtype;
    typedef typename impl::access<type>::ctype crtype;

    static rtype    get(TupleT& t)          { return t.b; }
    static crtype   get(TupleT const& t)    { return t.b; }
};

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 201 Column: 28 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              {
    typedef typename TupleT::b_type type;
    typedef typename impl::access<type>::type rtype;
    typedef typename impl::access<type>::ctype crtype;

    static rtype    get(TupleT& t)          { return t.b; }
    static crtype   get(TupleT const& t)    { return t.b; }
};


            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 212 Column: 28 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              struct tuple_element<2, TupleT>
{
    typedef typename TupleT::c_type type;
    typedef typename impl::access<type>::type rtype;
    typedef typename impl::access<type>::ctype crtype;

    static rtype    get(TupleT& t)          { return t.c; }
    static crtype   get(TupleT const& t)    { return t.c; }
};

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 213 Column: 28 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              {
    typedef typename TupleT::c_type type;
    typedef typename impl::access<type>::type rtype;
    typedef typename impl::access<type>::ctype crtype;

    static rtype    get(TupleT& t)          { return t.c; }
    static crtype   get(TupleT const& t)    { return t.c; }
};


            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 225 Column: 28 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              struct tuple_element<3, TupleT>
{
    typedef typename TupleT::d_type type;
    typedef typename impl::access<type>::type rtype;
    typedef typename impl::access<type>::ctype crtype;

    static rtype    get(TupleT& t)          { return t.d; }
    static crtype   get(TupleT const& t)    { return t.d; }
};

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 226 Column: 28 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              {
    typedef typename TupleT::d_type type;
    typedef typename impl::access<type>::type rtype;
    typedef typename impl::access<type>::ctype crtype;

    static rtype    get(TupleT& t)          { return t.d; }
    static crtype   get(TupleT const& t)    { return t.d; }
};


            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_gc01.py
32 issues
Unable to import 'wiredtiger'
Error

Line: 35 Column: 1

              
import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wiredtiger import stat

# test_gc01.py
# Shared base class used by gc tests.

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 37 Column: 1

              from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wiredtiger import stat

# test_gc01.py
# Shared base class used by gc tests.
class test_gc_base(wttest.WiredTigerTestCase):


            

Reported by Pylint.

Unused import time
Error

Line: 33 Column: 1

              # checkpoint:garbage_collection
# [END_TAGS]

import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wiredtiger import stat


            

Reported by Pylint.

Unused copy_wiredtiger_home imported from helper
Error

Line: 34 Column: 1

              # [END_TAGS]

import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wiredtiger import stat

# test_gc01.py

            

Reported by Pylint.

Unused argument 'ds'
Error

Line: 53 Column: 42

                          session.commit_transaction('commit_timestamp=' + self.timestamp_str(commit_ts))
        cursor.close()

    def large_modifies(self, uri, value, ds, location, nbytes, nrows, commit_ts):
        # Load a slight modification.
        session = self.session
        cursor = session.open_cursor(uri)
        session.begin_transaction()
        for i in range(0, nrows):

            

Reported by Pylint.

Unused variable 'k'
Error

Line: 70 Column: 13

                      session.begin_transaction('read_timestamp=' + self.timestamp_str(read_ts))
        cursor = session.open_cursor(uri)
        count = 0
        for k, v in cursor:
            self.assertEqual(v, check_value)
            count += 1
        session.rollback_transaction()
        self.assertEqual(count, nrows)


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 35 Column: 1

              
import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wiredtiger import stat

# test_gc01.py
# Shared base class used by gc tests.

            

Reported by Pylint.

third party import "import wiredtiger, wttest" should be placed before "from helper import copy_wiredtiger_home"
Error

Line: 35 Column: 1

              
import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wiredtiger import stat

# test_gc01.py
# Shared base class used by gc tests.

            

Reported by Pylint.

third party import "from wiredtiger import stat" should be placed before "from helper import copy_wiredtiger_home"
Error

Line: 37 Column: 1

              from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wiredtiger import stat

# test_gc01.py
# Shared base class used by gc tests.
class test_gc_base(wttest.WiredTigerTestCase):


            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_truncate02.py
32 issues
Unable to import 'wiredtiger'
Error

Line: 33 Column: 1

              #       session level operations on tables
#

import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_truncate_fast_delete
#       When deleting leaf pages that aren't in memory, we set transactional

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 33 Column: 1

              #       session level operations on tables
#

import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_truncate_fast_delete
#       When deleting leaf pages that aren't in memory, we set transactional

            

Reported by Pylint.

String statement has no effect
Error

Line: 116 Column: 9

                  def test_truncate_fast_delete(self):
        uri = self.type + self.name

        '''
        print '===== run:'
        print 'config:', self.config + self.keyfmt, \
            'overflow=', self.overflow, \
            'readafter=', self.readafter, 'readbefore=', self.readbefore, \
            'writeafter=', self.writeafter, 'writebefore=', self.writebefore, \

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 33 Column: 1

              #       session level operations on tables
#

import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_truncate_fast_delete
#       When deleting leaf pages that aren't in memory, we set transactional

            

Reported by Pylint.

Class name "test_truncate_fast_delete" doesn't conform to PascalCase naming style
Error

Line: 41 Column: 1

              #       When deleting leaf pages that aren't in memory, we set transactional
# information in the page's WT_REF structure, which results in interesting
# issues.
class test_truncate_fast_delete(wttest.WiredTigerTestCase):
    name = 'test_truncate'
    nentries = 10000

    # Use a small page size and lots of keys because we want to create lots
    # of individual pages in the file.

            

Reported by Pylint.

Missing class docstring
Error

Line: 41 Column: 1

              #       When deleting leaf pages that aren't in memory, we set transactional
# information in the page's WT_REF structure, which results in interesting
# issues.
class test_truncate_fast_delete(wttest.WiredTigerTestCase):
    name = 'test_truncate'
    nentries = 10000

    # Use a small page size and lots of keys because we want to create lots
    # of individual pages in the file.

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 93 Column: 5

              
    # Return the number of records visible to the cursor; test both forward
    # and backward iteration, they are different code paths in this case.
    def cursor_count(self, cursor, expected):
        count = 0
        while cursor.next() == 0:
            count += 1
        self.assertEqual(count, expected)
        cursor.reset()

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 105 Column: 5

                      self.assertEqual(count, expected)

    # Open a cursor in a new session and confirm how many records it sees.
    def outside_count(self, isolation, expected):
        s = self.conn.open_session()
        s.begin_transaction(isolation)
        cursor = s.open_cursor(self.type + self.name, None)
        self.cursor_count(cursor, expected)
        s.close()

            

Reported by Pylint.

Variable name "s" doesn't conform to snake_case naming style
Error

Line: 106 Column: 9

              
    # Open a cursor in a new session and confirm how many records it sees.
    def outside_count(self, isolation, expected):
        s = self.conn.open_session()
        s.begin_transaction(isolation)
        cursor = s.open_cursor(self.type + self.name, None)
        self.cursor_count(cursor, expected)
        s.close()


            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_hs06.py
32 issues
Unable to import 'wiredtiger'
Error

Line: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import wiredtiger, wttest
from wiredtiger import stat
from wtscenario import make_scenarios

# test_hs06.py
# Verify that triggering history store usage does not cause a spike in memory usage

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import wiredtiger, wttest
from wiredtiger import stat
from wtscenario import make_scenarios

# test_hs06.py
# Verify that triggering history store usage does not cause a spike in memory usage
# to form an update chain from the history store contents.

            

Reported by Pylint.

TODO: Uncomment the checks after the main portion of the relevant history
Error

Line: 40 Column: 3

              # The required value should be fetched from the history store and then passed straight
# back to the user without putting together an update chain.
#
# TODO: Uncomment the checks after the main portion of the relevant history
# project work is complete.
class test_hs06(wttest.WiredTigerTestCase):
    # Force a small cache.
    conn_config = 'cache_size=50MB,statistics=(fast)'
    session_config = 'isolation=snapshot'

            

Reported by Pylint.

Redefining name 'stat' from outer scope (line 30)
Error

Line: 54 Column: 24

                  scenarios = make_scenarios(key_format_values)
    nrows = 2000

    def get_stat(self, stat):
        stat_cursor = self.session.open_cursor('statistics:')
        val = stat_cursor[stat][2]
        stat_cursor.close()
        return val


            

Reported by Pylint.

FIXME-WT-5927: Checkpoint cursors are known to have issues in durable history so we've
Error

Line: 97 Column: 3

              
        # Check the checkpoint wrote the expected values.
        #
        # FIXME-WT-5927: Checkpoint cursors are known to have issues in durable history so we've
        # removing the use of checkpoint handles in this test. As part of WT-5927, we should either
        # re-enable the testing of checkpoint cursors or remove this comment.
        #
        # cursor2 = self.session.open_cursor(uri, None, 'checkpoint=WiredTigerCheckpoint')
        cursor2 = self.session.open_cursor(uri)

            

Reported by Pylint.

Unused variable 'key'
Error

Line: 104 Column: 13

                      # cursor2 = self.session.open_cursor(uri, None, 'checkpoint=WiredTigerCheckpoint')
        cursor2 = self.session.open_cursor(uri)
        self.session.begin_transaction('read_timestamp=' + self.timestamp_str(2))
        for key, value in cursor2:
            self.assertEqual(value, value1)
        self.session.commit_transaction()
        cursor2.close()

        start_usage = self.get_non_page_image_memory_usage()

            

Reported by Pylint.

Unused variable 'start_usage'
Error

Line: 109 Column: 9

                      self.session.commit_transaction()
        cursor2.close()

        start_usage = self.get_non_page_image_memory_usage()

        # Whenever we request something out of cache of timestamp 2, we should
        # be reading it straight from the history store without initialising a full
        # update chain of every version of the data.
        self.session.begin_transaction('read_timestamp=' + self.timestamp_str(2))

            

Reported by Pylint.

Unused variable 'end_usage'
Error

Line: 119 Column: 9

                          self.assertEqual(cursor[self.create_key(i)], value1)
        self.session.rollback_transaction()

        end_usage = self.get_non_page_image_memory_usage()

        # Non-page related memory usage shouldn't spike significantly.
        #
        # Prior to this change, this type of workload would use a lot of memory
        # to recreate update lists for each page.

            

Reported by Pylint.

TODO: Uncomment this once the project work is done.
Error

Line: 129 Column: 3

                      # This check could be more aggressive but to avoid potential flakiness,
        # lets just ensure that it hasn't doubled.
        #
        # TODO: Uncomment this once the project work is done.
        # self.assertLessEqual(end_usage, (start_usage * 2))

    # WT-5336 causing the read at timestamp 4 returning the value committed at timestamp 5 or 3
    def test_hs_modify_reads(self):
        # Create a small table.

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 250 Column: 17

                          cursor.set_key(self.create_key(i))
            self.assertRaisesException(
                wiredtiger.WiredTigerError,
                lambda: cursor.search(),
                '/conflict with a prepared update/')
        self.session.rollback_transaction()

        prepare_session.commit_transaction(
            'commit_timestamp=' + self.timestamp_str(5) + ',durable_timestamp=' + self.timestamp_str(6))

            

Reported by Pylint.

src/third_party/mozjs-60/extract/js/src/jit/x86-shared/Disassembler-x86-shared.cpp
32 issues
access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 162 Column: 72 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              #define Pack3ByteOpcode(op1, op2) PackOpcode(OP_2BYTE_ESCAPE, op1, op2)

uint8_t*
js::jit::Disassembler::DisassembleHeapAccess(uint8_t* ptr, HeapAccess* access)
{
    VexOperandType type = VEX_PS;
    uint32_t opcode = OP_HLT;
    uint8_t modrm = 0;
    uint8_t sib = 0;

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 522 Column: 57 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              
#ifdef DEBUG
void
js::jit::Disassembler::DumpHeapAccess(const HeapAccess& access)
{
    switch (access.kind()) {
      case HeapAccess::Store:      fprintf(stderr, "store"); break;
      case HeapAccess::Load:       fprintf(stderr, "load"); break;
      case HeapAccess::LoadSext32: fprintf(stderr, "loadSext32"); break;

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 524 Column: 13 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              void
js::jit::Disassembler::DumpHeapAccess(const HeapAccess& access)
{
    switch (access.kind()) {
      case HeapAccess::Store:      fprintf(stderr, "store"); break;
      case HeapAccess::Load:       fprintf(stderr, "load"); break;
      case HeapAccess::LoadSext32: fprintf(stderr, "loadSext32"); break;
      case HeapAccess::LoadSext64: fprintf(stderr, "loadSext64"); break;
      default:                     fprintf(stderr, "unknown"); break;

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 531 Column: 37 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                    case HeapAccess::LoadSext64: fprintf(stderr, "loadSext64"); break;
      default:                     fprintf(stderr, "unknown"); break;
    }
    fprintf(stderr, "%u ", unsigned(access.size()));

    switch (access.otherOperand().kind()) {
      case OtherOperand::Imm:
        fprintf(stderr, "imm %d", access.otherOperand().imm());
        break;

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 533 Column: 13 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  }
    fprintf(stderr, "%u ", unsigned(access.size()));

    switch (access.otherOperand().kind()) {
      case OtherOperand::Imm:
        fprintf(stderr, "imm %d", access.otherOperand().imm());
        break;
      case OtherOperand::GPR:
        fprintf(stderr, "gpr %s", X86Encoding::GPRegName(access.otherOperand().gpr()));

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 535 Column: 35 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              
    switch (access.otherOperand().kind()) {
      case OtherOperand::Imm:
        fprintf(stderr, "imm %d", access.otherOperand().imm());
        break;
      case OtherOperand::GPR:
        fprintf(stderr, "gpr %s", X86Encoding::GPRegName(access.otherOperand().gpr()));
        break;
      case OtherOperand::FPR:

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 538 Column: 58 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                      fprintf(stderr, "imm %d", access.otherOperand().imm());
        break;
      case OtherOperand::GPR:
        fprintf(stderr, "gpr %s", X86Encoding::GPRegName(access.otherOperand().gpr()));
        break;
      case OtherOperand::FPR:
        fprintf(stderr, "fpr %s", X86Encoding::XMMRegName(access.otherOperand().fpr()));
        break;
      default: fprintf(stderr, "unknown");

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 541 Column: 59 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                      fprintf(stderr, "gpr %s", X86Encoding::GPRegName(access.otherOperand().gpr()));
        break;
      case OtherOperand::FPR:
        fprintf(stderr, "fpr %s", X86Encoding::XMMRegName(access.otherOperand().fpr()));
        break;
      default: fprintf(stderr, "unknown");
    }

    fprintf(stderr, " @ ");

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 548 Column: 9 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              
    fprintf(stderr, " @ ");

    if (access.address().isPCRelative()) {
        fprintf(stderr, MEM_o32r " ", ADDR_o32r(access.address().disp()));
    } else if (access.address().hasIndex()) {
        if (access.address().hasBase()) {
            fprintf(stderr, MEM_obs " ",
                    ADDR_obs(access.address().disp(), access.address().base(),

            

Reported by FlawFinder.

fprintf - If format strings can be influenced by an attacker, they can be exploited
Security

Line: 549 Column: 9 CWE codes: 134
Suggestion: Use a constant for the format specification

                  fprintf(stderr, " @ ");

    if (access.address().isPCRelative()) {
        fprintf(stderr, MEM_o32r " ", ADDR_o32r(access.address().disp()));
    } else if (access.address().hasIndex()) {
        if (access.address().hasBase()) {
            fprintf(stderr, MEM_obs " ",
                    ADDR_obs(access.address().disp(), access.address().base(),
                             access.address().index(), access.address().scale()));

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_rollback_to_stable19.py
32 issues
Unable to import 'wiredtiger'
Error

Line: 32 Column: 1

              import fnmatch, os, shutil, time
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base
from wiredtiger import stat, WT_NOTFOUND
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_rollback_to_stable19.py
# Test that rollback to stable aborts both insert and remove updates from a single prepared transaction

            

Reported by Pylint.

An attribute defined in wttest line 401 hides this method
Error

Line: 58 Column: 5

              
    scenarios = make_scenarios(in_memory_values, key_format_values, restart_options)

    def conn_config(self):
        config = 'cache_size=50MB,statistics=(all),log=(enabled=false),eviction_dirty_trigger=5,eviction_updates_trigger=5'
        if self.in_memory:
            config += ',in_memory=true'
        else:
            config += ',in_memory=false'

            

Reported by Pylint.

Unused import os
Error

Line: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import fnmatch, os, shutil, time
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base
from wiredtiger import stat, WT_NOTFOUND
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

            

Reported by Pylint.

Unused import shutil
Error

Line: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import fnmatch, os, shutil, time
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base
from wiredtiger import stat, WT_NOTFOUND
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

            

Reported by Pylint.

Unused import time
Error

Line: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import fnmatch, os, shutil, time
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base
from wiredtiger import stat, WT_NOTFOUND
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

            

Reported by Pylint.

Unused import fnmatch
Error

Line: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import fnmatch, os, shutil, time
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base
from wiredtiger import stat, WT_NOTFOUND
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 98 Column: 9

                      # Search for the key so we position our cursor on the page that we want to evict.
        self.session.begin_transaction("ignore_prepare = true")
        evict_cursor.set_key(1)
        self.assertEquals(evict_cursor.search(), WT_NOTFOUND)
        evict_cursor.reset()
        evict_cursor.close()
        self.session.commit_transaction()

        # Search to make sure the data is not visible

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 107 Column: 9

                      self.session.begin_transaction("ignore_prepare = true")
        cursor2 = self.session.open_cursor(uri)
        cursor2.set_key(1)
        self.assertEquals(cursor2.search(), WT_NOTFOUND)
        self.session.commit_transaction()
        cursor2.close()

        # Pin stable timestamp to 20.
        self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(20))

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 185 Column: 9

                      # Search for the key so we position our cursor on the page that we want to evict.
        self.session.begin_transaction("ignore_prepare = true")
        evict_cursor.set_key(1)
        self.assertEquals(evict_cursor.search(), WT_NOTFOUND)
        evict_cursor.reset()
        evict_cursor.close()
        self.session.commit_transaction()

        # Search to make sure the data is not visible

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 194 Column: 9

                      self.session.begin_transaction("ignore_prepare = true")
        cursor2 = self.session.open_cursor(uri)
        cursor2.set_key(1)
        self.assertEquals(cursor2.search(), WT_NOTFOUND)
        self.session.commit_transaction()
        cursor2.close()

        # Pin stable timestamp to 40.
        self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(40))

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_rollback_to_stable25.py
32 issues
Unable to import 'wiredtiger'
Error

Line: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import wiredtiger, wttest
from wtscenario import make_scenarios, filter_scenarios

# test_rollback_to_stable25.py
# Check various scenarios relating to RLE cells in column-store.
#

            

Reported by Pylint.

Method should have "self" as first argument
Error

Line: 119 Column: 5

                      ('roll25', dict(rollback_time=25)),
    ]

    def is_meaningful(name, vals):
        # The last write at evict time should be uniform, to get an RLE cell.
        if vals['evict_time'] == 10 and vals['write_10'] != 'u':
            return False
        if vals['evict_time'] == 20 and vals['write_20'] != 'u':
            return False

            

Reported by Pylint.

Redefining built-in 'format'
Error

Line: 231 Column: 9

                  def test_rollback_to_stable25(self):
        # Create a table without logging.
        uri = "table:rollback_to_stable25"
        format = 'key_format=r,value_format=S'
        self.session.create(uri, format + ', log=(enabled=false)')

        # Pin oldest timestamp to 5.
        self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(5))


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import wiredtiger, wttest
from wtscenario import make_scenarios, filter_scenarios

# test_rollback_to_stable25.py
# Check various scenarios relating to RLE cells in column-store.
#

            

Reported by Pylint.

Constant name "my_rle_size" doesn't conform to UPPER_CASE naming style
Error

Line: 54 Column: 1

              # Put these bits outside the class definition so they can be referred to both in class
# instances and in the scenario setup logic, which doesn't have a class instance yet.

my_rle_size = 5

def keys_of_write(write):
    if write == 'u' or write == 'h':
        return range(2, 2 + my_rle_size)
    elif write == 'f':

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 56 Column: 1

              
my_rle_size = 5

def keys_of_write(write):
    if write == 'u' or write == 'h':
        return range(2, 2 + my_rle_size)
    elif write == 'f':
        return [2]
    elif write == 'm':

            

Reported by Pylint.

Unnecessary "elif" after "return"
Error

Line: 57 Column: 5

              my_rle_size = 5

def keys_of_write(write):
    if write == 'u' or write == 'h':
        return range(2, 2 + my_rle_size)
    elif write == 'f':
        return [2]
    elif write == 'm':
        return [2 + my_rle_size // 2]

            

Reported by Pylint.

Consider merging these comparisons with "in" to "write in ('u', 'h')"
Error

Line: 57 Column: 8

              my_rle_size = 5

def keys_of_write(write):
    if write == 'u' or write == 'h':
        return range(2, 2 + my_rle_size)
    elif write == 'f':
        return [2]
    elif write == 'm':
        return [2 + my_rle_size // 2]

            

Reported by Pylint.

Missing class docstring
Error

Line: 66 Column: 1

                  else:
        return [2 + my_rle_size - 1]

class test_rollback_to_stable25(wttest.WiredTigerTestCase):
    session_config = 'isolation=snapshot'
    conn_config = 'in_memory=false'

    write_10_values = [
        ('10u', dict(write_10='u')),

            

Reported by Pylint.

src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid64_compare.c
32 issues
Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 279 CWE codes: 758

                // if |exp_x - exp_y| < 15, it comes down to the compensated significand
  if (exp_x > exp_y) {	// to simplify the loop below,
    // otherwise adjust the x significand upwards
    __mul_64x64_to_128MACH (sig_n_prime, sig_x,
			    bid_mult_factor[exp_x - exp_y]);
    // if postitive, return whichever significand is larger (converse if neg.)
    if (sig_n_prime.w[1] == 0 && (sig_n_prime.w[0] == sig_y)) {
      res = 0;
      BID_RETURN (res);

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 292 CWE codes: 758

                  BID_RETURN (res);
  }
  // adjust the y significand upwards
  __mul_64x64_to_128MACH (sig_n_prime, sig_y,
			  bid_mult_factor[exp_y - exp_x]);
  // if postitive, return whichever significand is larger 
  //     (converse if negative)
  if (sig_n_prime.w[1] == 0 && (sig_n_prime.w[0] == sig_x)) {
    res = 0;

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 431 CWE codes: 758

                // if |exp_x - exp_y| < 15, it comes down to the compensated significand
  if (exp_x > exp_y) {	// to simplify the loop below,
    // otherwise adjust the x significand upwards
    __mul_64x64_to_128MACH (sig_n_prime, sig_x,
			    bid_mult_factor[exp_x - exp_y]);
    // return 1 if values are equal
    if (sig_n_prime.w[1] == 0 && (sig_n_prime.w[0] == sig_y)) {
      res = 1;
      BID_RETURN (res);

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 446 CWE codes: 758

                  BID_RETURN (res);
  }
  // adjust the y significand upwards
  __mul_64x64_to_128MACH (sig_n_prime, sig_y,
			  bid_mult_factor[exp_y - exp_x]);
  // return 0 if values are equal
  if (sig_n_prime.w[1] == 0 && (sig_n_prime.w[0] == sig_x)) {
    res = 1;
    BID_RETURN (res);

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 587 CWE codes: 758

                // if |exp_x - exp_y| < 15, it comes down to the compensated significand
  if (exp_x > exp_y) {	// to simplify the loop below,
    // otherwise adjust the x significand upwards
    __mul_64x64_to_128MACH (sig_n_prime, sig_x,
			    bid_mult_factor[exp_x - exp_y]);
    // if postitive, return whichever significand is larger 
    // (converse if negative)
    if (sig_n_prime.w[1] == 0 && (sig_n_prime.w[0] == sig_y)) {
      res = 0;

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 601 CWE codes: 758

                  BID_RETURN (res);
  }
  // adjust the y significand upwards
  __mul_64x64_to_128MACH (sig_n_prime, sig_y,
			  bid_mult_factor[exp_y - exp_x]);
  // if postitive, return whichever significand is larger (converse if negative)
  if (sig_n_prime.w[1] == 0 && (sig_n_prime.w[0] == sig_x)) {
    res = 0;
    BID_RETURN (res);

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 741 CWE codes: 758

                // if |exp_x - exp_y| < 15, it comes down to the compensated significand
  if (exp_x > exp_y) {	// to simplify the loop below,
    // otherwise adjust the x significand upwards
    __mul_64x64_to_128MACH (sig_n_prime, sig_x,
			    bid_mult_factor[exp_x - exp_y]);
    // return 0 if values are equal
    if (sig_n_prime.w[1] == 0 && (sig_n_prime.w[0] == sig_y)) {
      res = 0;
      BID_RETURN (res);

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 756 CWE codes: 758

                  BID_RETURN (res);
  }
  // adjust the y significand upwards
  __mul_64x64_to_128MACH (sig_n_prime, sig_y,
			  bid_mult_factor[exp_y - exp_x]);
  // return 0 if values are equal
  if (sig_n_prime.w[1] == 0 && (sig_n_prime.w[0] == sig_x)) {
    res = 0;
    BID_RETURN (res);

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 897 CWE codes: 758

                // if |exp_x - exp_y| < 15, it comes down to the compensated significand
  if (exp_x > exp_y) {	// to simplify the loop below,
    // otherwise adjust the x significand upwards
    __mul_64x64_to_128MACH (sig_n_prime, sig_x,
			    bid_mult_factor[exp_x - exp_y]);
    // return 1 if values are equal
    if (sig_n_prime.w[1] == 0 && (sig_n_prime.w[0] == sig_y)) {
      res = 1;
      BID_RETURN (res);

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 912 CWE codes: 758

                  BID_RETURN (res);
  }
  // adjust the y significand upwards
  __mul_64x64_to_128MACH (sig_n_prime, sig_y,
			  bid_mult_factor[exp_y - exp_x]);
  // return 1 if values are equal
  if (sig_n_prime.w[1] == 0 && (sig_n_prime.w[0] == sig_x)) {
    res = 1;
    BID_RETURN (res);

            

Reported by Cppcheck.

src/third_party/wiredtiger/test/suite/test_search_near01.py
32 issues
Unable to import 'wiredtiger'
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.
#

import time, wiredtiger, wttest, unittest
from wiredtiger import stat

# test_search_near01.py
# Test various prefix search near scenarios.
class test_search_near01(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 31 Column: 1

              #

import time, wiredtiger, wttest, unittest
from wiredtiger import stat

# test_search_near01.py
# Test various prefix search near scenarios.
class test_search_near01(wttest.WiredTigerTestCase):
    conn_config = 'statistics=(all)'

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.
#

import time, wiredtiger, wttest, unittest
from wiredtiger import stat

# test_search_near01.py
# Test various prefix search near scenarios.
class test_search_near01(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Unused import time
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.
#

import time, wiredtiger, wttest, unittest
from wiredtiger import stat

# test_search_near01.py
# Test various prefix search near scenarios.
class test_search_near01(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Unused import unittest
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.
#

import time, wiredtiger, wttest, unittest
from wiredtiger import stat

# test_search_near01.py
# Test various prefix search near scenarios.
class test_search_near01(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Redefining name 'stat' from outer scope (line 31)
Error

Line: 39 Column: 24

                  conn_config = 'statistics=(all)'
    session_config = 'isolation=snapshot'

    def get_stat(self, stat, local_session = None):
        if (local_session != None):
            stat_cursor = local_session.open_cursor('statistics:')
        else:
            stat_cursor = self.session.open_cursor('statistics:')
        val = stat_cursor[stat][2]

            

Reported by Pylint.

Redefining built-in 'id'
Error

Line: 48 Column: 45

                      stat_cursor.close()
        return val

    def unique_insert(self, cursor, prefix, id, keys):
        key = prefix +  ',' +  str(id)
        keys.append(key)
        cursor.set_key(prefix)
        cursor.set_value(prefix)
        self.assertEqual(cursor.insert(), 0)

            

Reported by Pylint.

Redefining built-in 'id'
Error

Line: 164 Column: 9

                      session2.begin_transaction()

        key_count = 26*26
        id = 0
        cc_id = 0
        keys = []

        # Insert keys aa,1 -> zz,N
        for i in range (0, 26):

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled

            

Reported by Pylint.

standard import "import time, wiredtiger, wttest, unittest" should be placed before "import time, wiredtiger, wttest, unittest"
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.
#

import time, wiredtiger, wttest, unittest
from wiredtiger import stat

# test_search_near01.py
# Test various prefix search near scenarios.
class test_search_near01(wttest.WiredTigerTestCase):

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_shared_cache01.py
32 issues
Unable to import 'wiredtiger'
Error

Line: 32 Column: 1

              
import os
import shutil
import wiredtiger, wttest

# test_shared_cache01.py
#    Checkpoint tests
# Test shared cache shared amongst multiple connections.
class test_shared_cache01(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Parameters differ from overridden 'close_conn' method
Error

Line: 54 Column: 5

                  def setUpSessionOpen(self, conn):
        return None

    def close_conn(self):
        return None

    def setUpConnectionOpen(self, dir):
        return None


            

Reported by Pylint.

Unused argument 'dir'
Error

Line: 57 Column: 35

                  def close_conn(self):
        return None

    def setUpConnectionOpen(self, dir):
        return None

    def openConnections(
            self,
            connections,

            

Reported by Pylint.

Parameters differ from overridden 'setUpConnectionOpen' method
Error

Line: 57 Column: 5

                  def close_conn(self):
        return None

    def setUpConnectionOpen(self, dir):
        return None

    def openConnections(
            self,
            connections,

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 57 Column: 35

                  def close_conn(self):
        return None

    def setUpConnectionOpen(self, dir):
        return None

    def openConnections(
            self,
            connections,

            

Reported by Pylint.

Attribute 'conns' defined outside __init__
Error

Line: 67 Column: 13

                          extra_opts = '',
            add=0):
        if add == 0:
            self.conns = []
            self.sessions = []
        # Open the set of connections.
        for name in connections:
            shutil.rmtree(name, True)
            os.mkdir(name)

            

Reported by Pylint.

Attribute 'sessions' defined outside __init__
Error

Line: 68 Column: 13

                          add=0):
        if add == 0:
            self.conns = []
            self.sessions = []
        # Open the set of connections.
        for name in connections:
            shutil.rmtree(name, True)
            os.mkdir(name)
            next_conn =  self.wiredtiger_open(

            

Reported by Pylint.

Attribute 'conns' defined outside __init__
Error

Line: 84 Column: 9

                  def closeConnections(self):
        for tmp_conn in self.conns:
            tmp_conn.close()
        self.conns = []
        self.sessions = [] # Implicitly closed when closing sessions.

    # Basic test of shared cache
    def test_shared_cache_basic(self):
        nops = 1000

            

Reported by Pylint.

Attribute 'sessions' defined outside __init__
Error

Line: 85 Column: 9

                      for tmp_conn in self.conns:
            tmp_conn.close()
        self.conns = []
        self.sessions = [] # Implicitly closed when closing sessions.

    # Basic test of shared cache
    def test_shared_cache_basic(self):
        nops = 1000
        self.openConnections(['WT_TEST1', 'WT_TEST2'])

            

Reported by Pylint.

Unused variable 'nops'
Error

Line: 162 Column: 9

              
    # Opening a connection with absolute values for eviction config should fail
    def test_shared_cache_absolute_evict_config(self):
        nops = 1000
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.openConnections(['WT_TEST1', 'WT_TEST2'],
            pool_opts = ',shared_cache=(name=pool,size=50M,reserve=20M),'
            'eviction_target=10M,'), '/Shared cache configuration requires a '
            'percentage value for eviction target/')

            

Reported by Pylint.