[issue26942] android: test_ctypes crashes on armv7
Xavier de Gaye
report at bugs.python.org
Wed May 18 10:57:49 EDT 2016
Xavier de Gaye added the comment:
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 at entry=0xbe91ac04,
fn=fn at entry=0xb605de6d <_testfunc_callback_i_if>, rvalue=rvalue at entry=0xbe91ac88,
avalue=avalue at entry=0xbe91ac78)
at cpython/Modules/_ctypes/libffi/src/arm/ffi.c:339
#4 0xb606e2a0 in _call_function_pointer (flags=flags at entry=-1240871416,
pProc=0xb605de6d <_testfunc_callback_i_if>, pProc at entry=0xb606956b <PyCFuncPtr_call+350>,
avalues=avalues at entry=0xbe91ac78, atypes=atypes at entry=0xbe91ac68, restype=0xb60db8e0,
resmem=resmem at entry=0xbe91ac88, argcount=argcount at entry=2)
at cpython/Modules/_ctypes/callproc.c:811
#5 0xb606e894 in _ctypes_callproc (pProc=pProc at entry=0xb605de6d <_testfunc_callback_i_if>,
argtuple=argtuple at entry=(<AsParamPropertyWrapper(_param=-10) at remote 0xb5f012d8>, <AsParamPropertyWrapper(_param=<CFunctionType at remote 0xb5ef5c70>) at remote 0xb5ef1fc0>),
flags=<optimized out>, argtypes=argtypes at entry=0x0, restype=<optimized out>,
restype at entry=<_ctypes.PyCSimpleType at remote 0xb6097228>, checker=checker at 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
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26942>
_______________________________________
More information about the Python-bugs-list
mailing list