[New-bugs-announce] [issue22171] stack smash when using ctypes/libffi to access union

Wesley Kerfoot report at bugs.python.org
Fri Aug 8 06:53:59 CEST 2014


New submission from Wesley Kerfoot:

Description:
python 2.7.8 fails with a 'stack smashing detected' error and aborts when trying to access a C union using ctypes/libffi

Steps to reproduce:
See the contents of test.c and test.py in the attached file
gcc -c -fpic -Wall -Wextra -pedantic -Wpointer-arith -Werror -std=c99 -O0 ./test.c -o test.o
gcc -shared -o test.so test.o
python2 test.py

Also fails with clang instead of gcc.

OS: Linux frege 3.15.8-1-ARCH #1 SMP PREEMPT Fri Aug 1 08:51:42 CEST 2014 x86_64 GNU/Linux
python2 version: 2.7.8
libffi version (OS wide version): 3.1-2
gcc version: 4.9.1
clang version: 3.4.2

I have tried rebuilding python with the included version of libffi (Arch normally uses a systemwide version).

Here is the PKGBUILD file Arch uses https://projects.archlinux.org/svntogit/packages.git/tree/python2/trunk/PKGBUILD?id=c319b32ada1506cf2bd48acc50649ae77a696c53

I have also reported this bug on their tracker since I am not sure if this is a bug in ctypes or libffi or both: https://bugs.archlinux.org/task/41502

----------
components: ctypes
files: crash.log
messages: 225059
nosy: amaury.forgeotdarc, belopolsky, meador.inge, wjak56
priority: normal
severity: normal
status: open
title: stack smash when using ctypes/libffi to access union
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file36308/crash.log

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


More information about the New-bugs-announce mailing list