too long lines were shrinked: building 'ossaudiodev' extension x86_64-pc-linux-gnu-gcc -fPIC -fno-strict-aliasing -O2 -pipe -march=native -fno-diagnostics-color -fwrapv -DNDEBUG -I. -IInclude -I./Include -I/var/tmp/portage/dev-lang/python-2.7.18_p16-r1/work/Python-2.7.18/Include -I/var/tmp/portage/dev-lang/python-2.7.18_p16-r1/work/Python-2.7.18 -c /var/tmp/por x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -fno-strict-aliasing -O2 -pipe -march=native -fno-diagnostics-color -fwrapv -DNDEBUG -I. -IInclude -I./Include build/temp.linux-x86_64-2.7/v building '_tkinter' extension x86_64-pc-linux-gnu-gcc -fPIC -fno-strict-aliasing -O2 -pipe -march=native -fno-diagnostics-color -fwrapv -DNDEBUG -DWITH_APPINIT=1 -DWITH_BLT=1 -I/usr/X11/include -I. -IInclude -I./Include -I/var/tmp/portage/dev-lang/python-2.7.18_p16-r1/work/Python-2.7.18/Include -I/var/tmp/portage/dev-lang/python /var/tmp/portage/dev-lang/python-2.7.18_p16-r1/work/Python-2.7.18/Modules/_tkinter.c: In function 'AsObj': /var/tmp/portage/dev-lang/python-2.7.18_p16-r1/work/Python-2.7.18/Modules/_tkinter.c:1178:38: error: passing argument 1 of 'Tcl_NewUnicodeObj' from incompatible pointer type [-Wincompatible-pointer-types] 1178 | return Tcl_NewUnicodeObj(inbuf, size); | ^~~~~ ------------------------------------------------------------------- This is an unstable amd64 chroot image at a tinderbox (==build bot) name: 17.1_desktop-20240104-075517 ------------------------------------------------------------------- gcc-config -l: [1] x86_64-pc-linux-gnu-10 [2] x86_64-pc-linux-gnu-14 * clang/llvm (if any): clang version 17.0.6 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm/17/bin Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg /usr/lib/llvm/17 17.0.6 Python 3.11.7 Available Ruby profiles: (none found) Available Rust versions: [1] rust-bin-1.74.1 * The following VMs are available for generation-2: 1) Eclipse Temurin JDK 11.0.20.1_p1 [openjdk-bin-11] 2) Eclipse Temurin JDK 17.0.8.1_p1 [openjdk-bin-17] *) Eclipse Temurin JDK 21.0.1_p12 [openjdk-bin-21] 4) Eclipse Temurin JDK 8.382_p05 [openjdk-bin-8] Available Java Virtual Machines: [1] openjdk-bin-8 [2] openjdk-bin-11 [3] openjdk-bin-17 [4] openjdk-bin-21 system-vm The Glorious Glasgow Haskell Compilation System, version 9.2.8 php cli (if any): go version go1.21.5 linux/amd64 HEAD of ::gentoo commit 14ada442667e801c344a75949f1d9242d7b29c5f Author: Repository mirror & CI <repomirrorci@gentoo.org> Date: Sat Jan 6 22:03:04 2024 +0000 2024-01-06 22:03:03 UTC emerge -qpvO dev-lang/python [ebuild R ] dev-lang/python-3.12.1_p1 USE="ensurepip gdbm ncurses pgo readline sqlite ssl tk -bluetooth -build -debug -examples -libedit -test (-valgrind) -verify-sig"
Created attachment 881609 [details] emerge-info.txt
Created attachment 881610 [details] dev-lang:python-2.7.18_p16-r1:20240106-221922.log
Created attachment 881611 [details] emerge-history.txt
Created attachment 881612 [details] environment
Created attachment 881613 [details] etc.clang.tar.xz
Created attachment 881614 [details] etc.portage.tar.xz
Created attachment 881615 [details] logs.tar.xz
Created attachment 881616 [details] qlist-info.txt.xz
Created attachment 881617 [details] temp.tar.xz
I think this got fixed by https://github.com/python/cpython/commit/dc191245d8f63f5ab41afff0468b7463a07e7b00.
The fix is trivial: diff '--color=auto' -ur Python-2.7.18.orig/Modules/_tkinter.c Python-2.7.18/Modules/_tkinter.c --- Python-2.7.18.orig/Modules/_tkinter.c 2020-04-19 23:13:39.000000000 +0200 +++ Python-2.7.18/Modules/_tkinter.c 2024-07-05 16:00:54.630854897 +0200 @@ -1175,7 +1175,7 @@ return NULL; } if (sizeof(Py_UNICODE) == sizeof(Tcl_UniChar)) - return Tcl_NewUnicodeObj(inbuf, size); + return Tcl_NewUnicodeObj((const Tcl_UniChar *)inbuf, size); allocsize = ((size_t)size) * sizeof(Tcl_UniChar); if (allocsize >= size) outbuf = (Tcl_UniChar*)attemptckalloc(allocsize);
Casting requires rationale.
*** Bug 942416 has been marked as a duplicate of this bug. ***
*** Bug 945380 has been marked as a duplicate of this bug. ***
Created attachment 915817 [details, diff] Patch properly casting python integer pointer to Tcl integer pointer I looked it over, and think the cast is correct for x86 (and amd64). I submitted a patch with the cast (and the other two places I saw where the cast was implicitly being made), and a brief description of why I think it is OK. Basically, there are two different integer pointers which are the same size on amd64, but different sizes on x86. The code contains a runtime check that the sizes are the same, and if so, casts the pointers and makes the assignment. If they are not the same, it allocates memory and copies the values over one at a time. Technically, I think one of the ``integers'' is a wide char, but that should be treated the same as an integer if the sizes match. Please let me know if you would prefer I do more research into this.
At this point, I'd rather remove USE=tk entirely. There's no point in putting any effort to Python 2.7, and the fewer features it has, the fewer vulnerabilities it opens up.
(In reply to Anon Emuss from comment #15) > Created attachment 915817 [details, diff] [details, diff] > Patch properly casting python integer pointer to Tcl integer pointer > > I looked it over, and think the cast is correct for x86 (and amd64). I > submitted a patch with the cast (and the other two places I saw where the > cast was implicitly being made), and a brief description of why I think it > is OK. Basically, there are two different integer pointers which are the > same size on amd64, but different sizes on x86. The code contains a runtime > check that the sizes are the same, and if so, casts the pointers and makes > the assignment. If they are not the same, it allocates memory and copies > the values over one at a time. Technically, I think one of the ``integers'' > is a wide char, but that should be treated the same as an integer if the > sizes match. > > Please let me know if you would prefer I do more research into this. Thanks. The explanation LGTM (and I appreciate you doing that).
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f8e9125cd3a4caae144f8d5d30ebe4884f31011f commit f8e9125cd3a4caae144f8d5d30ebe4884f31011f Author: Sam James <sam@gentoo.org> AuthorDate: 2025-02-25 07:51:12 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-02-25 07:52:28 +0000 dev-lang/python: drop USE=tk from 2.7 As discussed on IRC. Python 2.7 is on life-support and it needs patching to work w/ Modern C. Closes: https://bugs.gentoo.org/921571 Signed-off-by: Sam James <sam@gentoo.org> dev-lang/python/python-2.7.18_p16-r2.ebuild | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-)