Skip to content
Snippets Groups Projects
  1. Mar 20, 2020
    • Kirill Yukhin's avatar
      luajit: bump new version · ddd3ce09
      Kirill Yukhin authored
      Cleaned up the tests code according to the Lua style guide:
      - made scoped variables local
      - added os.exit call at the end of the test chunk
      - adjusted the messages in test:ok calls
      
      (cherry picked from commit 3c641629)
      ddd3ce09
  2. Mar 05, 2020
    • Kirill Yukhin's avatar
      luajit: bump new version · a66683f2
      Kirill Yukhin authored
      - Make string to number conversions fail on NUL char.
      
      (cherry picked from commit 12694d72)
      a66683f2
    • Kirill Yukhin's avatar
      luajit: bump new version · b5f31077
      Kirill Yukhin authored
      - gdb: adjust the extension to be used with Python 2
      - gdb: introduce luajit-gdb extension
      
      (cherry picked from commit a81453b9)
      b5f31077
    • Serge Petrenko's avatar
      build: link bundled libcurl with c-ares · 254e42ce
      Serge Petrenko authored
      libcurl has a built-in threaded resolver used for asynchronous DNS
      requests, however, when DNS server is slow to respond, the request still
      hangs tarantool until it is finished. The reason is that curl calls
      thread_join on the resolving thread internally upon timeout, making the
      calling thread hang until resolution has ended.
      Use c-ares as an asynchronous resolver instead to eliminate the problem.
      
      Closes #4591
      
      (cherry picked from commit 23837076)
      254e42ce
  3. Feb 19, 2020
  4. Feb 15, 2020
    • Olga Arkhangelskaia's avatar
      json: don't spoil instance with per-call options · 9e403e42
      Olga Arkhangelskaia authored
      When json.decode is used with 2 arguments, 2nd argument seeps out to the
      json configuration of the instance. Moreover, due to current
      serializer.cfg implementation it remains invisible while checking
      settings using json.cfg table.
      
      This fixes commit 6508ddb7 ('json: fix
      stack-use-after-scope in json_decode()').
      
      Closes #4761
      
      (cherry picked from commit f54f4dc0)
      9e403e42
  5. Jan 24, 2020
  6. Dec 05, 2019
  7. Dec 03, 2019
    • Maria's avatar
      json: fix stack-use-after-scope in json_decode() · b0800a46
      Maria authored
      Inside json_decode() struct luaL_serializer is allocated on stack, but
      json context stores pointer to it:
      
         998	static int json_decode(lua_State *l)
         999	{
        ...
        1007	    if (lua_gettop(l) == 2) {
        1008	        struct luaL_serializer user_cfg = *luaL_checkserializer(l);
        1009	        luaL_serializer_parse_options(l, &user_cfg);
        1010	        lua_pop(l, 1);
        1011	        json.cfg = &user_cfg;
        1012      }
      
      Later (for instance in json_decode_descend()), it can be dereferenced
      which in turn results in stack-use-after-scope (object turns into
      garbage right after scope is ended). To fix it let's simply avoid
      allocating and copying luaL_serializer on stack and instead use pointer
      to it.
      
      Bug is found by ASAN: test app-tap/json.test.lua fails with enabled
      ASAN. Current fix allows to pass all tests.
      
      Thanks to @Korablev77 for the initial investigation.
      
      Closes #4637
      
      (cherry picked from commit 6508ddb7)
      b0800a46
  8. Nov 22, 2019
    • Kirill Yukhin's avatar
      luajit: bump a new version · 1146bb78
      Kirill Yukhin authored
      Add LUAJIT_ENABLE_PAIRSMM flag as a build option for luajit.
      If the flag is set, pairs/ipairs metamethods are available in
      Lua 5.1.
      For Tarantool this option is enabled by default.
      
      (cherry picked from commit 93e710d5de0d723086bda6fedc9cb383a8e5e477)
      1146bb78
  9. Oct 21, 2019
  10. Oct 09, 2019
  11. Oct 01, 2019
    • Roman Khabibov's avatar
      json: clarify bad syntax error messages · 87e1f960
      Roman Khabibov authored
      Count lines in the json parsing structure. It is needed to print
      the number of line and column where a mistake was made.
      
      Closes #3316
      
      (cherry picked from commit 9f9bd3eb2d064129ff6b1a764140ebef242d7ff7)
      (cherry picked from commit 53d43160)
      87e1f960
  12. Sep 25, 2019
    • Vladislav Shpilevoy's avatar
      app: raise an error on too nested tables serialization · d8fe9316
      Vladislav Shpilevoy authored
      Closes #4434
      Follow-up #4366
      
      @TarantoolBot document
      Title: json/msgpack.cfg.encode_deep_as_nil option
      
      Tarantool has several so called serializers to convert data
      between Lua and another format: YAML, JSON, msgpack.
      
      YAML is a crazy serializer without depth restrictions. But for
      JSON, msgpack, and msgpackffi a user could set encode_max_depth
      option. That option led to crop of a table when it had too many
      nested levels. Sometimes such behaviour is undesirable.
      
      Now an error is raised instead of data corruption:
      
          t = nil
          for i = 1, 100 do t = {t} end
          msgpack.encode(t) -- Here an exception is thrown.
      
      To disable it and return the old behaviour back here is a new
      option:
      
          <serializer>.cfg({encode_deep_as_nil = true})
      
      Option encode_deep_as_nil works for JSON, msgpack, and msgpackffi
      modules, and is false by default. It means, that now if some
      existing users have cropping, even intentional, they will get the
      exception.
      
      (cherry picked from commit d7a8942a)
      d8fe9316
  13. Sep 20, 2019
  14. Sep 16, 2019
    • Oleg Babin's avatar
      rocks: fix zero values in ziptime · 4a4df77f
      Oleg Babin authored
      If the rock was packed with luarocks then the time in it is set to zeros
      and this is not the case with the unix format can be removed when date given
      is added to zipwriter_open_new_file_in_zip (luarocks/luarocks#1056)
      
      Closes #4481
      
      (cherry picked from commit 3658cb00)
      4a4df77f
  15. Sep 11, 2019
  16. Sep 09, 2019
    • Kirill Shcherbatov's avatar
      lua_cjson: fix segfault on recursive table encoding · 1862856d
      Kirill Shcherbatov authored
      The json.encode() used to cause a segfault in case of recursive
      table:
        tbl = {}
        tbl[1] = tbl
        json.encode(tbl)
      
      Library doesn't test whether given object on Lua stack parsed
      earlier, because it performs a lightweight in-depth traverse
      of Lua stack. However it must stop when encode_max_depth is
      reached (by design).
      
      Tarantool's lua_cjson implementation has a bug introduced during
      porting original library: it doesn't handle some corner cases:
      entering into a map correctly increases a current depth, while
      entering into an array didn't. This patch adopts author's
      approach to check encode_max_depth limit. Thanks to handling this
      constraint correctly the segfault no longer occurs.
      
      Closes #4366
      
      (cherry picked from commit d2641e66e65ab57317b8e70bb7115517ec81238e)
      1862856d
  17. Aug 21, 2019
    • Mergen Imeev's avatar
      build: link libcurl statically from a submodule · 5fcca9dd
      Mergen Imeev authored
      Hold libcurl-7.65.3. This version is not affected by the following
      issues:
      
      * #4180 ('httpc: redirects are broken with libcurl-7.30 and older');
      * #4389 ('libcurl memory leak');
      * #4397 ('HTTPS seem to be unstable').
      
      After this patch libcurl will be statically linked when
      ENABLE_BUNDLED_LIBCURL option is set. This option is set by default.
      
      Closes #4318
      
      @TarantoolBot document
      Title: Tarantool dependency list was changed
      
      * Added build dependencies: autoconf, automake, libtool, zlib-devel
        (zlib1g-dev on Debian).
      * Added runtime dependencies: zlib (zlib1g on Debian).
      * Removed build dependencies: libcurl-devel (libcurl4-openssl-dev on
        Debian).
      * Removed runtime dependencies: curl.
      
      The reason is that now we use compiled-in libcurl: so we don't depend on
      a system libcurl, but inherit its dependencies.
      
      (cherry picked from commit 7e51aebb)
      5fcca9dd
  18. Aug 15, 2019
  19. Jul 24, 2019
  20. Jul 18, 2019
  21. Jun 16, 2019
  22. Jun 13, 2019
    • Serge Petrenko's avatar
      lib/core: introduce decimal type to tarantool · 6d62c6c1
      Serge Petrenko authored
      Add fixed-point decimal type to tarantool core.
      Adapt decNumber floating-point decimal library for the purpose, write a
      small wrapper and add unit tests.
      
      A new decimal type is an alias for decNumber numbers from the decNumber
      library.
      Arithmetic operations (+, -, *, /) and some mathematic functions
      (ln, log10, exp, pow, sqrt) are available together with methods to
      pack and unpack decimal to and from its packed representation (useful
      for serialization).
      
      We introduce a single context for all the arithmetic operations
      on decimals, which enforces both number precision and scale to be
      in range [0, 38]. NaNs and Infinities are restricted.
      
      Part of #692
      6d62c6c1
  23. May 29, 2019
  24. May 28, 2019
  25. May 23, 2019
  26. Mar 15, 2019
  27. Feb 25, 2019
    • Alexander Turenko's avatar
      lua-yaml: fix strings literals encoding in yaml · 4095e305
      Alexander Turenko authored
      yaml.encode() now wraps a string literal whose content is equal to a
      null or a boolean value representation in YAML into single quotes. Those
      literals are: 'false', 'no', 'true', 'yes', '~', 'null'.
      
      Reverted the a2d7643c commit to use single quotes instead of multiline
      encoding for 'true' and 'false' string literals.
      
      Follows up #3476
      Closes #3662
      Closes #3583
      4095e305
    • AKhatskevich's avatar
      lua-yaml: verify args in a consistent manner · e925356e
      AKhatskevich authored
      Use lua_is*() functions instead of explicit lua_gettop() checks in
      yaml.encode() and yaml.decode() functions.
      
      Behaviour changes:
      
      * yaml.decode(object, nil) ignores nil (it is consistent with encode
        behaviour).
      * yaml.encode() gives an usage error instead of "unsupported Lua type
        'thread'".
      * yaml.encode('', {}, {}) ignores 3rd argument (it is consistent with
        decode behaviour).
      e925356e
  28. Nov 15, 2018
    • Yaroslav Dynnikov's avatar
      third-party: update luarocks submodule · 10f4db86
      Yaroslav Dynnikov authored
      I. Fixes tarantoolctl rocks install hanging in resctricted networks
      corner-case.
      
      A customer configured two rocks servers:
      1. offline (file:///path/to/rocks)
      2. and default online (rocks.tarantool.org)
      
      He tries to do `rocks install http 1.0.5-1`.
      
      Online server is unavailable due to his local network policy, but
      the rock is available offline. Despite anything, luarocks still
      tries to fetch manifest online, which results in 30 sec hang since
      network access is restricted.
      
      This change aborts scanning when exact match is found
      
      II. Remove cyclic dependencies
      
      This is required to embed luarocks into tarantool, as
      current tarantool preloader can't preload cyclic dependencies.
      There should be a unidirectional dependency graph and
      predictable order.
      
      Note: as a consequence of this patch, operating systems other that
      unix-compatible ones are no longer supported. This is because I
      had to manually resolve dependency graph for predictable require()
      order.
      
      III. Use digest.md5_hex to compute md5 digests instead of openssl
      
      luarocks has support for calculating md5 with 'md5' rock if it's
      present, but we don't have it in tarantool, and instead have the
      'digest' module. That's why luarocks falls back to 'openssl' binary
      to calculate md5 digests.
      
      This patch will allow luarocks to use our internal digests module.
      10f4db86
  29. Sep 13, 2018
    • Roman Khabibov's avatar
      json: add options to json.encode() · 1663bdc4
      Roman Khabibov authored
      Add an ability to pass options to json.encode()/decode().
      
      Closes: #2888.
      
      @TarantoolBot document
      Title: json.encode() json.decode()
      Add an ability to pass options to
      json.encode() and json.decode().
      These are the same options that
      are used globally in json.cfg().
      1663bdc4
  30. Sep 06, 2018
    • Georgy Kirichenko's avatar
      Tarantool static build ability · cb1c72da
      Georgy Kirichenko authored
      A possibility to build tarantool with included library dependencies.
      Use the flag -DBUILD_STATIC=ON to build statically against curl, readline,
      ncurses, icu and z.
      Use the flag -DOPENSSL_USE_STATIC_LIBS=ON to build with static
      openssl
      
      Changes:
        * Add FindOpenSSL.cmake because some distributions do not support the use of
        openssl static libraries.
        * Find libssl before curl because of build dependency.
        * Catch all bundled libraries API and export then it in case of static
        build.
        * Rename crc32 internal functions to avoid a name clash with linked libraries.
      
      Notes:
        * Bundled libyaml is not properly exported, use the system one.
        * Dockerfile to build static with docker is included
      
      Fixes #3445
      cb1c72da
  31. Jul 19, 2018
  32. Jul 13, 2018
  33. Jul 12, 2018
  34. Jul 10, 2018
    • Kirill Shcherbatov's avatar
      app: fix parsing integers with exponent in json · f9f89acb
      Kirill Shcherbatov authored
      Now it is possible to specify a number in exponential
      form via all formats allowed by json standard.
      json.decode('{"remained_amount":2.0e+3}')
      json.decode('{"remained_amount":2.0E+3}')
      json.decode('{"remained_amount":2e+3}')
      json.decode('{"remained_amount":2E+3}')     <-- fixed
      
      Closes #3514.
      f9f89acb
Loading