[Python-bugs-list] [ python-Bugs-588452 ] $DEBUG_PYTHON -O freeze.py broken

noreply@sourceforge.net noreply@sourceforge.net
Tue, 30 Jul 2002 03:09:36 -0700


Bugs item #588452, was opened at 2002-07-30 11:13
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=588452&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Hudson (mwh)
Assigned to: Thomas Heller (theller)
Summary: $DEBUG_PYTHON -O freeze.py broken

Initial Comment:
I have no idea how long this bug has existed for.  I
could well be a long time.  I noticed it while trying
to kill off SET_LINENO.

To reproduce, build a debug python, cd to Tools/freeze/
and run

$ /path/to/python -O freeze.py hello.py

I get a wodge ot modulefinder (I presume) output, and then:

freezing BaseHTTPServer ...
freezing FixTk ...
freezing SocketServer ...
freezing StringIO ...
freezing Tkconstants ...
freezing Tkinter ...
python: ../Python/marshal.c:66: w_more: Assertion
`(int)(char)(c) == (c)' failed.
Aborted (core dumped)

This is on x86; on my PPC laptop where I discovered
this, it gets quite a bit further before dying.  So
maybe some endianness fun.

The assert that fails is in a Py_SAFEDOWNCAST macro.

I have *no* idea where to start with this one;
assigning to Thomas because I have a vague recollection
he knows something about how freeze works <evil cackle>
-- feel free to reassign!

----------------------------------------------------------------------

>Comment By: Thomas Heller (theller)
Date: 2002-07-30 12:09

Message:
Logged In: YES 
user_id=11105

Fails for me too (Win2k, python debug build). But it is a 
marshal issue!
Here's a script to reproduce it when running with a debug 
build:
  import marshal; marshal.dumps([128] * 1000)
(anything between 128 and 255 will trigger the error, and the 
list must be large enough.

The debugger shows that w_long is called with x = 128, and 
than w_more() is called with c = 128, and the 
Py_SAFEDOWNCAST macro fails, maybe because char is 
signed on this platform.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=588452&group_id=5470