[issue44556] ctypes unittest crashes with libffi 3.4.2

2021-11-20 Thread Ned Deily


Ned Deily  added the comment:

Yes, this does appear to be a result of the problem described in Issue45350. As 
noted there, the problem was caused by running autoreconf to regerenerate the 
./configure script in an environment where pkg-config wasn't installed which 
caused some pkg-config code to be removed from ./configure. And, unfortunately, 
the ./configure script included with the v3.10.0 release still had that 
problem. You can copy an updated version from the current 3.10.0 branch or wait 
for 3.10.1 or you can try running autoreconf yourself in the source directory.

--
nosy: +ned.deily
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> configure incorrectly ignores pkg-config information for libffi 
and Tcl/Tk in 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44556] ctypes unittest crashes with libffi 3.4.2

2021-11-19 Thread Isuru Fernando


Isuru Fernando  added the comment:

Duplicate of https://bugs.python.org/issue45350

--
nosy: +isuruf

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44556] ctypes unittest crashes with libffi 3.4.2

2021-11-19 Thread Eli Rykoff


Eli Rykoff  added the comment:

To add a bit more color, I don't think you can explicitly set 
LIBFFI_INCLUDE_DIR, it's set by the configure script explicitly.  The problem 
is that some time between python 3.9 and 3.10 the configure script has (at 
least in our system) failed to figure out the $PKG_CONFIG variable correctly.  
It should be set to the executable with the full path name, as is done with 
3.9, but now it is set to just the executable name.  When that happens the 
library location check fails.

--
nosy: +erykoff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44556] ctypes unittest crashes with libffi 3.4.2

2021-11-19 Thread jakirkham


jakirkham  added the comment:

We ran into the same issue in conda-forge ( 
https://github.com/conda-forge/python-feedstock/issues/522 ).

The problem is Apple also supplies their own `libffi`. However if the build 
scripts in CPython fail to find the user provided `libffi`, they end up pulling 
the headers from Apple's `libffi`, but the linker will link to the user 
provided `libffi`. IOW mashing these two incompatible `libffi`'s together. As 
result one gets crashes like the one illustrated in this bug.

In conda-forge, we are resolving this by forcing our `pkg-config` to be used to 
ensure we pick up the headers from our `libffi` as well as the libraries. Other 
users may be able to workaround this issue by explicitly setting 
`LIBFFI_INCLUDE_DIR`.

That said, it would be preferable to have a clear way to specify the `libffi` 
used and ensure that Apple's one doesn't get accidentally pulled in. If this 
exists and we are just missing these details, some pointers to this effect 
would be very helpful.

--
nosy: +jakirkham

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44556] ctypes unittest crashes with libffi 3.4.2

2021-11-19 Thread h-vetinari


Change by h-vetinari :


--
nosy: +h-vetinari

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44556] ctypes unittest crashes with libffi 3.4.2

2021-11-19 Thread Ryan May


Change by Ryan May :


--
nosy: +Ryan May

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44556] ctypes unittest crashes with libffi 3.4.2

2021-07-02 Thread Zan


New submission from Zan :

Running the unittests after upgrading libffi to latest version 3.4.2 and 
recompiling python, leads to several tests in Lib/ctypes/test/ to crash with 
Abort: trap 6. This does not happen with version 3.3 of libffi.

Steps to reproduce:

git clone https://github.com/libffi/libffi
cd libffi
autoreconf -fvi
export CC=/usr/bin/clang
./configure
make
sudo make install # installs into /usr/local

git clone https://github.com/python/CPython
cd CPython
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
export CPPFLAGS="-I/usr/local/include" 
export LDFLAGS="-L/usr/local/lib"
./configure --with-system-ffi
make
./python Lib/ctypes/test/__main__.py -v

...
test_callbacks (ctypes.test.test_as_parameter.AsParamPropertyWrapperTestCase) 
... Abort trap: 6

If I repeat the above steps with 'git checkout v3.3' in libffi, all tests in 
ctypes complete successfully.

Tested with :
- python 3.11 commit ec8759b0 (current master), also tried 3.8.11
- libffi 3.4.2
- macOS 11.4, Xcode 12.5.1
- MacBook Air, x86_64, Intel Sky Lake, i5-8210Y

--
components: ctypes
messages: 396885
nosy: zan
priority: normal
severity: normal
status: open
title: ctypes unittest crashes with libffi 3.4.2
type: crash
versions: Python 3.11, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com