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.

Title: "import ctypes" segfaults on Python 3.6 and Ubuntu 21.10
Type: Stage: resolved
Components: ctypes Versions: Python 3.6
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: Thomas Trummer, erlendaasland, ned.deily
Priority: normal Keywords:

Created on 2021-11-08 13:54 by Thomas Trummer, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg405950 - (view) Author: Thomas Trummer (Thomas Trummer) Date: 2021-11-08 13:54
3.7 and later are all working fine.

First good commit: 55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0
First bad commit: fdbd01151dbd5feea3e4c0316d102db3d2a2a412

git checkout v3.6.15

#0  0x00007ffff6cc52a0 in PyCFuncPtr_new (type=0x5555559157f8, args=0x7ffff6ce6dd8, kwds=0x0)

    at /home/tom/pydev/cpython/Modules/_ctypes/_ctypes.c:3557

#1  0x00005555556400f9 in type_call (type=0x5555559157f8, args=0x7ffff6ce6dd8, kwds=0x0) at Objects/typeobject.c:895

#2  0x00005555555db4ca in _PyObject_FastCallDict (func=0x5555559157f8, args=0x7ffff6dc1f48, nargs=1, kwargs=0x0) at Objects/abstract.c:2331

#3  0x00005555556b8e7c in call_function (pp_stack=pp_stack@entry=0x7fffffffcb58, oparg=<optimized out>, kwnames=kwnames@entry=0x0)

    at Python/ceval.c:4875

#4  0x00005555556bc9d3 in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3335

#5  0x00005555556b774c in PyEval_EvalFrameEx (throwflag=0, f=0x7ffff6dc1dc8) at Python/ceval.c:754

#6  _PyFunction_FastCall (co=<optimized out>, args=<optimized out>, nargs=nargs@entry=0, globals=<optimized out>) at Python/ceval.c:4933

#7  0x00005555556b9269 in fast_function (kwnames=0x0, nargs=0, stack=<optimized out>, func=0x7ffff6d78378) at Python/ceval.c:4968

#8  call_function (pp_stack=pp_stack@entry=0x7fffffffccf8, oparg=<optimized out>, kwnames=kwnames@entry=0x0) at Python/ceval.c:4872

#9  0x00005555556bc9d3 in _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3335

#10 0x00005555556b83c7 in PyEval_EvalFrameEx (throwflag=0, f=0x5555558d2248) at Python/ceval.c:754

#11 _PyEval_EvalCodeWithName (_co=_co@entry=0x7ffff6cdf660, globals=globals@entry=0x7ffff6dfa438, locals=locals@entry=0x7ffff6dfa438, 

    args=args@entry=0x0, argcount=argcount@entry=0, kwnames=kwnames@entry=0x0, kwargs=0x0, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, 

    closure=0x0, name=0x0, qualname=0x0, kwstep=2) at Python/ceval.c:4166

#12 0x00005555556b9a25 in PyEval_EvalCodeEx (closure=0x0, kwdefs=0x0, defcount=0, defs=0x0, kwcount=0, kws=0x0, argcount=0, args=0x0, 

    locals=0x7ffff6dfa438, globals=0x7ffff6dfa438, _co=0x7ffff6cdf660) at Python/ceval.c:4187

#13 PyEval_EvalCode (co=co@entry=0x7ffff6cdf660, globals=globals@entry=0x7ffff6dfa438, locals=locals@entry=0x7ffff6dfa438)

    at Python/ceval.c:731

#14 0x00005555556b611d in builtin_exec_impl (module=<optimized out>, locals=0x7ffff6dfa438, globals=0x7ffff6dfa438, source=0x7ffff6cdf660)

    at Python/bltinmodule.c:983

#15 builtin_exec (module=<optimized out>, args=<optimized out>) at Python/clinic/bltinmodule.c.h:283

#16 0x000055555562b651 in PyCFunction_Call (func=func@entry=0x7ffff6eb7990, args=args@entry=0x7ffff6cdcd08, kwds=kwds@entry=0x7ffff6d6b288)

    at Objects/methodobject.c:126

#17 0x00005555556c11af in do_call_core (kwdict=0x7ffff6d6b288, callargs=0x7ffff6cdcd08, func=0x7ffff6eb7990) at Python/ceval.c:5116

#18 _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3404

#19 0x00005555556b8d17 in PyEval_EvalFrameEx (throwflag=0, f=0x7ffff6dc2930) at Python/ceval.c:754

#20 _PyEval_EvalCodeWithName (_co=0x7ffff6eabdb0, globals=<optimized out>, locals=<optimized out>, args=<optimized out>, argcount=3, 

    kwnames=0x0, kwargs=0x7ffff6d913c8, kwcount=0, kwstep=1, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name=0x7ffff6e53ad0, 

    qualname=0x7ffff6e53ad0) at Python/ceval.c:4166
msg405952 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2021-11-08 14:11
Python 3.6 is in security-fix only mode. I'm sorry, but I don't think this counts as a security issue.
msg405996 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2021-11-09 04:15
> Python 3.6 is in security-fix only mode.

And besides that, it's not clear what problem you are reporting without more context. As far as I can tell, neither the "good" nor the "bad" commit ids you reference are in or were backported to the 3.6 branch. Without more information, it is hard to speculate, however one thing that *might* be relevant is the version of libffi you are trying to use. There have been several issues reported against other branches of Python when trying to use libffi's recent 3.4.2 release. In any case, as Erlend noted, this doesn't appear to be a security-related issue; in general, changes for newer versions of operating systems or third-party libraries are out-of-scope for Python versions in the security-fix phase of their life cycles.
Date User Action Args
2022-04-11 14:59:52adminsetgithub: 89911
2021-11-09 04:15:20ned.deilysetstatus: open -> closed
resolution: wont fix
messages: + msg405996

stage: resolved
2021-11-08 14:12:00erlendaaslandsetstatus: pending -> open
nosy: + ned.deily, - serhiy.storchaka
2021-11-08 14:11:30erlendaaslandsetstatus: open -> pending
nosy: + erlendaasland
messages: + msg405952

2021-11-08 14:09:58erlendaaslandsetnosy: + serhiy.storchaka
2021-11-08 13:54:44Thomas Trummercreate