This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Warning in _json.c on platforms where char is unsigned
Type: crash Stage: resolved
Components: Extension Modules Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: Segev Finer, serhiy.storchaka, vstinner
Priority: normal Keywords:

Created on 2017-07-12 17:28 by Segev Finer, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 2684 merged Segev Finer, 2017-07-12 17:28
PR 2690 merged serhiy.storchaka, 2017-07-13 05:57
PR 2692 merged serhiy.storchaka, 2017-07-13 08:27
PR 2693 merged serhiy.storchaka, 2017-07-13 08:28
PR 2694 merged serhiy.storchaka, 2017-07-13 08:38
PR 2729 merged serhiy.storchaka, 2017-07-16 04:42
Messages (15)
msg298239 - (view) Author: Segev Finer (Segev Finer) * Date: 2017-07-12 17:28
Shows in buildbots:

/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Modules/_json.c: In function ‘scanner_new’:
/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Modules/_json.c:1212:5: warning: comparison is always false due to limited range of data type [-Wtype-limits]
     if (s->strict < 0)
     ^

This means that the error check doesn't work right.
msg298262 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-07-13 05:52
New changeset 541bd28941af407f2329e6a540d6367e5625b115 by Serhiy Storchaka (Segev Finer) in branch 'master':
bpo-30911: Fix a crash in json on platforms with unsigned char (#2684)
https://github.com/python/cpython/commit/541bd28941af407f2329e6a540d6367e5625b115
msg298263 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-07-13 06:02
Thank you for noticing this warning Segev.

Actually the issue was more serious. This caused a crash when pass the strict argument that raises an exception when converted to bool. PR 2690 adds test for this (actually it just ports recently added tests from simplejson).
msg298271 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-07-13 07:14
New changeset d3aaa2f1496aae0809c9ec9623fa528d3a2c16c2 by Serhiy Storchaka in branch 'master':
bpo-30911: Add tests for bad boolean arguments for accelerated json (#2690)
https://github.com/python/cpython/commit/d3aaa2f1496aae0809c9ec9623fa528d3a2c16c2
msg298272 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-07-13 07:21
> Actually the issue was more serious.

If the bug is serious, it deserves a NEWS entry, no? Moreover, the fix+test should be backported to 2.7, 3.5 and 3.6, no?
msg298273 - (view) Author: Segev Finer (Segev Finer) * Date: 2017-07-13 08:17
Introduced in https://github.com/python/cpython/commit/ac5bbd43bc7b769c13ae0412cb28a3521f4d4ff1 which is only in 3.7 that means this wasn't ever released. I can send a PR with a NEWS entry if it still needs one?
msg298274 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-07-13 08:26
Oh ok. If it's a regression in the master branch, the code was never released with the bug. In this case, there is no need to document such fix. Thank you :-) I close the issue.

Thanks for the fix Sergev, thanks for the test Serhiy ;-)
msg298275 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-07-13 08:40
New changeset 7d0a99582050ccac2e7126484d23072be342f317 by Serhiy Storchaka in branch '3.6':
[3.6] bpo-30911: Add tests for bad boolean arguments for accelerated json (GH-2690) (#2692)
https://github.com/python/cpython/commit/7d0a99582050ccac2e7126484d23072be342f317
msg298276 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-07-13 08:45
The tests are backported to other branches. This is a one of reasons why I created a separate PR for tests.
msg298277 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-07-13 08:57
New changeset 2ec2c5f0b05efdcb7919c477591f1cb48bfb0aa9 by Serhiy Storchaka in branch '3.5':
[3.5] bpo-30911: Add tests for bad boolean arguments for accelerated json (GH-2690) (#2693)
https://github.com/python/cpython/commit/2ec2c5f0b05efdcb7919c477591f1cb48bfb0aa9
msg298278 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-07-13 09:03
New changeset b6dae2e40d14436d77d3f0bfe6a5b4ae73c83c6e by Serhiy Storchaka in branch '2.7':
[2.7] bpo-30911: Add tests for bad boolean arguments for accelerated json (GH-2690) (#2694)
https://github.com/python/cpython/commit/b6dae2e40d14436d77d3f0bfe6a5b4ae73c83c6e
msg298389 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-07-15 09:56
It is possible that the change introduced a reference leak. See for example:
http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Refleaks%203.5/builds/49
msg298390 - (view) Author: Segev Finer (Segev Finer) * Date: 2017-07-15 10:17
Serhiy's change added tests to test_json, so you can say this unearthed ref leaks rather than introduced them. Probably needs a separate bpo issue and fix.
msg298392 - (view) Author: Segev Finer (Segev Finer) * Date: 2017-07-15 10:43
Created http://bugs.python.org/issue30936
msg298420 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-07-16 04:51
New changeset 3dbe11a1219d148e4a133449a86ac5d157e35d35 by Serhiy Storchaka in branch '2.7':
[2.7] bpo-30911: Add tests for bad boolean arguments for accelerated json (GH-2690) (#2729)
https://github.com/python/cpython/commit/3dbe11a1219d148e4a133449a86ac5d157e35d35
History
Date User Action Args
2022-04-11 14:58:48adminsetgithub: 75094
2017-07-16 04:51:05serhiy.storchakasetmessages: + msg298420
2017-07-16 04:42:33serhiy.storchakasetpull_requests: + pull_request2789
2017-07-15 10:43:26Segev Finersetmessages: + msg298392
2017-07-15 10:17:39Segev Finersetmessages: + msg298390
2017-07-15 09:56:08vstinnersetmessages: + msg298389
2017-07-13 09:03:20serhiy.storchakasetmessages: + msg298278
2017-07-13 08:57:34serhiy.storchakasetmessages: + msg298277
2017-07-13 08:45:24serhiy.storchakasetmessages: + msg298276
2017-07-13 08:40:27serhiy.storchakasetmessages: + msg298275
2017-07-13 08:38:07serhiy.storchakasetpull_requests: + pull_request2758
2017-07-13 08:28:50serhiy.storchakasetpull_requests: + pull_request2757
2017-07-13 08:27:41serhiy.storchakasetpull_requests: + pull_request2756
2017-07-13 08:26:39vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg298274

stage: resolved
2017-07-13 08:17:45Segev Finersetmessages: + msg298273
2017-07-13 07:22:00vstinnersetnosy: + vstinner
messages: + msg298272
2017-07-13 07:14:13serhiy.storchakasetmessages: + msg298271
2017-07-13 06:02:11serhiy.storchakasettype: compile error -> crash
messages: + msg298263
2017-07-13 05:57:47serhiy.storchakasetpull_requests: + pull_request2754
2017-07-13 05:52:10serhiy.storchakasetmessages: + msg298262
2017-07-12 17:44:16serhiy.storchakasetassignee: serhiy.storchaka

nosy: + serhiy.storchaka
2017-07-12 17:28:22Segev Finersetpull_requests: + pull_request2749
2017-07-12 17:28:06Segev Finercreate