Tarantool development patches archive
 help / color / mirror / Atom feed
From: Kirill Yukhin <kyukhin@tarantool.org>
To: Igor Munkin <imun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org,
	Alexander Turenko <alexander.turenko@tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH] gdb: fix the extension to be loaded with Python 2
Date: Wed, 22 Jul 2020 15:46:56 +0300	[thread overview]
Message-ID: <20200722124656.nvu2zrxumesrnuwn@tarantool.org> (raw)
In-Reply-To: <e4aae3261de6faccd91f1229253c63a34d48603e.1593891122.git.imun@tarantool.org>

Hello,

On 04 июл 22:58, Igor Munkin wrote:
> There was a mystic error when the extension was loaded against old gdb
> versions build against Python 2:
> | (gdb) source luajit-gdb.py
> | Traceback (most recent call last):
> |   File "luajit-gdb.py", line 702, in <module>
> |     load(None)
> |   File "luajit-gdb.py", line 699, in load
> |     'lj-gc': LJGC,
> |   File "luajit-gdb.py", line 687, in init
> |     command(name)
> |   File "luajit-gdb.py", line 468, in __init__
> |     gdb.write('{} command initialized\n'.format(name))
> | ValueError: sequence.index(x): x not in sequence
> 
> I made a little investigation (for more info see the mentioned issue)
> and found the next fun fact: the exception was raised much earlier to
> <str.format>, more precisely in <gdb.events.new_objfile.disconnect>.
> However, the handled exception is preserved until <str.format> call and
> hits the condition underneath leading to the extension load failure.
> 
> As a result to avoid the exception raise, the special global variable is
> introduced for legacy (i.e. Python 2) environment. It checks whether any
> callback is associated with new_objfile event prior to disconnecting it.
> This variable usage is encapsulated within two introduced routines:
> <connect> and <disconnect> which are wrappers for ones provided by gdb.
> 
> Furthermore, after diving to gdb sources related to Python embedding, I
> found that callbacks are grouped into an internal list. Previous
> implementation appended the <load> function to this callback list on
> each its unsuccessful call, but only the successful one is removes it
> from the list. Thereby disconnect action is moved prior to connect one
> so there is no more than one <load> instance kept in callback list.
> 
> Fixes tarantool/tarantool#4828
> 
> Reported-by: Oleg Babin <olegrok@tarantool.org>
> Signed-off-by: Igor Munkin <imun@tarantool.org>

I've checked your patch into Tarantool's luajit repo and bumped a
new version in 1.10, 2.4, 2.5 and master branches.

--
Regards, Kirill Yukhin

      parent reply	other threads:[~2020-07-22 12:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-04 19:58 Igor Munkin
2020-07-06  5:50 ` Oleg Babin
2020-07-06 10:24   ` Igor Munkin
2020-07-22 10:46 ` Sergey Ostanevich
2020-07-22 12:00   ` Igor Munkin
2020-07-22 12:46 ` Kirill Yukhin [this message]

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=20200722124656.nvu2zrxumesrnuwn@tarantool.org \
    --to=kyukhin@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=imun@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] gdb: fix the extension to be loaded with Python 2' \
    /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