From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 61A0D385840E; Tue, 23 Nov 2021 09:37:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 61A0D385840E From: "plasmahh at gmx dot net" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: plasmahh at gmx dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2021 09:37:56 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28620 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 step= ping 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=20 set logging off This will reliably segfault for me (and some others on IRC too) Further I noticed that when doing=20 set logging redirect on set logging on si set logging off python gdb.execute("set logging on",False,True) and then do a=20 show logging Half of the output goes to the redirected file, and half of it is displaye= d on the terminal (the prefix for each entry that is) A "set logging off" after that will crash too. --=20 You are receiving this mail because: You are on the CC list for the bug.=