[New-bugs-announce] [issue28631] [2.7/3.5/3.6 Regression] crash using ctypes

Matthias Klose report at bugs.python.org
Mon Nov 7 10:06:34 EST 2016


New submission from Matthias Klose:

the following example started to segfault with the 2.7 branch 20161103, last working one 20160901, on 3.5 branch 20161103, last working one 20160922.

from __future__ import print_function
import ctypes
import ctypes.util

lib_location = ctypes.util.find_library('gettextpo')
gpo = ctypes.cdll.LoadLibrary(lib_location)

gpo_message = gpo.po_message_create()
source = "foo"

print("calling po_message_set_msgid")
gpo.po_message_set_msgid(gpo_message, source.encode('utf-8'))

print("success")


#0  0x00007ffff5e74906 in po_message_set_msgid ()
   from /usr/lib/x86_64-linux-gnu/libgettextpo.so.0
#1  0x00007ffff6a4b038 in ffi_call_unix64 ()
   from /usr/lib/x86_64-linux-gnu/libffi.so.6
#2  0x00007ffff6a4aa9a in ffi_call () from /usr/lib/x86_64-linux-gnu/libffi.so.6
#3  0x00007ffff6c662ec in _call_function_pointer (flags=4353, 
    pProc=0x7ffff5e74900 <po_message_set_msgid>, avalues=0x7fffffffd9c0, 
    atypes=0x7fffffffd9a0, restype=0x7ffff6e9c530, resmem=0x7fffffffd9e0, argcount=2)
    at ./Modules/_ctypes/callproc.c:841
#4  0x00007ffff6c66f61 in _ctypes_callproc (
    pProc=0x7ffff5e74900 <po_message_set_msgid>, argtuple=(1439158016, 'foo'), 
    flags=4353, argtypes=0x0, 
    restype=<_ctypes.PyCSimpleType at remote 0x555555c43d70>, checker=0x0)
    at ./Modules/_ctypes/callproc.c:1184
#5  0x00007ffff6c5f7e2 in PyCFuncPtr_call (self=0x7ffff6ea6a60, 
    inargs=(1439158016, 'foo'), kwds=0x0) at ./Modules/_ctypes/_ctypes.c:3973
#6  0x00005555555b3151 in PyObject_Call (
    func=<_FuncPtr(__name__='po_message_set_msgid') at remote 0x7ffff6ea6a60>, 
    arg=(1439158016, 'foo'), kw=0x0) at ../Objects/abstract.c:2547
#7  0x00005555556c5cef in do_call (
    func=<_FuncPtr(__name__='po_message_set_msgid') at remote 0x7ffff6ea6a60>, 
    pp_stack=0x7fffffffde70, na=2, nk=0) at ../Python/ceval.c:4569
#8  0x00005555556c5082 in call_function (pp_stack=0x7fffffffde70, oparg=2)
    at ../Python/ceval.c:4374
#9  0x00005555556bf492 in PyEval_EvalFrameEx (
    f=Frame 0x7ffff7e3bc00, for file foo.py, line 12, in <module> (), throwflag=0)
    at ../Python/ceval.c:2989

----------
components: Extension Modules
keywords: 3.5regression
messages: 280202
nosy: doko
priority: high
severity: normal
status: open
title: [2.7/3.5/3.6 Regression] crash using ctypes
type: crash
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28631>
_______________________________________


More information about the New-bugs-announce mailing list