From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 1C76B6EC55; Thu, 22 Jul 2021 16:59:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1C76B6EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1626962351; bh=l4S1yzu9SSEkko/u2JyMsywTQmaJs45ckKReh3dWf40=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=O2aMGYpf5wgYgGqPtaWrgjijc3Ks9YOyxoeK1TAeWa4TCweaCFAgCes3WNdqaEn3b XxHGH1ZjW75OtJcDWAbpJuzO1eNzg+xQk1iQZd06UZ25dP+87jedqRe98T7jjT3BQh Rj0JMnchgDylnaSCjXWvU8X3niMgXcw6Txz53GXk= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 54E4F6EC55 for ; Thu, 22 Jul 2021 16:59:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 54E4F6EC55 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1m6ZEB-0003NZ-8g; Thu, 22 Jul 2021 16:59:07 +0300 Date: Thu, 22 Jul 2021 16:35:32 +0300 To: Mikhail Shishatskiy Message-ID: <20210722133532.GO11494@tarantool.org> References: <20210707071046.649107-1-m.shishatskiy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210707071046.649107-1-m.shishatskiy@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD941C43E597735A9C30288BCF456A452EC92BAB6D044D5CCDE182A05F538085040B408AC0D330DD61EC3CC16F669685BDAACB6BCE77A21601D5099D79F1088D215 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE74FC7AD0AD96C1577EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CDA1F22AAA442F218638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D846544451C3453A2CC097E84D8C470692117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8BAA867293B0326636D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B642416645EBD45DC2089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5511F120967933E509BC555C9A99131012987E1FE40730655D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7501A9DF589746230F410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A1AF43396E40A36FE6989D5EDD40900CE30D94CF8F6767478A70FD5B6528B814DFD54A9BA570B6381D7E09C32AA3244CBF1C1D3919C48548FC55B74A66B118607C0C08F7987826B9927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojaAaPr+N/4d2fY3EykeJkMQ== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5DDB3CB9708A172D1B4A00B3CA0319EBC4A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit] gdb: fix misalignment in lj-stack for LJ_GC64 X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Misha, I've checked the patch into all long-term branches in tarantool/luajit and bumped a new version in 1.10, 2.7, 2.8 and master. On 07.07.21, Mikhail Shishatskiy wrote: > Since commit 58790750b9c4bd4c21d883f109ab552a2e202a15 ('gdb: introduce > luajit-gdb extension') when luajit-gdb.py is introduced, Lua stack > slots printed by lj-stack command are misaligned, when LJ_GC64 is > enabled. The issue is that PADDING variable used for aligning single > slots in the output is initialized before LuaJIT build mode is > defined in function, so the result was the following: > > | 0x7ffff7fb0d90:0x7ffff7fb0dc0 [ ] 7 slots: Red zone > | 0x7ffff7fb0d88 [ M] > | 0x7ffff7fb0cc0:0x7ffff7fb0d80 [ ] 25 slots: Free stack slots > | 0x7ffff7fb0cb8 [ T ] > | ... > > In scope of this patch, PADDING initialization is also moved to > function right after all commands are loaded. As a result, the > output looks as expected: > > | 0x7ffff7fb0d90:0x7ffff7fb0dc0 [ ] 7 slots: Red zone > | 0x7ffff7fb0d88 [ M] > | 0x7ffff7fb0cc0:0x7ffff7fb0d80 [ ] 25 slots: Free stack slots > | 0x7ffff7fb0cb8 [ T ] > | ... > > Fixes tarantool/tarantool#5876 > --- > > Branch: https://github.com/tarantool/luajit/tree/shishqa/gh-5876 > > To test changes do the following: > > | $ gdb -q --args ./luajit -e 'print("QQ")' > | Reading symbols from ./luajit... > | lj-arch command initialized > | lj-tv command initialized > | lj-str command initialized > | lj-tab command initialized > | lj-stack command initialized > | lj-state command initialized > | lj-gc command initialized > | luajit-gdb.py is successfully loaded > | (gdb) lj-arch > | LJ_64: True, LJ_GC64: True > | (gdb) b lj_cf_print > | Breakpoint 1 at 0x298b0: file /mnt/WorkDisk/share/dev/__tarantool/lj-tarantool/src/lib_base.c, line 485. > | (gdb) r > | Starting program: /mnt/WorkDisk/share/dev/__tarantool/lj-tarantool/src/luajit -e print\(\"QQ\"\) > | > | Breakpoint 1, lj_cf_print (L=0x0) > | at /mnt/WorkDisk/share/dev/__tarantool/lj-tarantool/src/lib_base.c:485 > | 485 { > | (gdb) s > | 486 ptrdiff_t i, nargs = L->top - L->base; > | (gdb) lj-stack L > | 0x7ffff7fa8d90:0x7ffff7fa8dc0 [ ] 7 slots: Red zone > | 0x7ffff7fa8d88 [ M] > | 0x7ffff7fa8cc0:0x7ffff7fa8d80 [ ] 25 slots: Free stack slots > | 0x7ffff7fa8cb8 [ T ] > | 0x7ffff7fa8cb0 [ B ] VALUE: string "QQ" @ 0x7ffff7fb1178 > | 0x7ffff7fa8ca0:0x7ffff7fa8ca8 [ ] FRAME: [L] delta=2, fast function #29 > | 0x7ffff7fa8c90:0x7ffff7fa8c98 [ ] FRAME: [V] delta=2, Lua function @ 0x7ffff7fb1240, 0 upvalues, "=(command line)":0 > | 0x7ffff7fa8c80:0x7ffff7fa8c88 [ ] FRAME: [CP] delta=4, Lua function @ 0x7ffff7fb1240, 0 upvalues, "=(command line)":0 > | 0x7ffff7fa8c78 [ ] VALUE: C function @ 0x55555555c962 > | 0x7ffff7fa8c70 [ ] VALUE: light userdata @ 0x0 > | 0x7ffff7fa8c60:0x7ffff7fa8c68 [ ] FRAME: [CP] delta=2, C function @ 0x55555555df1c > | 0x7ffff7fa8c58:0x7ffff7fa8c60 [S ] FRAME: dummy L > > > src/luajit-gdb.py | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > -- > 2.32.0 > -- Best regards, IM