1. 04 Jul, 2020 1 commit
    • Marko Mäkelä's avatar
      Fixup the parent commit for MSAN and Valgrind · 453dc4b3
      Marko Mäkelä authored
      commit 48493132 was a necessary
      fix for the buffer pool resizing tests in 10.5 in
      AddressSanitizer. However, that change would break the tests
      innodb.innodb_buffer_pool_resize and
      innodb.innodb_buffer_pool_resize_with_chunks
      when run in MemorySanitizer, or presumably in Valgrind as well.
      (Those tests run "forever" in Valgrind.)
      
      buf_pool_resize(): Cancel the effect of MEM_NOACCESS() in Valgrind
      and ASAN. In MSAN, MEM_NOACCESS() is a no-op, and hence we must do
      nothing special here.
      
      MEM_MAKE_ADDRESSABLE() would declare the memory contents undefined.
      In this particular case, we must actually declare the contents
      defined for Valgrind.
      453dc4b3
  2. 03 Jul, 2020 1 commit
  3. 02 Jul, 2020 11 commits
  4. 01 Jul, 2020 11 commits
    • Marko Mäkelä's avatar
      MDEV-20377: Fix -Wunused-but-set-variable · 69df4f83
      Marko Mäkelä authored
      69df4f83
    • Vladislav Vaintroub's avatar
      MDEV-23067 Windows : manually registered services rejected mysql_upgrade_service · 41b0d98e
      Vladislav Vaintroub authored
      - service not using "--defaults-file" can have any name not just "MySQL"
      - service with "--defaults-file", without datadir in them
      use default datadir (install_root\data)
      41b0d98e
    • Marko Mäkelä's avatar
      be517384
    • Marko Mäkelä's avatar
      MDEV-20377: Make WITH_MSAN more usable · c36834c8
      Marko Mäkelä authored
      MemorySanitizer (clang -fsanitize=memory) requires that all code
      be compiled with instrumentation enabled. The only exception is the
      C runtime library. Failure to use instrumented libraries will cause
      bogus messages about memory being uninitialized.
      
      In WITH_MSAN builds, we must avoid calling getservbyname(),
      because even though it is a standard library function, it is
      not instrumented, not even in clang 10.
      
      Note: Before MariaDB Server 10.5, ./mtr will typically fail
      due to the old PCRE library, which was updated in MDEV-14024.
      
      The following cmake options were tested on 10.5
      in commit 94d0bb4d:
      
      cmake \
      -DCMAKE_C_FLAGS='-march=native -O2' \
      -DCMAKE_CXX_FLAGS='-stdlib=libc++ -march=native -O2' \
      -DWITH_EMBEDDED_SERVER=OFF -DWITH_UNIT_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug \
      -DWITH_INNODB_{BZIP2,LZ4,LZMA,LZO,SNAPPY}=OFF \
      -DPLUGIN_{ARCHIVE,TOKUDB,MROONGA,OQGRAPH,ROCKSDB,CONNECT,SPIDER}=NO \
      -DWITH_SAFEMALLOC=OFF \
      -DWITH_{ZLIB,SSL,PCRE}=bundled \
      -DHAVE_LIBAIO_H=0 \
      -DWITH_MSAN=ON
      
      MEM_MAKE_DEFINED(): An alias for VALGRIND_MAKE_MEM_DEFINED()
      and __msan_unpoison().
      
      MEM_GET_VBITS(), MEM_SET_VBITS(): Aliases for
      VALGRIND_GET_VBITS(), VALGRIND_SET_VBITS(), __msan_copy_shadow().
      
      InnoDB: Replace the UNIV_MEM_ macros with corresponding MEM_ macros.
      
      ut_crc32_8_hw(), ut_crc32_64_low_hw(): Use the compiler built-in
      functions instead of inline assembler when building WITH_MSAN.
      This will require at least -msse4.2 when building for IA-32 or AMD64.
      The inline assembler would not be instrumented, and would thus cause
      bogus failures.
      c36834c8
    • Sergei Golubchik's avatar
      MDEV-21222 mariabackup.incremental_backup failed with memory allocation failure · 5a097c55
      Sergei Golubchik authored
      mariabackup tries to allocate a buffer of page_size*page_size/4 size.
      for 64k page it means 1Gb, which doesn't work very well on 32-bit builders.
      
      Skip the 64k page test on 32bit.
      5a097c55
    • Marko Mäkelä's avatar
      9ed50ece
    • Vladislav Vaintroub's avatar
      MDEV-23052 mysql_install_db.exe can run on existing non-empty directory, · fe05c16c
      Vladislav Vaintroub authored
      and remove it on error
      
      Disable existing non-empty datadir for mysql_install_db.exe
      fe05c16c
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · ea2bc974
      Marko Mäkelä authored
      ea2bc974
    • Sergei Golubchik's avatar
      make rocksdb cmake checks less verbose on repeat · 6d3747a2
      Sergei Golubchik authored
      * fix FindLZ4 to follow convention (LIBRARIES, not LIBRARY)
      * remove redundant checks from rocksdb/CMakeLists.txt
      * put all checks through the same macro that uniformly
        checks for a package, prints the message, adds definition
      6d3747a2
    • Otto Kekäläinen's avatar
      Fix RocksDB detection of ZSTD · 2ed41576
      Otto Kekäläinen authored
      The library finder needs to have capitals in its name so that FIND_PACKAGE
      will load the correct finder and actually detect that libzstd is available.
      
      Without this change the CMake would just always silently skip ZSTD since
      it would never find it.
      
      Simplify Debian autopkgtest RocksDB part and make it more verbose so that
      future regressions like this are easier to debug.
      
      Also remove QUIET from the RocksDB FIND_PACKAGE call so that it is easier
      to read in build logs what libraries were detected. Also add missing
      underscores to error messages.
      2ed41576
    • Varun Gupta's avatar
      MDEV-22852: SIGSEGV in sortlength (optimized builds) · fbfb5b5f
      Varun Gupta authored
      The issue here is for a DEPENDENT subquery that has an aggregate function in the ORDER BY clause,
      is wrapped inside an Item_aggregate_ref. For computation of ORDER BY we need to refer to the
      temp table field corresponding to this item. But in the function make_sortorder, we were
      explicitly casting Item_aggrgate_ref to Item_sum, which leads to us not getting the temp
      table field corresponding to the item.
      fbfb5b5f
  5. 30 Jun, 2020 3 commits
  6. 29 Jun, 2020 1 commit
  7. 27 Jun, 2020 5 commits
    • Varun Gupta's avatar
      MDEV-17606: Query returns wrong results (while using CHARACTER SET utf8) · 37cb7a00
      Varun Gupta authored
      The issue here was that the left expr and right expr of the ANY subquery
      had different character sets, so we were converting the left expr to utf8 character set.
      So when this conversion was happening we were actually converting the item inside the cache,
      it looked like <cache>(convert(t1.l1 using utf8)), which is incorrect.
      To fix this problem we are going to store the reference of the left expr and convert that
      to utf8 character set, it would look like convert(<cache>(`test`.`t1`.`l1`) using utf8)
      37cb7a00
    • Kentoku SHIBA's avatar
      MDEV-18993 The keep-alive connection (set spider_conn_recycle_mode = 1) in... · c032c2ef
      Kentoku SHIBA authored
      MDEV-18993 The keep-alive connection (set spider_conn_recycle_mode = 1) in spider would cause cash in MariaDB (#1269)
      
      Fix the following valgrind error.
      
      ==94390== Thread 29:
      ==94390== Invalid read of size 8
      ==94390== at 0x78389D: thd_increment_bytes_sent (sql_class.cc:4265)
      ==94390== by 0xC8EC46: net_real_write (net_serv.cc:730)
      ==94390== by 0xC8E0C8: net_flush (net_serv.cc:383)
      ==94390== by 0xC8E4D0: net_write_command (net_serv.cc:521)
      ==94390== by 0xADCE61: cli_advanced_command (client.c:468)
      ==94390== by 0xAE3CAF: mysql_close_slow_part (client.c:3671)
      ==94390== by 0xAE3D28: mysql_close (client.c:3683)
      ==94390== by 0x149E69A8: spider_db_mbase::disconnect() (spd_db_mysql.cc:2217)
      ==94390== by 0x1491EA26: spider_db_disconnect(st_spider_conn*) (spd_db_conn.cc:297)
      ==94390== by 0x14948EBE: spider_free_conn_alloc(st_spider_conn*) (spd_conn.cc:196)
      ==94390== by 0x1494B26A: spider_free_conn(st_spider_conn*) (spd_conn.cc:1251)
      ==94390== by 0x1494941F: spider_free_conn_from_trx(st_spider_transaction*, st_spider_conn*, bool, bool, int*) (spd_conn.cc:315)
      ==94390== Address 0x1f0e0990 is 4,832 bytes inside a block of size 25,728 free'd
      ==94390== at 0x4C2ACBD: free (vg_replace_malloc.c:530)
      ==94390== by 0x13F5545: my_free (my_malloc.c:222)
      ==94390== by 0x6C75B7: ilink::operator delete(void*, unsigned long) (sql_list.h:618)
      ==94390== by 0x77B9F6: THD::~THD() (sql_class.cc:1724)
      ==94390== by 0x1494FCE0: spider_bg_conn_action(void*) (spd_conn.cc:2580)
      ==94390== by 0x4E3DDD4: start_thread (in /usr/lib64/libpthread-2.17.so)
      ==94390== by 0x5FBFEAC: clone (in /usr/lib64/libc-2.17.so)
      ==94390== Block was alloc'd at
      ==94390== at 0x4C29BC3: malloc (vg_replace_malloc.c:299)
      ==94390== by 0x13F4DFA: my_malloc (my_malloc.c:101)
      ==94390== by 0x1491CF06: ilink::operator new(unsigned long) (sql_list.h:614)
      ==94390== by 0x1494F7FD: spider_bg_conn_action(void*) (spd_conn.cc:2501)
      ==94390== by 0x4E3DDD4: start_thread (in /usr/lib64/libpthread-2.17.so)
      ==94390== by 0x5FBFEAC: clone (in /usr/lib64/libc-2.17.so)
      ==94390== Invalid write of size 8
      ==94390== at 0x7838AF: thd_increment_bytes_sent (sql_class.cc:4265)
      ==94390== by 0xC8EC46: net_real_write (net_serv.cc:730)
      ==94390== by 0xC8E0C8: net_flush (net_serv.cc:383)
      ==94390== by 0xC8E4D0: net_write_command (net_serv.cc:521)
      ==94390== by 0xADCE61: cli_advanced_command (client.c:468)
      ==94390== by 0xAE3CAF: mysql_close_slow_part (client.c:3671)
      ==94390== by 0xAE3D28: mysql_close (client.c:3683)
      ==94390== by 0x149E69A8: spider_db_mbase::disconnect() (spd_db_mysql.cc:2217)
      ==94390== by 0x1491EA26: spider_db_disconnect(st_spider_conn*) (spd_db_conn.cc:297)
      ==94390== by 0x14948EBE: spider_free_conn_alloc(st_spider_conn*) (spd_conn.cc:196)
      ==94390== by 0x1494B26A: spider_free_conn(st_spider_conn*) (spd_conn.cc:1251)
      ==94390== by 0x1494941F: spider_free_conn_from_trx(st_spider_transaction*, st_spider_conn*, bool, bool, int*) (spd_conn.cc:315)
      ==94390== Address 0x1f0e0990 is 4,832 bytes inside a block of size 25,728 free'd
      ==94390== at 0x4C2ACBD: free (vg_replace_malloc.c:530)
      ==94390== by 0x13F5545: my_free (my_malloc.c:222)
      ==94390== by 0x6C75B7: ilink::operator delete(void*, unsigned long) (sql_list.h:618)
      ==94390== by 0x77B9F6: THD::~THD() (sql_class.cc:1724)
      ==94390== by 0x1494FCE0: spider_bg_conn_action(void*) (spd_conn.cc:2580)
      ==94390== by 0x4E3DDD4: start_thread (in /usr/lib64/libpthread-2.17.so)
      ==94390== by 0x5FBFEAC: clone (in /usr/lib64/libc-2.17.so)
      ==94390== Block was alloc'd at
      ==94390== at 0x4C29BC3: malloc (vg_replace_malloc.c:299)
      ==94390== by 0x13F4DFA: my_malloc (my_malloc.c:101)
      ==94390== by 0x1491CF06: ilink::operator new(unsigned long) (sql_list.h:614)
      ==94390== by 0x1494F7FD: spider_bg_conn_action(void*) (spd_conn.cc:2501)
      ==94390== by 0x4E3DDD4: start_thread (in /usr/lib64/libpthread-2.17.so)
      ==94390== by 0x5FBFEAC: clone (in /usr/lib64/libc-2.17.so)
      c032c2ef
    • Eugene Kosov's avatar
      MDEV-19298 Assertion `space->id != 0xFFFFFFFEU || space ==... · e4cff9a8
      Eugene Kosov authored
      MDEV-19298 Assertion `space->id != 0xFFFFFFFEU || space == fil_system.temp_space' failed in Check::validate upon crash upgrade from 10.2.22
      
      This issue is pretty much the same as MDEV-20213.
      The fix is similar to:
      3c238ac5
      52c4abbf
      
      Check::validate(): fix a debug assertion
      
      SysTablespace::open_or_create(): protect assigning to a shared
      variable with a mutex
      e4cff9a8
    • Eugene Kosov's avatar
      MDEV-20213 binlog_encryption.binlog_incident failed in buildbot, server crashed in Check::validate · 52c4abbf
      Eugene Kosov authored
      follow up
      
      fil_system.sys_space is a shared variable between the thread
      which assigns a value to it, and the thread which does Check::validate()
      
      SysTablespace::open_or_create(): protect a shared variable with
      a mutex to avoid any data race surprises.
      52c4abbf
    • Eugene Kosov's avatar
      MDEV-20213 binlog_encryption.binlog_incident failed in buildbot, server crashed in Check::validate · 3c238ac5
      Eugene Kosov authored
      Check::validate(): Relax a debug assertion. TRX_SYS_SPACE fil_space_t
      can be created and became visible to this assertion before
      fil_system.sys_space becomes initialized
      3c238ac5
  8. 25 Jun, 2020 4 commits
    • Sujatha's avatar
      MDEV-22806: MSAN reports use-of-uninitialized-value for rpl_parallel_conflicts.test · 3bc89395
      Sujatha authored
      Problem:
      ========
      Relay_log_info::flush reports following MSAN issue.
      ==17820==WARNING: MemorySanitizer: use-of-uninitialized-value is reported
      #5  0x00005584f0981441 in my_write (Filedes=22,
      Buffer=0x72500003e818 "5\n./slave-relay-bin.000003\n21385\n
      master-bin.000001\n21643\n0\n", '\245' <repeats 141 times>..., Count=118,
      MyFlags=532) at /home/sujatha/bug_repo/test-10.5-msan/mysys/my_write.c:49
      
      Analysis:
      =========
      In parallel replication at the end of each statement execution the worker execution
      status is updated in 'relay-log.info' file. When two workers try to flush
      the status at the same time, since the write to cache is not serialized both
      workers write to the same address simultaneously and increment the
      length twice. Because of this the length of buffer is more than actual data.
      When flush code tries to read the buffer beyond valid data length MSAN
      reports uninitialized values error.
      
      Fix:
      ===
      Serialize the relay log flush operation using "rli->data_lock".
      3bc89395
    • Julius Goryavsky's avatar
    • Vladislav Vaintroub's avatar
      MDEV-22950 followup · 7ee6a3ae
      Vladislav Vaintroub authored
      Deadlock in DbugParse, on Linux.
      
      In 10.1, DBUG recursive mutex was improperly implemented.
      CODE_STATE::locked counter was never updated.
      
      Copy the code around LockMutex/UnlockMutex from 10.2
      7ee6a3ae
    • Sujatha's avatar
      MDEV-22706: Assertion `!current' failed in PROFILING::start_new_query · f1838434
      Sujatha authored
      Analysis:
      ========
      When "Profiling" is enabled, server collects the resource usage of each
      statement that gets executed in current session. Profiling doesn't support
      nested statements. In order to ensure this behavior when profiling is enabled
      for a statement, there should not be any other active query which is being
      profiled. This active query information is stored in 'current' variable. When
      a nested query arrives it finds 'current' being not NULL and server aborts.
      
      When 'init_connect' and 'init_slave' system variables are set they contain a
      set of statements to be executed. "execute_init_command" is the function call
      which invokes "dispatch_command" for each statement provided in
      'init_connect', 'init_slave' system variables. "execute_init_command" invokes
      "start_new_query" and it passes the statement list to "dispatch_command". This
      "dispatch_command" intern invokes "start_new_query" which leads to nesting of
      queries. Hence '!current' assert is triggered.
      
      Fix:
      ===
      Remove profiling from "execute_init_command" as it will be done within
      "dispatch_command" execution.
      f1838434
  9. 24 Jun, 2020 3 commits