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: iso-2022-jp crashes
Type: Stage:
Components: Unicode Versions: Python 2.4
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: hyeshik.chang Nosy List: hyeshik.chang, loewis
Priority: normal Keywords:

Created on 2004-08-07 11:10 by loewis, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg21981 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-08-07 11:10
I get

Python 2.4a2 (#88, Aug  7 2004, 12:37:23)
[GCC 3.3.4 (Debian 1:3.3.4-7)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> u"a\u9808".encode("iso-2022-jp")
Segmentation fault

The gdb backtrace is

#0  0x4047f45f in jisx0208_encoder (data=0x98080061,
length=0xbfffde1c)
    at
/home/martin/work/py2.4/Modules/cjkcodecs/_codecs_iso2022.c:632
#1  0x4047e915 in iso2022_encode (state=0xbfffdec8,
config=0x40481964, inbuf=0xbfffde60, inleft=2,
    outbuf=0xbfffde6c, outleft=20, flags=3) at
/home/martin/work/py2.4/Modules/cjkcodecs/_codecs_iso2022.c:187
#2  0x404835f9 in multibytecodec_encode
(codec=0x40481be4, state=0xbfffdec8, data=0xbfffdec4,
datalen=2550661217,
    errors=0x1, flags=3) at
/home/martin/work/py2.4/Modules/cjkcodecs/multibytecodec.c:432
#3  0x40483e24 in MultibyteCodec_Encode
(self=0x4029d070, args=0x98080061, kwargs=0x98080061)
    at
/home/martin/work/py2.4/Modules/cjkcodecs/multibytecodec.c:512
#4  0x081041fe in PyCFunction_Call (func=0x402ce24c,
arg=0x402ce12c, kw=0x4052a2a0) at Objects/methodobject.c:77

It crashes on line 632:

632             else TRYMAP_ENC(jisxcommon, coded, *data) {

because data does not point to valid memory.
msg21982 - (view) Author: Hyeshik Chang (hyeshik.chang) * (Python committer) Date: 2004-08-08 11:49
Logged In: YES 
user_id=55188

I failed to reproduce the problem on the exactly same
compiler and environment.  Can you please try a clean build
for it?
msg21983 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-08-08 13:18
Logged In: YES 
user_id=21627

I can't reproduce it either now ... closing it.
History
Date User Action Args
2022-04-11 14:56:06adminsetgithub: 40708
2004-08-07 11:10:40loewiscreate