[issue35972] _xxsubinterpreters: channel_send() may truncate ints on 32-bit platforms

2019-02-13 Thread Eric Snow
Eric Snow added the comment: ack -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35972] _xxsubinterpreters: channel_send() may truncate ints on 32-bit platforms

2019-02-13 Thread STINNER Victor
STINNER Victor added the comment: > New changeset 16f842da3c862d76a1177bd8ef9579703c24fa5a by Eric Snow (Alexey > Izbyshev) in branch 'master': > bpo-35972: _xxsubinterpreters: Fix potential integer truncation on 32-bit in > channel_send() (gh-11822) It seems like this change introduced a

[issue35972] _xxsubinterpreters: channel_send() may truncate ints on 32-bit platforms

2019-02-12 Thread Eric Snow
Eric Snow added the comment: Thanks, Alexey! -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue35972] _xxsubinterpreters: channel_send() may truncate ints on 32-bit platforms

2019-02-12 Thread Eric Snow
Eric Snow added the comment: New changeset 16f842da3c862d76a1177bd8ef9579703c24fa5a by Eric Snow (Alexey Izbyshev) in branch 'master': bpo-35972: _xxsubinterpreters: Fix potential integer truncation on 32-bit in channel_send() (gh-11822)

[issue35972] _xxsubinterpreters: channel_send() may truncate ints on 32-bit platforms

2019-02-12 Thread Eric Snow
Eric Snow added the comment: FTR, issue #34569 covered similar ground. -- status: pending -> open ___ Python tracker ___ ___

[issue35972] _xxsubinterpreters: channel_send() may truncate ints on 32-bit platforms

2019-02-12 Thread Eric Snow
Change by Eric Snow : -- components: +Interpreter Core -Extension Modules stage: patch review -> commit review status: open -> pending ___ Python tracker ___

[issue35972] _xxsubinterpreters: channel_send() may truncate ints on 32-bit platforms

2019-02-12 Thread Eric Snow
Eric Snow added the comment: Having slept on it and given the extra info you've provided I'm more comfortable with the proposed solution now. :) So the result will be that on 32-bit architectures only 32-bit (signed) ints will be allowed through channels. On 64-bit platforms (and higher)

[issue35972] _xxsubinterpreters: channel_send() may truncate ints on 32-bit platforms

2019-02-12 Thread STINNER Victor
STINNER Victor added the comment: What matters here is that _PyCrossInterpreterData.data type is void*. So the largest integer that you can store is intptr_t (signed) or uintptr_t (unsigned). In practice, sizeof(void*) == sizeof(intptr_t) == sizeof(uintptr_t) == sizeof(size_t) ==

[issue35972] _xxsubinterpreters: channel_send() may truncate ints on 32-bit platforms

2019-02-12 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: "long long" is mandated to be at least 64-bit by C99 (5.2.4.2.1 Sizes of integer types). If it were 32-bit, no warnings would have been issued. -- ___ Python tracker

[issue35972] _xxsubinterpreters: channel_send() may truncate ints on 32-bit platforms

2019-02-11 Thread Eric Snow
Eric Snow added the comment: Is "long long" (AKA int64_t) 32 bits or 64 bits on a 32-bit platform? It it's always 32 bits then there is no problem here. Otherwise I agree we have a problem to fix. My understanding is that it is the former (always 32 bits). --

[issue35972] _xxsubinterpreters: channel_send() may truncate ints on 32-bit platforms

2019-02-11 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +11852 stage: -> patch review ___ Python tracker ___ ___

[issue35972] _xxsubinterpreters: channel_send() may truncate ints on 32-bit platforms

2019-02-11 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : Victor Stinner pointed out that on x86 Gentoo Installed with X 3.x buildbot, there is a compiler warning: Python/pystate.c:1483:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]