Issue 36150: Possible assertion failures due to _ctypes.c's PyCData_reduce()
Created on 2019-02-28 19:13 by ZackerySpytz, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 12106 | merged | ZackerySpytz, 2019-02-28 19:16 | |
| PR 12642 | merged | miss-islington, 2019-03-31 16:02 | |
| PR 12643 | merged | ZackerySpytz, 2019-03-31 16:33 | |
| Messages (8) | |||
|---|---|---|---|
| msg336866 - (view) | Author: Zackery Spytz (ZackerySpytz) * ![]() |
Date: 2019-02-28 19:13 | |
The PyBytes_FromStringAndSize() and PyObject_GetAttrString() calls in PyCData_reduce() are not checked for failure. |
|||
| msg336867 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2019-02-28 20:26 | |
Does not Py_BuildValue() check the argument for "N" for NULL? |
|||
| msg336870 - (view) | Author: Christian Heimes (christian.heimes) * ![]() |
Date: 2019-02-28 21:36 | |
Yes, N and O accept NULL and pass the exception up the call stack. It's not a bug. https://docs.python.org/3/c-api/arg.html?highlight=py_buildvalue#c.Py_BuildValue |
|||
| msg337009 - (view) | Author: Zackery Spytz (ZackerySpytz) * ![]() |
Date: 2019-03-02 12:48 | |
I'm sorry. I misunderstood the behavior of Py_BuildValue(). |
|||
| msg339099 - (view) | Author: Zackery Spytz (ZackerySpytz) * ![]() |
Date: 2019-03-29 07:45 | |
I again encountered an assertion failure that involved PyCData_reduce(). In that function, PyBytes_FromStringAndSize() may be evaluated before PyObject_GetAttrString(). If a MemoryError occurs in PyBytes_FromStringAndSize(), an assertion failure will occur in _PyType_Lookup() when PyObject_GetAttrString() is called. The assertion failure occurs before the Py_BuildValue() call. Please reopen the issue and the PR. |
|||
| msg339265 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2019-03-31 16:02 | |
New changeset 5f2c50810a67982b0c80f6d3258fee3647f67005 by Serhiy Storchaka (Zackery Spytz) in branch 'master': bpo-36150: Fix possible assertion failures due to _ctypes.c's PyCData_reduce(). (GH-12106) https://github.com/python/cpython/commit/5f2c50810a67982b0c80f6d3258fee3647f67005 |
|||
| msg339271 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2019-03-31 17:14 | |
New changeset a110817c080ca3c2f3262350b5d7e0c0582527e6 by Serhiy Storchaka (Zackery Spytz) in branch '2.7': bpo-36150: Fix possible assertion failures due to _ctypes.c's PyCData_reduce(). (GH-12106) (GH-12643) https://github.com/python/cpython/commit/a110817c080ca3c2f3262350b5d7e0c0582527e6 |
|||
| msg339272 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2019-03-31 17:15 | |
New changeset 5e233951d931acc0e927100c51e9a27a2791b6a5 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.7': bpo-36150: Fix possible assertion failures due to _ctypes.c's PyCData_reduce(). (GH-12106) (GH-12642) https://github.com/python/cpython/commit/5e233951d931acc0e927100c51e9a27a2791b6a5 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:11 | admin | set | github: 80331 |
| 2019-03-31 17:26:47 | serhiy.storchaka | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2019-03-31 17:15:13 | serhiy.storchaka | set | messages: + msg339272 |
| 2019-03-31 17:14:20 | serhiy.storchaka | set | messages: + msg339271 |
| 2019-03-31 16:33:27 | ZackerySpytz | set | pull_requests: + pull_request12575 |
| 2019-03-31 16:02:36 | miss-islington | set | stage: patch review pull_requests: + pull_request12574 |
| 2019-03-31 16:02:13 | serhiy.storchaka | set | messages: + msg339265 |
| 2019-03-29 09:06:11 | serhiy.storchaka | set | status: closed -> open resolution: not a bug -> (no value) stage: resolved -> (no value) |
| 2019-03-29 07:45:49 | ZackerySpytz | set | messages: + msg339099 |
| 2019-03-02 12:48:52 | ZackerySpytz | set | messages: + msg337009 |
| 2019-02-28 21:36:33 | christian.heimes | set | status: open -> closed nosy:
+ christian.heimes resolution: not a bug |
| 2019-02-28 20:26:54 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg336867 |
| 2019-02-28 19:16:27 | ZackerySpytz | set | keywords:
+ patch stage: patch review pull_requests: + pull_request12113 |
| 2019-02-28 19:13:41 | ZackerySpytz | create | |

