public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "plasmahh at gmx dot net" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug python/28620] New: logging/output redirect interaction between python and stepping commands is broken (and sometimes segfaults)
Date: Tue, 23 Nov 2021 09:37:56 +0000	[thread overview]
Message-ID: <bug-28620-4717@http.sourceware.org/bugzilla/> (raw)

https://sourceware.org/bugzilla/show_bug.cgi?id=28620

            Bug ID: 28620
           Summary: logging/output redirect interaction between python and
                    stepping commands is broken (and sometimes segfaults)
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: plasmahh at gmx dot net
  Target Milestone: ---

Tried with todays HEAD too.

While developing my python plugin I noticed that output redirection of stepping
commands does not work in python (e.g. gdb.execute("si",False,True). Since all
I needed at that point was supressing the output, I tried using the logging
redirect mechanism and things crashed on me.

To reproduce, start any program within gdb (-nh) to a point where stepping is
possible. Then do

python for c in "set logging redirect on\nset logging on\nsi".splitlines():
gdb.execute(c,False,True)

and after that 

set logging off


This will reliably segfault for me (and some others on IRC too)

Further I noticed that when doing 

set logging redirect on
set logging on
si
set logging off
python gdb.execute("set logging on",False,True)

and then do a 

show logging

Half of the output goes to the redirected file, and half of  it is displayed on
the terminal (the prefix for each entry that is)

A "set logging off" after that will crash too.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2021-11-23  9:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23  9:37 plasmahh at gmx dot net [this message]
2021-11-23 10:29 ` [Bug python/28620] " aburgess at redhat dot com
2022-05-13 17:51 ` keith.hanlan at ericsson dot com
2022-08-12 20:03 ` tromey at sourceware dot org

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=bug-28620-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).