[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-03-01 Thread Berker Peksag

Berker Peksag added the comment:

> Which patch?

Looks like the patch can be found at https://github.com/atgreen/libffi/pull/34/ 
and it has been released in libffi 3.1: 
https://github.com/atgreen/libffi/blob/17ffc3655a531c116e9eb9cc933e50bb1e5c47f8/ChangeLog.libffi-3.1#L481

(It's hard to share a specific commit since libffi's history is not linear.)

The patch also has been merged into CPython's fork in 0fef0afb9d19 (Update the 
ctypes module's libffi to v3.1):

* 
https://github.com/python/cpython/blob/master/Modules/_ctypes/libffi/src/arm/ffi.c#L43
* 
https://github.com/python/cpython/blob/master/Modules/_ctypes/libffi/src/arm/ffi.c#L128

I don't have an ARM system to run David's reproducer (thanks for your report 
and for the test script, by the way!), but I think we can safely assume that 
this has already been fixed.

--
nosy: +berker.peksag
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-03-01 Thread Maciej Fijalkowski

Maciej Fijalkowski added the comment:

The easiest way to check is to run the tests attached

--

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-03-01 Thread Maciej Fijalkowski

Maciej Fijalkowski added the comment:

Then maybe it's fixed, I have no idea

--

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-03-01 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +doko

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-03-01 Thread STINNER Victor

STINNER Victor added the comment:

David Schneider: "A patch for this issue has been accepted into libffi."

fijal: "Can you please commit the upstream fix that has been committed 3 years 
ago (...)"

Which patch? Attached tar archive doesn't look like a patch and I see no 
reference to a fix.

Previous libffi upgrade:
---
changeset:   92061:4331fa01398e
branch:  2.7
parent:  92058:928135d0fa7d
user:d...@ubuntu.com
date:Sun Aug 10 11:15:28 2014 +0200
files:   Misc/NEWS Modules/_ctypes/libffi.diff 
Modules/_ctypes/libffi/.gitignore Modules/_ctypes/libffi/.travis.yml 
Modules/_ctypes/libffi/ChangeLog Modules/_ctypes/libffi/Change
description:
- Issue #22176: Update the ctypes module's libffi to v3.1.  This release
  adds support for the Linux AArch64 and POWERPC ELF ABIv2 little endian
  architectures.
---

This upgrade was made in august 2014, this issue was reported in march 2013. 
The upgrade didn't add the mentioned fix?

--

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-03-01 Thread STINNER Victor

STINNER Victor added the comment:

To me, it doesn't make sense to maintain a downstream "fork" of libffi. I would 
prefer to "simply" upgrade to a more recent version of libffi in CPython. But I 
don't know why we have a downstream version. What was patched? Does anyone know 
anything about it?

I understood that Linux packages configure with ./configure 
--with-system-libffi to reuse the system libffi.so.

Who uses the downstream version? Windows? OS X?

--

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-03-01 Thread Maciej Fijalkowski

Maciej Fijalkowski added the comment:

Apparently you can't have an opinion from ctypes experts. Can you please commit 
the upstream fix that has been committed 3 years ago or just stop vendoring 
random, old, broken version of ctypes if you can't maintain it enough to pull 
fixes from upstream?

--
nosy: +fijall

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-02-29 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2016-02-29 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2014-10-05 Thread Mark Lawrence

Mark Lawrence added the comment:

Could we have a reply to this from our ctypes experts, thanks.

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2013-06-27 Thread Christian Heimes

Changes by Christian Heimes :


--
versions: +Python 3.3, Python 3.4

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2013-03-30 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge

___
Python tracker 

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



[issue17580] ctypes: ARM hardfloat argument corruption calling functions with many float arguments

2013-03-30 Thread David Schneider

New submission from David Schneider:

This issue affects C functions with many float/double arguments called through 
ctypes on ARM using the hardfloat ABI (i.e. the standard distribution for the 
raspberry pi uses hard-float).

Calling a C function using ctypes on ARM hard-float that takes a large number 
of float arguments (more than 16 floats or more than 8 doubles) corrupts the 
first float/double arguments passed on the stack to the called function. 

To check the issue run the following commands on an ARM hard-float system:
make
python bug.py

A patch for this issue has been accepted into libffi.

--
components: ctypes
files: ctypes_arm.tar
messages: 185557
nosy: bivab
priority: normal
severity: normal
status: open
title: ctypes: ARM hardfloat argument corruption calling functions with many 
float arguments
type: behavior
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file29613/ctypes_arm.tar

___
Python tracker 

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