From: Maxim Kokryashkin via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: "Sergey Kaplun" <skaplun@tarantool.org> Cc: tarantool-patches@dev.tarantool.org, "Maxim Kokryashkin" <max.kokryashkin@gmail.com> Subject: Re: [Tarantool-patches] [PATCH luajit 2/2] Fix frame for more types of on-trace error messages. Date: Mon, 11 Sep 2023 16:45:29 +0300 [thread overview] Message-ID: <1694439929.479739041@f107.i.mail.ru> (raw) In-Reply-To: <ZP7N5Jp3WPTuaYxr@root> [-- Attachment #1: Type: text/plain, Size: 4474 bytes --] Hi, Sergey! Thanks for the review! Fixed your comments, branch is force-pushed. Here is the new commit message: === Fix frame for more types of on-trace error messages. Thanks to Maxim Kokryashkin. (cherry-picked from commit d5bbf9cdb4c5eddc404a90bd44f077cfb3a57a90) This patch fixes the same issue with the frame as the previous one, but now for the table overflow error in the `err_msgv` function. The test for the problem uses the table of GC finalizers, although they are not required to reproduce the issue. They are only used to make the test as simple as possible. Resolves tarantool/tarantool#562 Part of tarantool/tarantool#8825 === And here is the diff: diff --git a/test/tarantool-tests/lj-1034-tabov-error-frame.test.lua b/test/tarantool-tests/lj-1034-tabov-error-frame.test.lua index b7520d92..0e23fdb2 100644 --- a/test/tarantool-tests/lj-1034-tabov-error-frame.test.lua +++ b/test/tarantool-tests/lj-1034-tabov-error-frame.test.lua @@ -6,6 +6,12 @@ local test = tap.test('lj-1034-tabov-error-frame'):skipcond({ ['Disabled on MacOS due to #8652'] = jit.os == 'OSX', }) +-- XXX: The test for the problem uses the table of GC +-- finalizers, although they are not required to reproduce +-- the issue. They are only used to make the test as simple +-- as possible. +-- +-- XXX: The test requires ~6Gb of memory to see the error. test:plan(2) -- luacheck: no unused @@ -13,11 +19,11 @@ local anchor = {} local function on_gc(t) end local function test_finalizers() - local i = 1 - while true do - anchor[i] = ffi.gc(ffi.cast('void *', 0), on_gc) - i = i + 1 - end + local i = 1 + while true do + anchor[i] = ffi.gc(ffi.cast('void *', 0), on_gc) + i = i + 1 + end end local st, err = pcall(test_finalizers) -- Best regards, Maxim Kokryashkin >Понедельник, 11 сентября 2023, 11:25 +03:00 от Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org>: > >Hi, Maxim! >Thanks for the patch! >LGTM, with a few nits below. > >On 05.09.23, Maxim Kokryashkin wrote: >> From: Mike Pall <mike> >> >> Thanks to Maxim Kokryashkin. >> >> (cherry-picked from commit d5bbf9cdb4c5eddc404a90bd44f077cfb3a57a90) >> >> This patch fixes the same issue with frame, as the previous > >Typo: s/frame,/the frame/ > >> one, but now for the table overflow error in the `err_msgv` >> function. The test for the problem uses the table of GC >> finalizers, although they are not required to reproduce the >> issue. They only used to make the test as simple as possible. > >Typo: s/They only used/They are only used/ > >Minor: Feel free to add the similar comment to the test itself. > >> >> Resolves tarantool/tarantool#562 >> Part of tarantool/tarantool#8825 >> --- >> src/lj_err.c | 4 +++ >> .../lj-1034-tabov-error-frame.test.lua | 27 +++++++++++++++++++ >> 2 files changed, 31 insertions(+) >> create mode 100644 test/tarantool-tests/lj-1034-tabov-error-frame.test.lua >> >> diff --git a/src/lj_err.c b/src/lj_err.c >> index 763746e6..46fb81ee 100644 >> --- a/src/lj_err.c >> +++ b/src/lj_err.c > ><snipped> > >> diff --git a/test/tarantool-tests/lj-1034-tabov-error-frame.test.lua b/test/tarantool-tests/lj-1034-tabov-error-frame.test.lua >> new file mode 100644 >> index 00000000..b7520d92 >> --- /dev/null >> +++ b/test/tarantool-tests/lj-1034-tabov-error-frame.test.lua >> @@ -0,0 +1,27 @@ >> +local tap = require('tap') >> +local ffi = require('ffi') >> +local test = tap.test('lj-1034-tabov-error-frame'):skipcond({ >> + ['Test requires JIT enabled'] = not jit.status(), >> + ['Test requires GC64 mode enabled'] = not ffi.abi('gc64'), >> + ['Disabled on MacOS due to #8652'] = jit.os == 'OSX', >> +}) >> + >> +test:plan(2) >> + > >Side note: The test requires ~6Gb of memory to see the error. >Feel free to add the corresponding comment or ignore. > >> +-- luacheck: no unused >> +local anchor = {} >> +local function on_gc(t) end >> + >> +local function test_finalizers() >> + local i = 1 >> + while true do >> + anchor[i] = ffi.gc(ffi.cast('void *', 0), on_gc) >> + i = i + 1 >> + end >> +end > >Minor: Please use 2 spaces for indentation instead. > >> + >> +local st, err = pcall(test_finalizers) >> +st, err = pcall(test_finalizers) >> +test:ok(st == false, 'error handled successfully') >> +test:like(err, '^.+table overflow', 'error is table overflow') >> +test:done(true) >> -- >> 2.41.0 >> > >-- >Best regards, >Sergey Kaplun [-- Attachment #2: Type: text/html, Size: 6061 bytes --]
next prev parent reply other threads:[~2023-09-11 13:45 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-09-05 10:39 [Tarantool-patches] [PATCH luajit 0/2] Fix frames for on trace errors Maxim Kokryashkin via Tarantool-patches 2023-09-05 10:39 ` [Tarantool-patches] [PATCH luajit 1/2] Fix frame for on-trace out-of-memory error Maxim Kokryashkin via Tarantool-patches 2023-09-07 8:07 ` Sergey Bronnikov via Tarantool-patches 2023-09-08 13:18 ` Maxim Kokryashkin via Tarantool-patches 2023-09-12 9:53 ` Sergey Bronnikov via Tarantool-patches 2023-09-11 8:04 ` Sergey Kaplun via Tarantool-patches 2023-09-11 11:52 ` Maxim Kokryashkin via Tarantool-patches 2023-09-05 10:39 ` [Tarantool-patches] [PATCH luajit 2/2] Fix frame for more types of on-trace error messages Maxim Kokryashkin via Tarantool-patches 2023-09-07 8:11 ` Sergey Bronnikov via Tarantool-patches 2023-09-07 8:56 ` Maxim Kokryashkin via Tarantool-patches 2023-09-07 10:06 ` Sergey Bronnikov via Tarantool-patches 2023-09-11 8:20 ` Sergey Kaplun via Tarantool-patches 2023-09-11 13:45 ` Maxim Kokryashkin via Tarantool-patches [this message] 2023-09-27 12:33 ` [Tarantool-patches] [PATCH luajit 0/2] Fix frames for on trace errors Igor Munkin via Tarantool-patches
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1694439929.479739041@f107.i.mail.ru \ --to=tarantool-patches@dev.tarantool.org \ --cc=m.kokryashkin@tarantool.org \ --cc=max.kokryashkin@gmail.com \ --cc=skaplun@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH luajit 2/2] Fix frame for more types of on-trace error messages.' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox