This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Fix unicode_aswidechar() with 4byte unicode and 2byte wchar_t, for AIX
Type: crash Stage: commit review
Components: Interpreter Core Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, David.Edelsohn, georg.brandl, haubi, serhiy.storchaka, terry.reedy, vstinner
Priority: normal Keywords: patch

Created on 2013-11-08 15:34 by haubi, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
python-3.2-aix-unicode_aswidechar.patch haubi, 2013-11-08 15:34 Fix typo with unicode conversion on AIX.
Messages (8)
msg202429 - (view) Author: Michael Haubenwallner (haubi) * Date: 2013-11-08 15:34
The problem raises during build already when trying to run setup.py, where ./python is unavailable to locate the 'encodings' module and aborts.

It turns out that (some of) the filenames searched for are broken due to wrong conversion from unicode (across wchar_t) to char.

Attached patch is for 3.2 only, should be obvious enough.

Thanks!
msg202434 - (view) Author: David Edelsohn (David.Edelsohn) * Date: 2013-11-08 16:44
LGTM
msg202454 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2013-11-09 01:27
By 'crash' ('abort'), do you mean segfault (or Windows equivalent) or an exit with traceback? 3.2 only gets security patches. Do you think this is a security issue? Does the problem exist with the latest 3.3 or 3.4?
msg202455 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-11-09 01:37
The bug is obvious and patch looks good to me. The problem is that Python 3.2 doesn't accept bugfixes anymore, any security fixes.

http://www.python.org/dev/peps/pep-0392/

3.2.5 schedule (regression fix release)

    3.2.5 final: May 13, 2013

-- Only security releases after 3.2.5 --

Georg Brandl, the release manager, may reconfirm that.

How is Python packaged on AIX? Can you integrate your fix in your package for Python 3.2?

The unicode type has been completly rewritten in Python 3.3, the bug was indirectly fixed during the rewrite. @Michael: can you confirm? You have to compile Python >= 3.3 in debug mode and run the test suite (./python -m test -j0 -r).
msg202607 - (view) Author: Michael Haubenwallner (haubi) * Date: 2013-11-11 07:30
It is the abort() libc function being called, causing a core file to be written. And I can see the backtrace from both the core file or when running in the debugger.

Yes: I already have included this fix into my python-3.2.5 packaging. I'm basically fine when this patch is accepted "technically", although I'd prefer to see it included in the next 3.2 release, if any. In fact I've reported it only because I've seen a 2.7 release recently - ohw, and 2.6.9 yesterday, so I've expected there eventually may be another 3.2 release too.

Yes: This bug does not exist since 3.3 any more due to the rewrite.

And indeed I'd also call this a security fix because it is of the "invalid memory read" type: I do see the filenames being truncated after 112 characters when building in some longer build-path.

Thank you!
msg227935 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-09-30 14:44
Georg, what is your decision?
msg227937 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2014-09-30 14:50
Looks obvious and is potentially a security fix, so it can/should go in.  Please add a NEWS entry.
msg228093 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2014-10-01 17:18
Committed in 18983332626b.
History
Date User Action Args
2022-04-11 14:57:53adminsetgithub: 63728
2014-10-01 17:18:36georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg228093
2014-09-30 14:56:45Arfreversetnosy: + Arfrever
2014-09-30 14:50:15georg.brandlsetmessages: + msg227937
2014-09-30 14:44:24serhiy.storchakasetnosy: + serhiy.storchaka

messages: + msg227935
stage: commit review
2013-11-11 07:30:49haubisetmessages: + msg202607
2013-11-09 01:37:15vstinnersetnosy: + vstinner
messages: + msg202455
2013-11-09 01:27:09terry.reedysetnosy: + georg.brandl, terry.reedy
messages: + msg202454
2013-11-08 16:44:51David.Edelsohnsetnosy: + David.Edelsohn
messages: + msg202434
2013-11-08 15:34:39haubicreate