[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2018-03-08 Thread Ned Deily

Change by Ned Deily :


--
resolution:  -> fixed
stage: backport needed -> resolved
status: open -> closed
versions: +Python 3.7

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2018-03-08 Thread Ned Deily

Ned Deily  added the comment:


New changeset 2f3ba27185a369bcb6b36b13aa3518ffcc970ffa by Ned Deily (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-30353: Fix pass by value for structs on 64-bit Cygwin/MinGW (GH-1559) 
(GH-5954)
https://github.com/python/cpython/commit/2f3ba27185a369bcb6b36b13aa3518ffcc970ffa


--
nosy: +ned.deily

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2018-03-08 Thread Erik Bray

Erik Bray  added the comment:

This has a backport PR now for 3.6.  Once that PR is merged I think we can 
close this as fixed.

--
stage: patch review -> backport needed
versions: +Python 3.6

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2018-03-01 Thread miss-islington

Change by miss-islington :


--
keywords: +patch
pull_requests: +5720
stage:  -> patch review

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-06-09 Thread Charalampos Stratakis

Charalampos Stratakis added the comment:

This bug affects also the 3.6 branch. Can the fix be backported?

--

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-06-07 Thread Vinay Sajip

Vinay Sajip added the comment:


New changeset 9ba3aa4d02a110d1a1ea464a8aff3be7dd9c63c3 by Vinay Sajip (Erik 
Bray) in branch 'master':
bpo-30353: Fix pass by value for structs on 64-bit Cygwin/MinGW (GH-1559)
https://github.com/python/cpython/commit/9ba3aa4d02a110d1a1ea464a8aff3be7dd9c63c3


--

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-05-29 Thread Vinay Sajip

Vinay Sajip added the comment:

Patch LGTM now, perhaps others will concur?

--
nosy: +eryksun

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-05-24 Thread Erik Bray

Erik Bray added the comment:

Thanks for checking!

--

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-05-24 Thread Iryna Shcherbina

Iryna Shcherbina added the comment:

Thank you, Erik. I have applied your new patch, and ran another build on arm64. 
The tests passed. Attaching the build log for more information.

--
Added file: http://bugs.python.org/file46892/arm64_build_log.txt

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-05-23 Thread Erik Bray

Erik Bray added the comment:

Iryna, I updated the pull request with a slightly updated fix.  Could you 
confirm again, when you get a chance, that it works for arm64?  Thanks.

--

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-05-18 Thread Erik Bray

Erik Bray added the comment:

Sure, thanks for pointing that out.

--

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-05-16 Thread Iryna Shcherbina

Iryna Shcherbina added the comment:

I have added `defined(__aarch64__)` check to the if statement and tested the 
patch on arm64. The test passed.

So could you please also add the check for `defined(__aarch64__)` to the pull 
request so that it fixes #29804 as well?

--

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-05-15 Thread Charalampos Stratakis

Changes by Charalampos Stratakis :


--
nosy: +ishcherb

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-05-15 Thread Charalampos Stratakis

Charalampos Stratakis added the comment:

A 'defined(__aarch64__)' can be used for the arm64 arch. I will add it to your 
patch and test it on an arm64 machine to see if the test passes.

--
nosy: +cstratak

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-05-15 Thread Erik Bray

Erik Bray added the comment:

Thanks for pointing that out.  Indeed it's the same symptom, but slightly 
different cause.  libffi has different implementations of its calling routines 
for different architectures/platforms depending on the machine architecture and 
calling conventions used.  So this case is probably buggy for the arm64 
implementation as well, as in #29804.

Off the top of my head I don't know a reliable way to check for this case, but 
this fix would work around the arm64 issue as well if I could check for that 
architecture easily at compile time.

--

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-05-13 Thread Xiang Zhang

Xiang Zhang added the comment:

Looks same as #29804.

--
nosy: +vinay.sajip, xiang.zhang

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-05-12 Thread Erik Bray

Changes by Erik Bray :


--
pull_requests: +1656

___
Python tracker 

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



[issue30353] ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit

2017-05-12 Thread Erik Bray

New submission from Erik Bray:

The test ctypes.test.test_structures.StructureTestCase.test_pass_by_value fails 
on 64-bit Cygwin and MinGW using the system libffi with:

==
FAIL: test_pass_by_value (ctypes.test.test_structures.StructureTestCase)
--
Traceback (most recent call last):
  File "/home/embray/src/python/cpython/Lib/ctypes/test/test_structures.py", 
line 416, in test_pass_by_value
self.assertEqual(s.first, 0xdeadbeef)
AssertionError: 195948557 != 3735928559


It seems that libffi does not handle passing structs by value properly on those 
platforms as I explained here: https://github.com/libffi/libffi/issues/305

The upstream bug hasn't been confirmed yet by the libffi developers so I could 
be wrong, but I think this is fairly clearly broken there.

I have a PR forthcoming to work around the issue.

--
components: ctypes
messages: 293556
nosy: erik.bray
priority: normal
severity: normal
status: open
title: ctypes: pass by value for structs broken on Cygwin/MinGW 64-bit
type: behavior

___
Python tracker 

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