Skip to content
Snippets Groups Projects
  1. Nov 21, 2024
    • Andrey Saranchin's avatar
      sql: do not use raw index for count · 1b12f241
      Andrey Saranchin authored
      Currently, we use raw index for count operation instead of
      `box_index_count`. As a result, we skip a check if current transaction
      can continue and we don't begin transaction in engine if needed. So, if
      count statement is the first in a transaction, it won't be tracked by
      MVCC since it wasn't notified about the transaction. The commit fixes
      the mistake. Also, the commit adds a check if count was successful and
      covers it with a test.
      
      In order to backport the commit to 2.11, space name was wrapped with
      quotes since it is in lower case and addressing such spaces with SQL
      without quotes is Tarantool 3.0 feature. Another unsupported feature is
      prohibition of data access in transactional triggers - it was used in a
      test case so it was rewritten.
      
      Closes #10825
      
      NO_DOC=bugfix
      
      (cherry picked from commit 0656a9231149663a0f13c4be7466d4776ccb0e66)
      1b12f241
  2. Nov 12, 2024
    • Vladimir Davydov's avatar
      test: reduce dump count in vinyl-luatest/select_consistency_test · a2cc2b00
      Vladimir Davydov authored
      The test expects at least 10 dumps to be created in 60 seconds. It
      usually works but sometimes, when the host is heavy loaded, Vinyl
      doesn't produce enough dumps in time and fails the test. On CI the test
      usually fails with 7-9 dumps. To avoid flaky failures, let's reduce the
      expected dump count down to 5.
      
      Closes #10752
      
      NO_DOC=test fix
      NO_CHANGELOG=test fix
      
      (cherry picked from commit 5325abd3441ecb4b589799c32ec181d88724b8a8)
      a2cc2b00
    • Vladimir Davydov's avatar
      vinyl: fix duplicate multikey stmt accounting with deferred deletes · 26a3c8cf
      Vladimir Davydov authored
      `vy_mem_insert()` and `vy_mem_insert_upsert()` increment the row count
      statistic of `vy_mem` only if no statement is replaced, which is
      correct, while `vy_lsm_commit()` increments the row count of `vy_lsm`
      unconditionally. As a result, `vy_lsm` may report a non-zero statement
      count (via `index.stat()` or `index.len()`) after a dump. This may
      happen only with a non-unique multikey index, when the statement has
      duplicates in the indexed array, and only if the `deferred_deletes`
      option is enabled, because otherwise we drop duplicates when we form
      the transaction write set, see `vy_tx_set()`. With `deferred_deletes`,
      we may create a `txv` for each multikey entry at the time when we
      prepare to commit the transaction, see `vy_tx_handle_deferred_delete()`.
      
      Another problem is that `vy_mem_rollback_stmt()` always decrements
      the row count, even if it didn't find the rolled back statement in
      the tree. As a result, if the transaction with duplicate multikey
      entries is rolled back on WAL error, we'll decrement the row count
      of `vy_mem` more times than necessary.
      
      To fix this issue, let's make the `vy_mem` methods update the in-memory
      statistic of `vy_lsm`. This way they should always stay in-sync. Also,
      we make `vy_mem_rollback_stmt()` skip updating the statistics in case
      the rolled back statement isn't present in the tree.
      
      This issue results in `vinyl-luatest/select_consistency_test.lua`
      flakiness when checking `index.len()` after compaction. Let's make
      the test more thorough and also check that `index.len()` equals
      `index.count()`.
      
      Closes #10751
      Part of #10752
      
      NO_DOC=bug fix
      
      (cherry picked from commit e8810c555d4e6ba56e6c798e04216aa11efb5304)
      26a3c8cf
  3. Nov 07, 2024
    • Nikita Zheleztsov's avatar
      upgrade: fix upgrading from schema 1.6.9 · 4e4d4bc1
      Nikita Zheleztsov authored
      This commit fixes some cases of upgrading schema from 1.6.9:
      
      1. Fix updating empty password for users. In 1.6 credentials were array
         in _user, in 1.7.5 they became map.
      
      2. Automatically update the format of user spaces. Format of system
         spaces have been properly fixed during upgrade to 1.7.5. However,
         commit 519bc82e ("Parse and validate space formats") introduced
         strict checking of format field in 1.7.6. So, the format of user
         spaces should be also fixed.
      
      Back in 1.6 days, it was allowed to write anything in space format.
      This commit only fixes valid uses of format:
          {name = 'a', type = 'number'}
          {'a', type = 'number'}
          {'a', 'num'}
          {'a'}
      
      Invalid use of format (e.g. {{}}, or {{5, 'number'}} will cause error
      anyway. User has to fix the format on old version and only after that
      start a new one.
      
      This commit also introduces the test, which checks, that we can
      properly upgrade from 1.6.9 to the latest versions, at least in basic
      cases.
      
      Closes #10180
      
      NO_DOC=bugfix
      
      (cherry picked from commit f69e2ae488b3620e31f1a599d8fb78a66917dbfd)
      4e4d4bc1
  4. Nov 01, 2024
    • Vladimir Davydov's avatar
      test: bump test-run to new version · 28158090
      Vladimir Davydov authored
      Bump test-run to new version with the following improvements:
      
      - Fix a typo [1]
      - Follow-up fix for parsing non-utf8 chars (part 2) [2]
      - Bump luatest to 1.0.1-33-g7dc5cb7 [3]
      
      [1] tarantool/test-run@5d9630b
      [2] tarantool/test-run@7acc532
      [3] tarantool/test-run@dc2382c
      
      NO_DOC=test
      NO_TEST=test
      NO_CHANGELOG=test
      
      (cherry picked from commit 0afc7e0b8a57678c589a2e9de6785d99f17e30eb)
      28158090
    • Andrey Saranchin's avatar
      memtx: fix use-after-free on background index build · a4456c10
      Andrey Saranchin authored
      When building an index in background, we create on_rollback triggers for
      tuples inserted concurrently. The problem here is on_rollback trigger
      has independent from `index` and `memtx_ddl_state` lifetime - it can be
      called after the index was build (and `memtx_ddl_state` is destroyed)
      and even after the index was altered. So, in order to avoid
      use-after-free in on_rollback trigger, let's drop all on_rollback
      triggers when the DDL is over. It's OK because all owners of triggers
      are already prepared, hence, in WAL or replication queue (since we
      build indexes in background only without MVCC so the transactions cannot
      yield), so if they are rolled back, the same will happen to the DDL.
      
      In order to delete on_rollback triggers, we should collect them into a
      list in `memtx_ddl_state`. On the other hand, when the DML statement is
      over (committed or rolled back), we should delete its trigger from the
      list to prevent use-after-free. That's why the commit adds the on_commit
      trigger to background build process.
      
      Closes #10620
      
      NO_DOC=bugfix
      
      (cherry picked from commit d8d82dba4c884c3a7ad825bd3452d35627c7dbf4)
      a4456c10
    • Yaroslav Lobankov's avatar
      test: use `justrun` module from luatest · f0bcd78b
      Yaroslav Lobankov authored
      NO_DOC=test
      NO_TEST=test
      NO_CHANGELOG=test
      
      (cherry picked from commit 90d197ded13d49dfc405ff80bbd183b2e260dc56)
      f0bcd78b
    • Yaroslav Lobankov's avatar
      test: use `treegen` module from luatest · e8b0dcf6
      Yaroslav Lobankov authored
      Also, adapt tests and helpers in accordance with the module interface.
      
      NO_DOC=test
      NO_TEST=test
      NO_CHANGELOG=test
      
      (cherry picked from commit bd27df009c403e89c003d5b66763c0f0bbf08440)
      e8b0dcf6
    • Yaroslav Lobankov's avatar
      test: bump test-run to new version · 3badd27f
      Yaroslav Lobankov authored
      Bump test-run to new version with the following improvements:
      
      - ignore local lsn in wait_cluster_vclock [1]
      - Bump luatest to 1.0.1-20-ga978383 [2]
      - Bump luatest to 1.0.1-22-g39da6d2 [3]
      
      [1] tarantool/test-run@f23b535
      [2] tarantool/test-run@274e4f3
      [3] tarantool/test-run@d04c595
      
      NO_DOC=test
      NO_TEST=test
      NO_CHANGELOG=test
      
      (cherry picked from commit beba449a5f04e02fb77ca676663b1836e0490c3d)
      3badd27f
    • Serge Petrenko's avatar
      test: bump test-run to new version · 64bbd9e2
      Serge Petrenko authored
      Bump test-run to new version with the following improvements:
      
      - Follow-up fix for parsing non-utf8 chars [1]
      
      [1] tarantool/test-run@52d3e4f
      
      NO_CHANGELOG=test
      NO_TEST=test
      NO_DOC=test
      
      (cherry picked from commit e01c20edc31b65e020ac57e3f62a7427b6e27d53)
      64bbd9e2
    • Serge Petrenko's avatar
      test: fix several more tests after the luatest bump · 9dfd78d8
      Serge Petrenko authored
      The test gh_10088 was committed in parallel with the luatest bump and
      thus slipped from the post-bump tests fixup in commit cfd4bf46
      ("test: adapt tests to the new luatest version"). Fix it now.
      
      Also tests gh_6539 and gh_7231 queried `box.cfg.log` wrongly, but this
      didn't make them fail, they just stopped testing what they were supposed
      to. Fix them as well
      
      NO_CHANGELOG=test
      NO_TEST=test
      NO_DOC=test
      
      (cherry picked from commit 2a18de391895d8ec7a39e3d3dcee659fe79f7bc9)
      9dfd78d8
    • Oleg Chaplashkin's avatar
      test: adapt tests to the new luatest version · 3d80ea0e
      Oleg Chaplashkin authored
      With the new version of Luatest you have to be careful with the server
      log file. We used to get it very simply:
      
          box.cfg.log
      
      Now it is more correct to use the following approach:
      
          rawget(_G, 'box_cfg_log_file') or box.cfg.log
      
      Closes tarantool/test-run#439
      
      NO_DOC=test
      NO_TEST=test
      NO_CHANGELOG=test
      
      (cherry picked from commit cfd4bf46)
      3d80ea0e
    • Nikita Zheleztsov's avatar
      test: bump test-run to new version · 098397e3
      Nikita Zheleztsov authored
      Bump test-run to new version with the following improvements:
      
      - luatest: fix ability to run a test several times [1]
      - Enable luatest logging [2]
      - tap13: fix parsing non-utf8 chars [3]
      
      [1] tarantool/test-run@240cdea
      [2] tarantool/test-run@b8b60b4
      [3] tarantool/test-run@7290540
      
      NO_DOC=test
      NO_TEST=test
      NO_CHANGELOG=test
      
      (cherry picked from commit 59ba2131)
      098397e3
  5. Oct 31, 2024
    • Andrey Saranchin's avatar
      luafun: bump submodule · 58f3e1df
      Andrey Saranchin authored
      The commit bumps luafun to the new version with a bunch of bugfixes:
      * Now `chain` works correctly with iterators without `param`.
      * Now `drop_while` supports stateful iterators.
      * The module is populated with missing `maximum_by` alias of `max_by`.
      * Now `nth` and `length` work correctly with other luafun iterators.
      
      Since our index iterators are stateful (can return different values
      with the same `state` passed), the old `drop_while` implementation
      didn't work well with them - it was skipping an extra element.
      The bump resolves this issue.
      
      Note that there are still methods that don't work correctly with
      `index:pairs` - `cycle`, `head` and `is_null`.
      
      Closes #6403
      
      NO_DOC=bugfix
      
      (cherry picked from commit ec758869f8364624efaff58bdd4ebc7c133ede0a)
      58f3e1df
  6. Oct 30, 2024
    • Sergey Bronnikov's avatar
      cmake: fix build with GCC's UBSan · e13c7ed2
      Sergey Bronnikov authored
      GNU GCC compiler has UndefinedBehaviour sanitizer support since
      4.9.0 [1], but it was unsupported in tarantool's build. The patch
      fixes a build by GNU GCC with enabled UBSan.
      
      1. https://gcc.gnu.org/gcc-4.9/changes.html
      
      NO_CHANGELOG=build
      NO_DOC=build
      NO_TEST=build
      
      (cherry picked from commit 511e0f50e4b817d576ef4001611fba718ef1bdae)
      e13c7ed2
    • Sergey Bronnikov's avatar
      cmake: enable UBSan check signed-integer-overflow · 2f28137b
      Sergey Bronnikov authored
      The patch enable UBsan check signed-integer-overflow that was
      disabled globally in commit 5115d9f3
      ("cmake: split UB sanitations into separate flags.") and disable
      it for a several functions inline.
      
      See also #10703
      See also #10704
      Closes #10228
      
      NO_CHANGELOG=codehealth
      NO_DOC=codehealth
      NO_TEST=codehealth
      
      (cherry picked from commit 60ba7fb4c0038d9d17387f7ce9755eb587ea1da4)
      2f28137b
    • Sergey Bronnikov's avatar
      cmake: enable UBsan checks · 31b7fd60
      Sergey Bronnikov authored
      The following UBSan checks have been enabled back:
      
      - vptr
      - implicit-signed-integer-truncation
      - implicit-integer-sign-change
      - nullability-arg
      - nullability-assign
      - nullability-return
      - returns-nonnull-attribute
      
      These checks doesn't trigger errors anymore and no sense to keep
      them disabled.
      
      Part of #10228
      Related to #10741
      Related to #10740
      
      NO_CHANGELOG=codehealth
      NO_DOC=codehealth
      NO_TEST=codehealth
      
      (cherry picked from commit e65b63df7f5a8a628cd9a9bbc6a1bdecec8c9959)
      31b7fd60
    • Sergey Bronnikov's avatar
      cmake: replace UBsan flags whitelist by blacklist · f3d27729
      Sergey Bronnikov authored
      The commit 366cb668 ("cmake: add option ENABLE_UB_SANITIZER")
      added UndefinedBehaviour sanitizer support with the whitelist of
      checks (all checks are disabled and a several checks are
      enabled). The patch replaces the whitelist by blacklist (all
      checks are enabled and a several checks are disabled).
      
      Part of #10228
      Related to #10742
      
      NO_CHANGELOG=codehealth
      NO_DOC=codehealth
      NO_TEST=codehealth
      
      (cherry picked from commit 2125a4304844669884bfa887657fd20f15504a5a)
      f3d27729
  7. Oct 28, 2024
    • Andrey Saranchin's avatar
      memtx: clarify tuples against given index in memtx_tx_snapshot_cleaner · c5b11266
      Andrey Saranchin authored
      Currently, we create `memtx_tx_snapshot_cleaner` for each index in read
      view. However, we somewhy clarify all tuples against primary index in
      all cleaners. As a result, secondary indexes work incorrectly in read
      view when MVCC is enabled, we may even get a tuple with one key, but
      a tuple with another key will be returned because it is clarified
      against primary index and repsects its order - that's wrong because
      all indexes have its own orders. Let's clarify tuples against given
      index to fix this mistake.
      
      Community Edition is not affected at all since it uses read view only
      for making a snapshot - we use only primary indexes there.
      
      Part of tarantool/tarantool-ee#939
      
      NO_TEST=in EE
      NO_CHANGELOG=in EE
      NO_DOC=bugfix
      
      (cherry picked from commit 835fadd)
      c5b11266
  8. Oct 23, 2024
    • Nikolay Shirokovskiy's avatar
      box: build fix · 312dbf07
      Nikolay Shirokovskiy authored
      I got compile error for release build on gcc 14.2.1 20240910 version.
      
      ```
      In function ‘char* mp_store_double(char*, double)’,
          inlined from ‘char* mp_encode_double(char*, double)’ at /home/shiny/dev/tarantool-ee/tarantool/src/lib/msgpuck/msgpuck.h:2409:24,
          inlined from ‘uint32_t tuple_hash_field(uint32_t*, uint32_t*, const char**, field_type, coll*)’ at /home/shiny/dev/tarantool-ee/tarantool/src/box/tuple_hash.cc:317:46:
      /home/shiny/dev/tarantool-ee/tarantool/src/lib/msgpuck/msgpuck.h:340:16: error: ‘value’ may be used uninitialized [-Werror=maybe-uninitialized]
        340 |         cast.d = val;
            |         ~~~~~~~^~~~~
      /home/shiny/dev/tarantool-ee/tarantool/src/box/tuple_hash.cc: In function ‘uint32_t tuple_hash_field(uint32_t*, uint32_t*, const char**, field_type, coll*)’:
      /home/shiny/dev/tarantool-ee/tarantool/src/box/tuple_hash.cc:311:24: note: ‘value’ was declared here
        311 |                 double value;
            |
      ```
      
      NO_TEST=build fix
      NO_CHANGELOG=build fix
      NO_DOC=build fix
      
      (cherry picked from commit 1129c758d0e3bd86eec89e5229eac3f99155d8ac)
      312dbf07
  9. Oct 18, 2024
    • Sergey Kaplun's avatar
      luajit: bump new version · 4019956f
      Sergey Kaplun authored
      * Fix typo.
      * OSX/iOS: Always generate 64 bit non-FAT Mach-O object files.
      * test: don't run JIT-based LuaJIT tests without JIT
      * test: actualize <LuaJIT-tests/README.md>
      * test: enable <misc/alias_alloc.lua> LuaJIT test
      * test: refactor <alias_alloc.lua> LuaJIT test
      * test: refactor <lang/coroutine.lua> LuaJIT test
      * test: remove <misc/coro_yield.lua> LuaJIT test
      * test: enable <misc/debug_gc.lua> LuaJIT test
      * test: enable <misc/dualnum.lua> LuaJIT test
      * test: refactor <lang/dualnum.lua> LuaJIT test
      * test: remove <misc/fori_coerce.lua> LuaJIT test
      * test: remove <misc/fori_dir.lua> LuaJIT test
      * test: remove <misc/gc_rechain.lua> LuaJIT test
      * test: enable <misc/gc_trace.lua> LuaJIT test
      * test: refactor <trace/gc.lua> LuaJIT test
      * test: enable <misc/gcstep.lua> LuaJIT test
      * test: enable <misc/hook_active.lua> LuaJIT test
      * test: enable <misc/hook_line.lua> LuaJIT test
      * test: enable <misc/hook_norecord.lua> LuaJIT test
      * test: enable <misc/hook_record.lua> LuaJIT test
      * test: enable <misc/hook_top.lua> LuaJIT test
      * test: enable <misc/jit_flush.lua> LuaJIT test
      * test: remove <misc/loop_unroll.lua> LuaJIT test
      * test: enable <misc/parse_comp.lua> LuaJIT test
      * test: enable <misc/parse_esc.lua> LuaJIT test
      * test: enable <misc/parse_misc.lua> LuaJIT test
      * test: enable <misc/phi_conv.lua> LuaJIT test
      * test: refactor <trace/phi/conv.lua> LuaJIT test
      * test: enable <misc/recurse_deep.lua> LuaJIT test
      * test: remove <misc/recurse_tail.lua> LuaJIT test
      * test: enable <misc/stack_gc.lua> LuaJIT test
      * test: refactor <lang/gc_stack.lua> LuaJIT test
      * test: enable <misc/stack_purge.lua> LuaJIT test
      * test: refactor <trace/stack_purge.lua> LuaJIT test
      * test: enable <misc/stackov.lua> LuaJIT test
      * test: enable <misc/stackovc.lua> LuaJIT test
      * test: enable <misc/tcall_base.lua> LuaJIT test
      * test: refactor <trace/tcall_base.lua> LuaJIT test
      * test: enable <misc/tcall_loop.lua> LuaJIT test
      * test: enable <misc/tonumber_scan.lua> LuaJIT test
      * test: remove <misc/uclo.lua> LuaJIT test
      * test: enable <misc/unordered_jit.lua> LuaJIT test
      * test: enable <misc/wbarrier.lua> LuaJIT test
      * test: enable <misc/wbarrier_jit.lua> LuaJIT test
      * test: enable <misc/wbarrier_obar.lua> LuaJIT test
      * test: update <LuaJIT-tests/README.md>
      * test: off JIT for routines in <lang/stackov.lua>
      * Limit number of string format elements to compile.
      * Clear stack after print_jit_status() in CLI.
      * FFI: Workaround for platform dlerror() returning NULL.
      * test: move profilers tests to subdirectory
      * test: rename <arm64-ccall-fp-convention.test.lua>
      * cmake: introduce AppendTestEnvVar macro
      * test: shrink LUA_PATH environment variable
      * test: shrink LUA_CPATH and {DY}LD_LIBRARY_PATH
      * test: skip flaky tests with enabled table bump
      * test: set LD_PRELOAD only when necessary
      * test: fix misclib-getmetrics-lapi.test.lua
      * FFI: Fix __tostring metamethod access to enum cdata value.
      * Fix limit check in narrow_conv_backprop().
      * FFI: Drop finalizer table rehash after GC cycle.
      * Drop unused function wrapper.
      * FFI: Fix various issues in recff_cdata_arith.
      * Add missing coercion when recording select(string, ...)
      * Fix stack allocation after on-trace stack check.
      * Restore state when recording __concat metamethod throws an error.
      * Fix bit op coercion in DUALNUM builds.
      * FFI: Fix 64 bit shift fold rules.
      * Limit CSE for IR_CARG to fix loop optimizations.
      
      Closes #10290
      Closes #10199
      Closes #9898
      Part of #9398
      
      NO_DOC=LuaJIT submodule bump
      NO_TEST=LuaJIT submodule bump
      4019956f
    • Andrey Saranchin's avatar
      memtx: always read prepared tuples of system spaces · 7f0b2bee
      Andrey Saranchin authored
      Since we often search spaces, users, funcs and so on in internal caches
      that have `read-committed` isolation level (prepared tuples are seen),
      let's always allow to read prepared tuples of system spaces.
      
      Another advantage of such approach is that we never handle MVCC when
      working with system spaces, so after the commit they will behave in the
      same way - prepared tuples will be seen. The only difference is that
      readers of prepared rows will be aborted if the row will be rolled back.
      
      By the way, the inconsistency between internal caches and system spaces
      could lead to crash in some sophisticated scenarios - the commit fixes
      this problem as well because now system spaces and internal caches are
      synchronized.
      
      Closes #10262
      Closes tarantool/security#131
      
      NO_DOC=bugfix
      
      (cherry picked from commit b33f17b25de6bcbe3ebc236250976e4a0250e75e)
      7f0b2bee
    • Andrey Saranchin's avatar
      alter: wait for previous alters to commit on DDL · ea1c829f
      Andrey Saranchin authored
      Yielding DDL operations acquire DDL lock so that the space cannot be
      modified under its feet. However, there is a case when it actually can:
      if a yielding DDL has started when there is another DDL is being
      committed and it gets rolled back due to WAL error, `struct space`
      created by rolled back DDL is deleted - and it's the space being altered
      by the yielding DDL. In order to fix this problem, let's simply wait for
      all previous alters to be committed.
      
      We could use `wal_sync` to wait for all previous transactions to be
      committed, but it is more complicated - we need to use `wal_sync` for
      single instance and `txn_limbo_wait_last_txn` when the limbo queue has
      an owner. Such approach has more pitfalls and requires more tests to
      cover all cases. When relying on `struct alter_space` directly, all
      situations are handled with the same logic.
      
      Alternative solutions that we have tried:
      1. Throw an error in the case when user tries to alter space when
         there is another non-committed alter. Such approach breaks applier
         since it applies rows asynchronously. Trying applier to execute
         operations synchronously breaks it even harder.
      2. Do not use space in `build_index` and `check_format` methods. In this
         case, there is another problem: rollback order. We have to rollback
         previous alters firstly, and the in-progress one can be rolled back
         only after it's over. It breaks fundamental memtx invariant: rollback
         order must be reverse of replace order. We could try to use
         `before_replace` triggers for alter, but the patch would be bulky.
      
      Closes #10235
      
      NO_DOC=bugfix
      
      (cherry picked from commit fee8c5dd6b16471739ed8512ba4137ff2e7274aa)
      ea1c829f
  10. Oct 16, 2024
    • Ilya Verbin's avatar
      box: fix SIGSEGV on unaligned access to `struct applier` · 8a1f72b6
      Ilya Verbin authored
      All structures with a non-default alignment (set by `alignas()`) must be
      allocated by `aligned_alloc()`, otherwise an access to such a structure
      member fill crash, e.g. if compiled with AVX-512 support.
      
      See also commit a60ec82d4f07 ("box: fix SIGSEGV on unaligned access to a
      struct with extended alignment").
      
      Closes #10699
      
      NO_DOC=bugfix
      NO_CHANGELOG=minor
      NO_TEST=tested by debug_asan_clang workflow
      
      (cherry picked from commit bf091358806ed17bf44efd2cf382a43c0ba49fe0)
      8a1f72b6
    • Sergey Bronnikov's avatar
      cmake: fix build with GCC's AddressSanitizer · 89815cd3
      Sergey Bronnikov authored
      GNU GCC compiler has AddressSanitizer support since 4.8.0 [1],
      but it was unsupported in tarantool's build. The patch
      fixes a build by GNU GCC with enabled AddressSanitizer.
      
      1. https://gcc.gnu.org/gcc-4.8/changes.html
      
      NO_CHANGELOG=build
      NO_DOC=build
      NO_TEST=build
      
      (cherry picked from commit ef91f92a22c6d7910ecdd00ab14da359343a2ec2)
      89815cd3
  11. Oct 15, 2024
    • Nikolay Shirokovskiy's avatar
      say: fix NULL pointer dereference in log_syslog_init · f67e047a
      Nikolay Shirokovskiy authored
      If opts.identity is NULL and strdup is failed we do NULL pointer
      dereference when reporting the error. Let's just panic if strdup() failed.
      While at it replace another strdup() with xstrdup() in this function. Our
      current approach is to panic on runtime OOM.
      
      Closes tarantool/security#128
      
      NO_TEST=issue is not possible after the fix
      NO_CHANGELOG=not reproducible
      NO_DOC=bugfix
      
      (cherry picked from commit 47b72f44986797466b95b9431a381dbef7dd64fd)
      f67e047a
  12. Oct 14, 2024
    • Alexander Turenko's avatar
      build: update libcurl to curl-8_10_1-241-g461ce6c61 · 89b2760e
      Alexander Turenko authored
      The reason is that the previous libcurl submodule update in commit
      0919f390802f146852b462215327ef03e2730cfc ("third_party: update libcurl from
      8.8.0 to 8.10.1") reveals the following regression:
      
      NOWRAP
      ```c
      $ tarantool -e "require('http.client').new():get('https://google.com') collectgarbage()"
      tarantool: ./third_party/curl/lib/multi.c:3691: curl_multi_assign: Assertion `!(multi)' failed.
      Aborted (core dumped)
      ```
      NOWRAP
      
      The stacktrace is the following:
      
      NOWRAP
      ```c
      <...>
      #4  __assert_fail
      #5  curl_multi_assign            // <- called by us
      #6  curl_multi_sock_cb           // <- this is our callback
      #7  Curl_multi_pollset_ev
      #8  cpool_update_shutdown_ev
      #9  cpool_discard_conn
      #10 cpool_close_and_destroy_all
      #11 Curl_cpool_destroy
      #12 curl_multi_cleanup
      #13 curl_env_finish              // <- destroy the multi handle
      #14 httpc_env_finish
      #15 luaT_httpc_cleanup
      #16 lj_BC_FUNCC
      #17 gc_call_finalizer
      #18 gc_finalize
      #19 gc_onestep
      #20 lj_gc_fullgc
      #21 lua_gc
      #22 lj_cf_collectgarbage
      #23 lj_BC_FUNCC
      #24 lua_pcall
      #25 luaT_call
      #26 lua_main
      #27 run_script_f
      #28 fiber_cxx_invoke
      #29 fiber_loop
      #30 coro_init
      ```
      NOWRAP
      
      The multi handle is during the destroy, but our
      `CURLMOPT_SOCKETFUNCTION` callback is invoked and the
      `curl_multi_assign()` call (invoked to associate a libev watcher to the
      given file descriptor) fails on the assertion. Everything is as
      described in https://github.com/curl/curl/issues/15201.
      
      The first bad libcurl's commit is [curl-8_10_0-4-g48f61e781][1], but
      later it was fixed in [curl-8_10_1-241-g461ce6c61][2]. This commit
      updates libcurl to this revision to fix the regression.
      
      Adjusted build options in our build script:
      
      * Added `CURL_DISABLE_IPFS=ON`: [curl-8_10_1-57-gce7d0d413][3]
      * Added `CURL_TEST_BUNDLES=OFF`: [curl-8_10_1-67-g71cf0d1fc][4]
      * Changed `ENABLE_WEBSOCKETS=OFF` to `CURL_DISABLE_WEBSOCKETS=ON`:
        [curl-8_10_1-130-gd78e129d5][5]
      
      [1]: https://github.com/curl/curl/commit/48f61e781a01e6a8dbc4a347e280644b1c68ab6a
      [2]: https://github.com/curl/curl/commit/461ce6c6160b86439ddd74c59541231ec9e8558e
      [3]: https://github.com/curl/curl/commit/ce7d0d41378007eda676c83ad6b86c59870cc9f1
      [4]: https://github.com/curl/curl/commit/71cf0d1fca9e1f53524e1545ef0c08d174458d80
      [5]: https://github.com/curl/curl/commit/d78e129d50b2d190f1c1bde2ad1f62f02f152db0
      
      NO_DOC=bugfix
      NO_CHANGELOG=fixes an unreleased commit
      NO_TEST=can't reproduce without https to add a test case, verified
              locally
      
      (cherry picked from commit fbe6d0a0a40945c42609f5119a007b5c3980c232)
      89b2760e
    • Ilya Verbin's avatar
      box: fix UBSan error regarding misaligned store in field_map.c · d835c495
      Ilya Verbin authored
      The type cast is unnecessary and causes false-positive errors:
      
      NO_WRAP
      ```
      ./src/box/field_map.c:110:10: runtime error: store to misaligned address 0x507000071082 for type 'uint32_t *' (aka 'unsigned int *'), which requires 4 byte alignment
      0x507000071082: note: pointer points here
       01 00  00 00 be be be be f0 ff  ff ff 02 00 00 00 be be  be be be be be be 00 00  00 00 00 00 00 00
                    ^
      SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ./src/box/field_map.c:110:10
      ```
      NO_WRAP
      
      Closes #10631
      
      NO_DOC=bugfix
      NO_CHANGELOG=minor
      NO_TEST=tested by debug_asan_clang workflow
      
      (cherry picked from commit 5ddbd85cc377a29dc27d01ad06acdc6acc24cc5b)
      d835c495
    • Ilya Verbin's avatar
      small: bump version · ada3dddf
      Ilya Verbin authored
      New commits:
      * mempool: fix UBSan errors regarding misaligned stores
      
      NO_DOC=submodule bump
      NO_TEST=submodule bump
      NO_CHANGELOG=submodule bump
      
      (cherry picked from commit 9dd56f49be85dc8a1fe874629711a828835f740c)
      ada3dddf
    • Ilya Verbin's avatar
      box: fix SIGSEGV on unaligned access to a struct with extended alignment · 9c36990e
      Ilya Verbin authored
      All structures with a non-default alignment (set by `alignas()`) must be
      allocated by `aligned_alloc()`, otherwise an access to such a structure
      member fill crash, e.g. if compiled with AVX-512 support.
      
      Closes #10215
      Part of #10631
      
      NO_DOC=bugfix
      NO_TEST=tested by debug_asan_clang workflow
      NO_CHANGELOG=fix is actually not user-visible, because tarantool still
                   doesn't work with enabled AVX-512 (#10671)
      
      (cherry picked from commit a60ec82d4f07720148b0724e5feff31f76291b56)
      9c36990e
    • Ilya Verbin's avatar
      Revert "hotfix: change aligned_alloc to posix_memalign" · 10aecd64
      Ilya Verbin authored
      This reverts commit 3c25c667.
      
      `aligned_alloc()` is supported by macOS since 10.15.
      I believe that we do not support older versions now.
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      
      (cherry picked from commit 2f4594f748cff99d15f8f6d603797a308793de86)
      10aecd64
  13. Oct 11, 2024
    • Alexander Turenko's avatar
      ci: fix Coverity workflow · fc613299
      Alexander Turenko authored
      It doesn't work since 2023-11-18. The uploading succeeds, but the
      website says:
      
      > The Coverity Build tool version is no longer supported. Please
      > download the latest version for your platform from
      > https://scan.coverity.com/download...
      
      It seems, some specific toolset is installed in the
      `tarantool/testing:debian-buster` image and it was deprecated 11 months
      ago.
      
      Recently the CI workflow starts to fail due to use of the old image with
      an old CMake in it:
      
      > [  2%] Performing configure step for 'bundled-nanoarrow-project'
      > -- Building using CMake version: 3.13.4
      > -- Configuring incomplete, errors occurred!
      > CMake Error at CMakeLists.txt:19 (cmake_minimum_required):
      >   CMake 3.14 or higher is required.  You are running version 3.13.4
      
      It is likely due to commit 49c160c28c97 ("third_party: initial import of
      nanoarrow").
      
      Here I refine the workflow file:
      
      * Get rid of the custom docker image with preinstalled Coverity toolset.
      * Use a nice unofficial-coverity-scan GitHub Acti...
      fc613299
    • Alexander Turenko's avatar
      build: don't depend on libidn2 · 88220b45
      Alexander Turenko authored
      The recent libcurl update in commit 0919f390802f ("third_party: update
      libcurl from 8.8.0 to 8.10.1") reveals an old problem in our libcurl's
      build script: it attempts to disable the libidn2 dependency using the
      `-DHAVE_LIBIDN2=OFF` option instead of `-DUSE_LIBIDN2=OFF`.
      
      It doesn't work after a recent curl building machinery change, see
      https://github.com/curl/curl/pull/14555
      
      This commit fixes the problem by using `-DUSE_LIBIDN2=OFF`.
      
      Reported in #10621
      
      NO_DOC=build mechanics fixup
      NO_CHANGELOG=fixes a non-released commit
      NO_TEST=verified locally, seems to need an extra work on a separate CI
              workflow with a particular building environment; no time for
              that tonight, sorry
      
      (cherry picked from commit a4b4158f2196442308aba7df8f8e21b98b5319fc)
      88220b45
    • Sergey Bronnikov's avatar
      test: add additional tests for a strptime() · 5f1e308b
      Sergey Bronnikov authored
      The testsuite "Datetime string parsing by format (detailed)"
      tests parsing of a string with various conversion specifications.
      However, `tostring(dt)` is used as a test oracle, and all these
      testcases do not test some conversion specifications at all
      because the metamethod `__tostring` for the datetime object uses
      `:format()` with the default format string.
      
      Due to missed tests for conversion specifications, the behavior
      described in #10470 was missed:
      
      ```
      tarantool> dt = date.parse('Mon', {format = '%a'})
      tarantool> dt
      ---
      - 1970-01-01T00:00:00Z
      ...
      
      tarantool> dt:format('%a')
      ---
      - Thu
      ...
      ```
      
      The patch adds tests for `strptime` with all possible conversion
      specifications described in strftime(3) [1][2].
      
      1. https://man.freebsd.org/cgi/man.cgi?strftime(3)
      2. https://pubs.opengroup.org/onlinepubs/009695399/functions/strptime.html
      
      Follows up #8588
      Follows up #6731
      Relates to #10470
      
      NO_CHANGELOG=testing
      NO_DOC=testing
      
      (cherry picked from commit 109b18df4da0b34f4408f67902e0db04540cb32b)
      5f1e308b
  14. Oct 10, 2024
    • Col-Waltz's avatar
      third_party: update libcurl from 8.8.0 to 8.10.1 · a94c42df
      Col-Waltz authored
      Updates curl module to the version 8.10.1. The new version brings
      several new options, such as:
      
      CURL_USE_RUSTLS - Enables Rustls for SSL/TLS. Added in commit
      curl/curl@ed76a23fccc1 ("cmake: add rustls")
      
      CURL_USE_WOLFSSH - Option to use wolfSSH. Added in commit
      curl/curl@0d8fdd1c7421 ("cmake: add wolfSSH support")
      
      CURL_USE_GSASL - Option to use libgsasl.
      Added in commit curl/curl@66bf995d1cfc
      ("cmake: add CURL_USE_GSASL option with detection + CI test")
      
      CURL_DISABLE_SHA512_256 - Disables SHA-512/256 hash algorithm.
      Added in commit curl/curl@33629949488c
      ("build: add options to disable SHA-512/256 hash algo")
      
      CURL_USE_LIBUV - Use libuv for event-based tests. Added in commit
      curl/curl@f7d5f47059c3 ("cmake: add support for `CURL_USE_LIBUV` option")
      
      Corrected http_client test according to curl commit curl/curl@b7e769dc872d
      ("vtls: stop offering alpn http/1.1 for http2-prior-knowledge")
      
      Build file missed several options and paths not used in the current build.
      List of these options was added into curl-excluded-options.txt for the
      convenience of the following bumps.
      
      Closes #10576
      
      https://curl.se/changes.html#8_10_1
      https://github.com/curl/curl/releases/tag/curl-8_10_1
      
      NO_DOC=libcurl submodule bump
      NO_TEST=libcurl submodule bump
      
      (cherry picked from commit 0919f390802f146852b462215327ef03e2730cfc)
      
      @Totktonada: the http_client test mentioned in the original commit
      message doesn't present in the `release/2.11` branch.
      a94c42df
    • Col-Waltz's avatar
      build: added curl options missed by previous bumps · 3b9952fb
      Col-Waltz authored
      Some curl options appear to missed by several previous curl bumps.
      Here is a list of missed options with curl commits in which
      they first appeared:
      
      BUILD_EXAMPLES - Build libcurl examples.
      Added in curl 8.8.0 release in commit curl/curl@dfdd978f7c60
      ("cmake: add `BUILD_EXAMPLES` option to build examples")
      
      USE_ECH - Enables ECH support.
      Added in curl 8.8.0 release in commit curl/curl@a362962b7289
      ("TLS: add support for ECH (Encrypted Client Hello)")
      
      USE_HTTPSRR - Enables HTTPS RR support for ECH.
      Added in curl 8.8.0 release in commit curl/curl@a362962b7289
      ("TLS: add support for ECH (Encrypted Client Hello)")
      
      BUILD_STATIC_CURL - Builds curl executable with static libcurl.
      Added in curl 8.3.0 release in commit curl/curl@1199308dbc90
      ("cmake: support building static and shared libcurl in one go")
      
      CURL_DISABLE_NEGOTIATE_AUTH - Disables negotiate authentication.
      Added in curl 8.3.0 release in commit curl/curl@e92edfbef644
      ("lib: add ability to disable auths individually")
      
      CURL_DISABLE_SRP - Disables TLS-SRP support.
      Added in curl 8.4.0 release in commit curl/curl@781242ffa44a
      ("cmake: detect TLS-SRP in OpenSSL/wolfSSL/GnuTLS")
      
      NO_TEST=does not change tarantool behavior
      NO_DOC=does not change tarantool behavior
      
      (cherry picked from commit 97e3136ddc691f42cf0a5dff27881978b3c25d52)
      3b9952fb
  15. Oct 08, 2024
    • Sergey Bronnikov's avatar
      test: replace testcase by luatest's testcases · 24016012
      Sergey Bronnikov authored
      The tests `array.test.lua` and `map.test.lua` require the remote
      Tarantool instance for running testcases. When tests are executed
      by test-run.py, it runs this Tarantool instance. The testcases
      that require the remote instance were ported to luatest to make
      tests able to run with ctest. The testcases `builtins-13.1` and
      `builtins-14.1` are companion testcases and were moved as well.
      
      Required by patches for CTest support, because allows to
      execute aforementioned tests without test-run.py.
      
      NO_CHANGELOG=codehealth
      NO_DOC=codehealth
      NO_TEST=codehealth
      
      (cherry picked from commit 47295fdebc1910b990c391c26fe92918a9c0c001)
      24016012
    • Sergey Bronnikov's avatar
      test: fix minimal.test.lua · 4db968c2
      Sergey Bronnikov authored
      The patch set a path to `tarantool` executable binary explicitly
      in the aforementioned test.
      
      NO_CHANGELOG=codehealth
      NO_DOC=codehealth
      
      (cherry picked from commit 7844e6034bd67f3e5a57710443373da5200e441a)
      4db968c2
    • Sergey Bronnikov's avatar
      test: use built tarantool instead a system one · 62894f29
      Sergey Bronnikov authored
      The test gh_5747_crash_multiple_args_test.lua uses a `tarantool`
      binary that is available in a current PATH environment variable.
      In some cases, PATH may point to a system `tarantool` executable
      and this could be unexpected for those who run the test. The patch
      set a path to `tarantool` executable derived from a command-line
      used to run the test.
      
      NO_CHANGELOG=codehealth
      NO_DOC=codehealth
      
      (cherry picked from commit 1e907ddbd8db2587418d50dde3e06e985c47bded)
      62894f29
    • Sergey Bronnikov's avatar
      test: fix test filename · 41bbe328
      Sergey Bronnikov authored
      According to CMake policy CMP0110 whitespaces and other special
      characters are forbidden before CMake 3.19. This policy is
      triggered with the patch for CTest support and breaks test
      generation:
      
      NO_WRAP
      The following name given to add_test() is invalid if CMP0110 is not set or
      set to OLD:
      
        `test/box-luatest/gh_7217_repeatable_{in, up}sert_memtx_tx_conflict_test.lua´
      NO_WRAP
      
      The patch renames file without using whitespaces and special
      characters.
      
      Required for CTest support. Follows up commit 654cf498
      ("memtx: fix story delete statement list").
      
      1. https://cmake.org/cmake/help/latest/policy/CMP0110.html
      
      NO_CHANGELOG=codehealth
      NO_DOC=codehealth
      NO_TEST=codehealth
      
      (cherry picked from commit ec810b9d6b618c4ec5116dde2f02b5be01a13f6d)
      41bbe328
Loading