[issue16575] ctypes: unions as arguments

2020-01-12 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 9dbf5d3bc2033940cdca35440cf08814544f81e4 by Vinay Sajip in branch 
'3.7':
[3.7] bpo-16575: Disabled checks for union types being passed by value. 
(GH-17960) (GH-17970)
https://github.com/python/cpython/commit/9dbf5d3bc2033940cdca35440cf08814544f81e4


--

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2020-01-12 Thread Vinay Sajip


Change by Vinay Sajip :


--
pull_requests: +17378
pull_request: https://github.com/python/cpython/pull/17970

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2020-01-12 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset eb9ba2f66df2195a9c6295e73ab3d545a1445f05 by Vinay Sajip (Miss 
Islington (bot)) in branch '3.8':
bpo-16575: Disabled checks for union types being passed by value. (GH-17960) 
(GH-17964)
https://github.com/python/cpython/commit/eb9ba2f66df2195a9c6295e73ab3d545a1445f05


--

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2020-01-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +17373
pull_request: https://github.com/python/cpython/pull/17964

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2020-01-12 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset c12440c371025bea9c3bfb94945f006c486c2c01 by Vinay Sajip in branch 
'master':
bpo-16575: Disabled checks for union types being passed by value. (GH-17960)
https://github.com/python/cpython/commit/c12440c371025bea9c3bfb94945f006c486c2c01


--

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2020-01-12 Thread Vinay Sajip


Change by Vinay Sajip :


--
pull_requests: +17368
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/17960

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2020-01-11 Thread Vinay Sajip


Vinay Sajip  added the comment:

It seems that notwithstanding the issues identified in the original bug report, 
calls by value of structs containing unions are being used out there in the 
wild. Examples:

The comtypes library (Windows):
https://github.com/python/cpython/pull/16799#issuecomment-573318591

The ctypesgen library, which is used by other projects across platforms:
https://github.com/davidjamesca/ctypesgen/issues/77

Linux examples:
https://github.com/waveform80/picamera/issues/604
https://github.com/hcpl/xkbgroup/issues/15
https://github.com/enkore/i3pystatus/issues/771

So, it would seem that the simplest course of action is to disable the checks 
for now. The checks will be commented out and this issue and the related issue 
bpo-16576 will be reopened.

--
resolution: fixed -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-11-08 Thread STINNER Victor


STINNER Victor  added the comment:

3.7 refleaks buildbots pass again (ignoring a few warnings).

--
resolution:  -> fixed

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-11-06 Thread Ammar Askar


Change by Ammar Askar :


--
stage: patch review -> 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



[issue16575] ctypes: unions as arguments

2019-11-06 Thread Ammar Askar


Ammar Askar  added the comment:

Will close after 
https://buildbot.python.org/all/#/builders?tags=%2Brefleak=%2B3.7 go back 
to green.

--

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-11-06 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 484edbf9bf1a9e6bae0fcb10a0c165b89ea79295 by Vinay Sajip (Ammar 
Askar) in branch '3.7':
bpo-16575: Fix refleak on passing unions in ctypes (GH-17064)
https://github.com/python/cpython/commit/484edbf9bf1a9e6bae0fcb10a0c165b89ea79295


--

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-11-05 Thread Ammar Askar

Ammar Askar  added the comment:

Opened https://github.com/python/cpython/pull/17064 to fix this. Essentially 
it's a tiny little oversight in the back-porting. In the 3.7 branch, we perform 
an attribute lookup for `from_param` before the union checking code, so we must 
remember to DECREF it. This is unlike master where the attribute lookup happens 
after the union checking code.



λ win32\python_d.exe -m test -R 3:3 test_ctypes
0:00:00 Run tests sequentially
0:00:00 [1/1] test_ctypes
beginning 6 repetitions
123456
..

== Tests result: SUCCESS ==

1 test OK.

Total duration: 14.8 sec
Tests result: SUCCESS

--
nosy: +ammar2

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-11-05 Thread Ammar Askar


Change by Ammar Askar :


--
pull_requests: +16572
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/17064

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-11-04 Thread STINNER Victor


STINNER Victor  added the comment:

Same issue on x86 Gentoo Refleaks 3.7:

test_ctypes leaked [174, 174, 174] references, sum=522
test_ctypes leaked [76, 78, 76] memory blocks, sum=230

https://buildbot.python.org/all/#/builders/114/builds/631

--

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-11-04 Thread STINNER Victor


STINNER Victor  added the comment:

This change introduced a reference leak on Windows. Example on 3.7:

https://buildbot.python.org/all/#/builders/132/builds/645

test_ctypes leaked [174, 174, 174] references, sum=522
test_ctypes leaked [76, 77, 77] memory blocks, sum=230

--
nosy: +vstinner
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-10-31 Thread Vinay Sajip


Change by Vinay Sajip :


--
assignee: docs@python -> vinay.sajip
resolution:  -> fixed
stage: patch review -> 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



[issue16575] ctypes: unions as arguments

2019-10-31 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 0118d109d54bf75c99a8b0fa9aeae1a478ac4b7e by Vinay Sajip in branch 
'3.7':
[3.7] bpo-16575: Add checks for unions passed by value to functions. (GH-16799) 
(GH-17017)
https://github.com/python/cpython/commit/0118d109d54bf75c99a8b0fa9aeae1a478ac4b7e


--

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-10-31 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 952899704800a5aa438e84d50f0b6fc498c72e89 by Vinay Sajip in branch 
'3.8':
[3.8] bpo-16575: Add checks for unions passed by value to functions. (GH-16799) 
(GH-17016)
https://github.com/python/cpython/commit/952899704800a5aa438e84d50f0b6fc498c72e89


--

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-10-31 Thread Vinay Sajip


Change by Vinay Sajip :


--
pull_requests: +16536
pull_request: https://github.com/python/cpython/pull/17017

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-10-31 Thread Vinay Sajip


Change by Vinay Sajip :


--
pull_requests: +16535
pull_request: https://github.com/python/cpython/pull/17016

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-10-31 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 79d4ed102a5069c6cebaed2627cb1645637f0429 by Vinay Sajip in branch 
'master':
bpo-16575: Add checks for unions passed by value to functions. (GH-16799)
https://github.com/python/cpython/commit/79d4ed102a5069c6cebaed2627cb1645637f0429


--

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-10-15 Thread Vinay Sajip


Change by Vinay Sajip :


--
pull_requests: +16355
pull_request: https://github.com/python/cpython/pull/16799

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-09-26 Thread Vinay Sajip


Change by Vinay Sajip :


--
pull_requests: +16009
pull_request: https://github.com/python/cpython/pull/16430

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-09-10 Thread Vinay Sajip


Change by Vinay Sajip :


--
keywords: +patch
pull_requests: +15485
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/15839

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2019-09-09 Thread Vinay Sajip


Vinay Sajip  added the comment:

Link to issue has changed to:

https://github.com/libffi/libffi/issues/33

--

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2017-02-23 Thread Vinay Sajip

Changes by Vinay Sajip :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue16575] ctypes: unions as arguments

2013-04-12 Thread Eli Bendersky

Eli Bendersky added the comment:

I've opened a libffi issue in an attempt to get this fixed upstream:

  https://github.com/atgreen/libffi/issues/33

--

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



[issue16575] ctypes: unions as arguments

2013-03-18 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
nosy: +theller

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



[issue16575] ctypes: unions as arguments

2013-03-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0acd9408b6f1 by Eli Bendersky in branch '3.2':
Add warning in ctypes documentation for #16575 and #16576
http://hg.python.org/cpython/rev/0acd9408b6f1

New changeset bfc159f8e4b4 by Eli Bendersky in branch '3.3':
Add warning in ctypes documentation for #16575 and #16576
http://hg.python.org/cpython/rev/bfc159f8e4b4

New changeset 502624235c7b by Eli Bendersky in branch 'default':
Add warning in ctypes documentation for #16575 and #16576
http://hg.python.org/cpython/rev/502624235c7b

--
nosy: +python-dev

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



[issue16575] ctypes: unions as arguments

2013-03-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset eece32440a52 by Eli Bendersky in branch '2.7':
Add warning in ctypes documentation for #16575 and #16576
http://hg.python.org/cpython/rev/eece32440a52

--

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



[issue16575] ctypes: unions as arguments

2013-03-04 Thread Eli Bendersky

Eli Bendersky added the comment:

A minimal fix would be to update the documentation.

A more comprehensive fix would be to tweak ctypes to reject unions and 
bit-fields when running on non-x86 (does this work for ARM and other non-Intel 
archs?)

An even more comprehensive fix would be to make this work, but that would 
require forking libffi and should presumably be first implemented upstream.

--
assignee:  - docs@python
components: +Documentation
nosy: +docs@python, eli.bendersky
stage:  - needs patch
versions: +Python 3.3, Python 3.4

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



[issue16575] ctypes: unions as arguments

2013-03-04 Thread Armin Rigo

Armin Rigo added the comment:

See also http://bugs.python.org/issue16576.

--

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



[issue16575] ctypes: unions as arguments

2012-12-14 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue16575] ctypes: unions as arguments

2012-12-10 Thread Meador Inge

Changes by Meador Inge mead...@gmail.com:


--
nosy: +meador.inge

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



[issue16575] ctypes: unions as arguments

2012-11-28 Thread Armin Rigo

New submission from Armin Rigo:

ctypes pretends to support passing arguments to C functions that are unions 
(not pointers to unions), but that's a lie.  In fact, the underlying libffi 
does not support it.  The attached example misbehaves on Linux x86-64.

--
components: ctypes
files: test184_lib.tgz
messages: 176627
nosy: arigo
priority: normal
severity: normal
status: open
title: ctypes: unions as arguments
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file28155/test184_lib.tgz

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



[issue16575] ctypes: unions as arguments

2012-11-28 Thread Alex Gaynor

Changes by Alex Gaynor alex.gay...@gmail.com:


--
nosy: +alex

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



[issue16575] ctypes: unions as arguments

2012-11-28 Thread Armin Rigo

Changes by Armin Rigo ar...@users.sourceforge.net:


--
type:  - crash

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