[issue37830] continue in finally with return in try results with segfault

2019-08-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Batuhan, unfortunately your second solution does not work too, because continue and break can be conditional. For example: def simple(x): for number in range(2): try: return number finally: if x:

[issue37830] continue in finally with return in try results with segfault

2019-08-13 Thread Ethan Furman
Ethan Furman added the comment: My apologies if I missed something, but do we have a consensus on the desired solution? My understanding of `try/finally` is that whatever happens in the `finally` clause should: - always happen - win any conflicts with `try` clause For example: try:

[issue37830] continue in finally with return in try results with segfault

2019-08-13 Thread Batuhan
Batuhan added the comment: serhiy can you review the solution i found? -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue37830] continue in finally with return in try results with segfault

2019-08-13 Thread Batuhan
Change by Batuhan : -- pull_requests: +14968 pull_request: https://github.com/python/cpython/pull/15247 ___ Python tracker ___ ___

[issue37830] continue in finally with return in try results with segfault

2019-08-12 Thread ppperry
ppperry added the comment: Unfortunately, there's a similar bug for `break` in a finally inside two nested loops, so just re-banning `continue` won't fix the crash. The code below segfaults: ``` def simple(): for number in range(2): for number in range(2): try:

[issue37830] continue in finally with return in try results with segfault

2019-08-12 Thread Batuhan
Batuhan added the comment: I closed the my PR in favor of Serhiy's PR. On Mon, Aug 12, 2019, 9:18 PM Serhiy Storchaka wrote: > > Change by Serhiy Storchaka : > > > -- > pull_requests: +14953 > pull_request: https://github.com/python/cpython/pull/15230 > >

[issue37830] continue in finally with return in try results with segfault

2019-08-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +14953 pull_request: https://github.com/python/cpython/pull/15230 ___ Python tracker ___

[issue37830] continue in finally with return in try results with segfault

2019-08-12 Thread STINNER Victor
STINNER Victor added the comment: > It looks to me, that it is not possible to solve this with the current > bytecode. Perhaps the only way to fix a crash is to revert issue32489. That sounds like a good compromise to unblock next Python 3.8 release. issue32489 can wait another release

[issue37830] continue in finally with return in try results with segfault

2019-08-12 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37830] continue in finally with return in try results with segfault

2019-08-12 Thread Batuhan
Batuhan added the comment: Raising an error can handle this because it is impossible to reach to return so we can declare this as an illegal syntax? -- ___ Python tracker

[issue37830] continue in finally with return in try results with segfault

2019-08-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It looks to me, that it is not possible to solve this with the current bytecode. Perhaps the only way to fix a crash is to revert issue32489. Implementing Mark's idea about inlining the code of a "finally" block may help to solve the issue with "continue"

[issue37830] continue in finally with return in try results with segfault

2019-08-12 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37830] continue in finally with return in try results with segfault

2019-08-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +lukasz.langa priority: normal -> release blocker ___ Python tracker ___ ___ Python-bugs-list

[issue37830] continue in finally with return in try results with segfault

2019-08-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your report Batuhan. But PR 15221 is not proper way to fix it. It will not work when return an iterable. This issue should be fixed at compiler level. The generated code is: Disassembly of ", line 1>: 2 0 LOAD_GLOBAL

[issue37830] continue in finally with return in try results with segfault

2019-08-12 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Adding Serhiy since this change was introduced with issue32489. -- nosy: +serhiy.storchaka, xtreak ___ Python tracker ___

[issue37830] continue in finally with return in try results with segfault

2019-08-12 Thread Batuhan
Change by Batuhan : -- versions: +Python 3.8, Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37830] continue in finally with return in try results with segfault

2019-08-12 Thread Eric V. Smith
Change by Eric V. Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37830] continue in finally with return in try results with segfault

2019-08-12 Thread Eric V. Smith
Change by Eric V. Smith : -- components: +Interpreter Core type: -> crash ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue37830] continue in finally with return in try results with segfault

2019-08-12 Thread Batuhan
Change by Batuhan : -- keywords: +patch pull_requests: +14948 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15221 ___ Python tracker ___

[issue37830] continue in finally with return in try results with segfault

2019-08-12 Thread Batuhan
New submission from Batuhan : When you try to put a return statement with the iterated value inside of try/finally and if you have continue in finally it will result with segfault. def simple(): for number in range(2): try: return number finally: