[issue24160] Pdb sometimes crashes when trying to remove a breakpoint defined in a different debugger sessoon

2020-08-28 Thread Irit Katriel


Irit Katriel  added the comment:

I've submitted a patch that I believe fixes this problem. It adds in Bdb's 
__init__ a call to a function that reads the Breakpoint's 'bplist' and 
'bpbynumber' class attributes and populates the new instances' 'breaks' dict.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24160] Pdb sometimes crashes when trying to remove a breakpoint defined in a different debugger sessoon

2020-08-28 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +patch
nosy: +iritkatriel
nosy_count: 4.0 -> 5.0
pull_requests: +21098
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21989

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24160] Pdb sometimes crashes when trying to remove a breakpoint defined in a different debugger sessoon

2017-04-18 Thread Tomer Chachamu

Changes by Tomer Chachamu :


--
nosy: +Tomer Chachamu

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24160] Pdb sometimes crashes when trying to remove a breakpoint defined in a different debugger sessoon

2015-05-15 Thread Xavier de Gaye

Xavier de Gaye added the comment:

I can reproduce the problem on python 3.5 with test3.py as:
def foo():
foo = 7789
bar = 7788

$ python
Python 3.5.0a4+ (default:8bac00eadfda, May  6 2015, 17:40:12) 
[GCC 4.9.2 20150304 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pdb, test3
>>> pdb.run('test3.foo()')
> (1)()
(Pdb) step
--Call--
> /home/xavier/tmp/test3.py(1)foo()
-> def foo():
(Pdb) break 3
Breakpoint 1 at /home/xavier/tmp/test3.py:3
(Pdb) continue
> /home/xavier/tmp/test3.py(3)foo()
-> bar = 7788
(Pdb) continue
>>> pdb.run('test3.foo()')
> (1)()
(Pdb) step
--Call--
> /home/xavier/tmp/test3.py(1)foo()
-> def foo():
(Pdb) break   # 'break' lists no breakpoints.
(Pdb) break 2
Breakpoint 2 at /home/xavier/tmp/test3.py:2
(Pdb) break   # 'break' lists two breakpoints.
Num Type Disp Enb   Where
1   breakpoint   keep yes   at /home/xavier/tmp/test3.py:3
breakpoint already hit 1 time
2   breakpoint   keep yes   at /home/xavier/tmp/test3.py:2
(Pdb) 


On the second debugging session, the first 'break' command lists no
breakpoints, while the second 'break' command lists two breakpoints including
the one set in the first debugging session.

The problem is that the 'breaks' attribute of the Pdb instance is inconsistent
with the 'bplist' and 'bpbynumber' class attributes of the bdb.Breakpoint
class when the second debugging session is started.

--
nosy: +xdegaye
versions: +Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24160] Pdb sometimes crashes when trying to remove a breakpoint defined in a different debugger sessoon

2015-05-10 Thread ppperry

New submission from ppperry:

>>> import pdb, test3
>>> pdb.run("reload(test3)")
> (1)()
(Pdb) s
--Call--
> c:\documents and 
> settings\perry\desktop\coding_projects\python\test3.py(1)()
-> foo = 7789
(Pdb) b 2
Breakpoint 1 at c:\documents and 
settings\perry\desktop\coding_projects\python\test3.py:2
(Pdb) c
> c:\documents and 
> settings\perry\desktop\coding_projects\python\test3.py(2)()
-> bar = 7788
(Pdb) c
>>> pdb.run("reload(test3)")
> (1)()
(Pdb) s
--Call--
> c:\documents and 
> settings\perry\desktop\coding_projects\python\test3.py(1)()
-> foo = 7789
(Pdb) b 1
Breakpoint 2 at c:\documents and 
settings\perry\desktop\coding_projects\python\test3.py:1
(Pdb) cl 1

Traceback (most recent call last):
  File "", line 1, in 
pdb.run("reload(test3)")
  File "C:\Python27\lib\pdb.py", line 1238, in run
Pdb().run(statement, globals, locals)
  File "C:\Python27\lib\bdb.py", line 400, in run
exec cmd in globals, locals
  File "", line 1, in 
  File "test3.py", line 1, in 
foo = 7789
  File "C:\Python27\lib\bdb.py", line 51, in trace_dispatch
return self.dispatch_call(frame, arg)
  File "C:\Python27\lib\bdb.py", line 80, in dispatch_call
self.user_call(frame, arg)
  File "C:\Python27\lib\pdb.py", line 148, in user_call
self.interaction(frame, None)
  File "C:\Python27\lib\pdb.py", line 210, in interaction
self.cmdloop()
  File "C:\Python27\lib\cmd.py", line 142, in cmdloop
stop = self.onecmd(line)
  File "C:\Python27\lib\pdb.py", line 279, in onecmd
return cmd.Cmd.onecmd(self, line)
  File "C:\Python27\lib\cmd.py", line 221, in onecmd
return func(arg)
  File "C:\Python27\lib\pdb.py", line 622, in do_clear
err = self.clear_bpbynumber(i)
  File "C:\Python27\lib\bdb.py", line 297, in clear_bpbynumber
self._prune_breaks(bp.file, bp.line)
  File "C:\Python27\lib\bdb.py", line 268, in _prune_breaks
self.breaks[filename].remove(lineno)
ValueError: list.remove(x): x not in list
Running the same code without first defining a breakpoint (in the second 
debugger instance) raises KeyError: [path to test3.py] on the same lien
The contents of test3.py are irrelevant, as long as it is at least two lines 
long and syntactically correct.

--
components: Library (Lib)
messages: 242861
nosy: georg.brandl, ppperry
priority: normal
severity: normal
status: open
title: Pdb sometimes crashes when trying to remove a breakpoint defined in a 
different debugger sessoon
type: behavior
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com