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.

Author xdegaye
Recipients Alex.Willmer, amaury.forgeotdarc, belopolsky, meador.inge, xdegaye
Date 2016-05-18.14:57:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1463583469.27.0.889745110533.issue26942@psf.upfronthosting.co.za>
In-reply-to
Content
Running the following interactive statements [1]:

>>> import unittest, ctypes.test.test_as_parameter
>>> unittest.main(module=ctypes.test.test_as_parameter, defaultTest='BasicWrapTestCase', verbosity=2)

The corresponding attached gdb session:

(gdb) continue
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0xb6a181a0 in ?? ()
(gdb) bt 7
#0  0xb6a181a0 in ?? ()
#1  0xb605de7a in _testfunc_callback_i_if (value=-10, func=0xb6a181a0)
    at cpython/Modules/_ctypes/_ctypes_test.c:234
#2  0xb6072238 in ffi_call_SYSV ()
    at cpython/Modules/_ctypes/libffi/src/arm/sysv.S:188
#3  0xb6072a52 in ffi_call (cif=cif@entry=0xbe91ac04, 
    fn=fn@entry=0xb605de6d <_testfunc_callback_i_if>, rvalue=rvalue@entry=0xbe91ac88, 
    avalue=avalue@entry=0xbe91ac78)
    at cpython/Modules/_ctypes/libffi/src/arm/ffi.c:339
#4  0xb606e2a0 in _call_function_pointer (flags=flags@entry=-1240871416, 
    pProc=0xb605de6d <_testfunc_callback_i_if>, pProc@entry=0xb606956b <PyCFuncPtr_call+350>, 
    avalues=avalues@entry=0xbe91ac78, atypes=atypes@entry=0xbe91ac68, restype=0xb60db8e0, 
    resmem=resmem@entry=0xbe91ac88, argcount=argcount@entry=2)
    at cpython/Modules/_ctypes/callproc.c:811
#5  0xb606e894 in _ctypes_callproc (pProc=pProc@entry=0xb605de6d <_testfunc_callback_i_if>, 
    argtuple=argtuple@entry=(<AsParamPropertyWrapper(_param=-10) at remote 0xb5f012d8>, <AsParamPropertyWrapper(_param=<CFunctionType at remote 0xb5ef5c70>) at remote 0xb5ef1fc0>), 
    flags=<optimized out>, argtypes=argtypes@entry=0x0, restype=<optimized out>, 
    restype@entry=<_ctypes.PyCSimpleType at remote 0xb6097228>, checker=checker@entry=0x0)
    at cpython/Modules/_ctypes/callproc.c:1149
#6  0xb606956a in PyCFuncPtr_call (self=0xb5ef5e90, inargs=<optimized out>, kwds=<optimized out>)
    at cpython/Modules/_ctypes/_ctypes.c:3856
(More stack frames follow...)
(gdb) up
#1  0xb605de7a in _testfunc_callback_i_if (value=-10, func=0xb6a181a0)
    at cpython/Modules/_ctypes/_ctypes_test.c:234
234	        sum += func(value);
(gdb) list
229	
230	EXPORT(int) _testfunc_callback_i_if(int value, int (*func)(int))
231	{
232	    int sum = 0;
233	    while (value != 0) {
234	        sum += func(value);
235	        value /= 2;
236	    }
237	    return sum;
238	}
(gdb) p func
$2 = (int (*)(int)) 0xb6a181a0
(gdb) disassemble func
No function contains specified address.
(gdb)


[1] Gdb is attached after the import statement because gdb fails with SIGILL in __dl_notify_gdb_of_libraries both with arm and armv7, whenever a library is loaded. This is gdb from the Android ndk started by ndk-gdb.py from the r11c ndk. A workaround is to add the following lines in the gdbinit script:
    break __dl_rtld_db_dlactivity
    commands
    silent
    return
    sharedlibrary
    continue
    end
History
Date User Action Args
2016-05-18 14:57:49xdegayesetrecipients: + xdegaye, amaury.forgeotdarc, belopolsky, meador.inge, Alex.Willmer
2016-05-18 14:57:49xdegayesetmessageid: <1463583469.27.0.889745110533.issue26942@psf.upfronthosting.co.za>
2016-05-18 14:57:49xdegayelinkissue26942 messages
2016-05-18 14:57:48xdegayecreate