[issue35560] format(float(123), "00") causes segfault in debug builds

2020-11-10 Thread Ned Deily
Ned Deily added the comment: New changeset dae5d728bc3f1d4039b64e4ec3a9036fd5d19587 by Miss Islington (bot) in branch '3.6': bpo-35560: Remove assertion from format(float, "n") (GH-11288) (GH-23231) https://github.com/python/cpython/commit/dae5d728bc3f1d4039b64e4ec3a9036fd5d19587 --

[issue35560] format(float(123), "00") causes segfault in debug builds

2020-11-10 Thread Gregory P. Smith
Gregory P. Smith added the comment: This bug was introduced into the Python 3.6.8 "bugfix" release. https://github.com/python/cpython/pull/23231 will fix it if anyone needs that on modern 3.6. -- nosy: +gregory.p.smith versions: +Python 3.6 ___ Py

[issue35560] format(float(123), "00") causes segfault in debug builds

2020-11-10 Thread miss-islington
Change by miss-islington : -- pull_requests: +22127 pull_request: https://github.com/python/cpython/pull/23231 ___ Python tracker ___ __

[issue35560] format(float(123), "00") causes segfault in debug builds

2019-01-07 Thread STINNER Victor
STINNER Victor added the comment: Thanks Karthikeyan Singaravelan for the bug report and the fix! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.6 ___ Python tracker

[issue35560] format(float(123), "00") causes segfault in debug builds

2019-01-07 Thread miss-islington
miss-islington added the comment: New changeset 9a413faa8708e5c2df509e97d48f18685c198b24 by Miss Islington (bot) in branch '3.7': bpo-35560: Remove assertion from format(float, "n") (GH-11288) https://github.com/python/cpython/commit/9a413faa8708e5c2df509e97d48f18685c198b24 -- nosy:

[issue35560] format(float(123), "00") causes segfault in debug builds

2019-01-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset 3f7983a25a3d19779283c707fbdd5bc91b1587ef by Victor Stinner (Xtreak) in branch 'master': bpo-35560: Remove assertion from format(float, "n") (GH-11288) https://github.com/python/cpython/commit/3f7983a25a3d19779283c707fbdd5bc91b1587ef --

[issue35560] format(float(123), "00") causes segfault in debug builds

2019-01-07 Thread miss-islington
Change by miss-islington : -- pull_requests: +10930 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: > min_width сan be large negative number, and there are subtractions from it. > It may be safer to replace the assert with something like min_width = > Py_MAX(0, min_width). Or ensure that it is non-negative before calling > _PyUnicode_InsertThousan

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: min_width сan be large negative number, and there are subtractions from it. It may be safer to replace the assert with something like min_width = Py_MAX(0, min_width). Or ensure that it is non-negative before calling _PyUnicode_InsertThousandsGrouping(). -

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: > This bug is not new, and this is the first report for it. It can be treated > as a security issue if an application allows user to specify format string. > But using a format string from untrusted source causes a security issue > itself, because

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This bug is not new, and this is the first report for it. It can be treated as a security issue if an application allows user to specify format string. But using a format string from untrusted source causes a security issue itself, because this allows to s

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Sure, I will create one shortly. There were some other cases with different values of negative numbers that I will add since I couldn't see any tests failing on my debug builds. * Are there chances that bugs like these are present since I guess we

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +Interpreter Core ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, seems the simplest way to fix this issue is to remove that assert. Do you mind to create a PR? Tests should be added to cover this case. -- ___ Python tracker __

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Looking into the code min_width is returned as -2 and hence the assert fails. spec->n_min_width is passed as min_width to _PyUnicode_InsertThousandsGrouping that is used in the assert statement and I came across below comment that min_width can go

[issue35560] format(float(123), "00") causes segfault in debug builds

2018-12-22 Thread Karthikeyan Singaravelan
New submission from Karthikeyan Singaravelan : I was looking into format issues and came across msg99839 . The example causes segfault in master, 3.7 and 3.6 branches. This used to pass in 3.7 and 3.6. I searched for open issues and cannot come across an issue for this. I guess this is caused