[ python-Bugs-1316162 ] Segmentation fault with invalid "coding"

SourceForge.net noreply at sourceforge.net
Sat Oct 8 09:21:22 CEST 2005

Bugs item #1316162, was opened at 2005-10-07 13:24
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.4
Status: Open
>Resolution: Works For Me
Priority: 7
Submitted By: Humberto Diógenes (virtualspirit)
>Assigned to: Reinhold Birkenfeld (birkenfeld)
Summary: Segmentation fault with invalid "coding"

Initial Comment:
Reproducing the bug:
1. Create a file with a invalid encoding such as:
# -*- coding: utf-8i -*-

2. Run it:
python wrong_coding.py

3. Enjoy your segfault... :P

Versions tested:
 - Python 2.4.2 (Ubuntu Breezy)
 - Python 2.3.5 (Debian Sarge)

Running it directly with "python -c" gives MemoryError. Strace output:

# strace python -c "# -*- coding: utf-8i -*-"
(lots of searching through modules...)
pyc", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or 
write(2, "MemoryError", 11MemoryError)             = 11
write(2, "\n", 1
)                       = 1
rt_sigaction(SIGINT, NULL, {0x400297a0, [], SA_RESTORER, 
0x400c16f8}, 8) = 0
rt_sigaction(SIGINT, {SIG_DFL}, NULL, 8) = 0
exit_group(1)                           = ?


>Comment By: Neal Norwitz (nnorwitz)
Date: 2005-10-08 00:21

Logged In: YES 

Are you sure you can reproduce with 2.4 CVS branch.  I just
fixed this recently (Fix segfault with invalid coding. in
Misc/NEWS).  I can't reproduce on 2.4 CVS.  I expect this
probem exists in 2.4.2 and earlier. Checked in around
2005/10/02 at 01:48:49, bug #772896.

The memory error was fixed in CVS, but not backported. 
That's up to Anthony (release manager).


Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-10-07 23:24

Logged In: YES 

Reproducable here with 2.4.2 and the 2.4 CVS branch. It
seems fixed in HEAD.


You can respond by visiting: 

More information about the Python-bugs-list mailing list