[issue40228] Make setting line number in frame more robust.

2021-04-07 Thread Mark Shannon


Change by Mark Shannon :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue40228] Make setting line number in frame more robust.

2020-05-07 Thread STINNER Victor


Change by STINNER Victor :


--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue40228] Make setting line number in frame more robust.

2020-05-07 Thread STINNER Victor


STINNER Victor  added the comment:

Windows 64-bit emits a compiler warning on this line:

int len = PyBytes_GET_SIZE(f->f_code->co_code)/sizeof(_Py_CODEUNIT);

Warning:

D:\a\cpython\cpython\Objects\frameobject.c(400,1): warning C4267: 
'initializing': conversion from 'size_t' to 'int', possible loss of data 
[D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]

Either the code should be rewritten to to Py_ssize_t, or the result should be 
downcasted to int.

Technically, it seems possible to create a code object larger than INT_MAX 
instructors: PyCode_New() has no limit on the bytecode length.

--
nosy: +vstinner

___
Python tracker 

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



[issue40228] Make setting line number in frame more robust.

2020-05-07 Thread Mark Shannon


Change by Mark Shannon :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue40228] Make setting line number in frame more robust.

2020-04-29 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 57697245e1deafdedf68e5f21ad8890be591efc0 by Mark Shannon in 
branch 'master':
bpo-40228: More robust frame.setlineno. (GH-19437)
https://github.com/python/cpython/commit/57697245e1deafdedf68e5f21ad8890be591efc0


--

___
Python tracker 

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



[issue40228] Make setting line number in frame more robust.

2020-04-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40228] Make setting line number in frame more robust.

2020-04-08 Thread Mark Shannon


Change by Mark Shannon :


--
keywords: +patch
pull_requests: +18791
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19437

___
Python tracker 

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



[issue40228] Make setting line number in frame more robust.

2020-04-08 Thread Mark Shannon


New submission from Mark Shannon :

Debuggers are allowed to change the line number of the currently executing 
frame. Regardless of whether this is sensible or not, the current 
implementation rather fragile.

The code makes various assumptions about the layout of the bytecode that may 
not be true in the future, and I suspect, are not true now.

We should use a more brute-force approach of computing the exception stack for 
the whole function and then searching for a safe place to jump to. This is not 
only more robust it allows more jumps.

For example, it is safe to jump from one exception handler to another.
It may not be sensible, but it is safe.

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 365990
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Make setting line number in frame more robust.

___
Python tracker 

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