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: a exception ocurrs when compiling a Python file
Type: Stage:
Components: Interpreter Core Versions: Python 2.2
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, jackjansen, pablo_yabo, terry.reedy
Priority: normal Keywords:

Created on 2003-12-09 12:57 by pablo_yabo, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
stack.txt pablo_yabo, 2003-12-09 12:57 stack trace
Messages (5)
msg19346 - (view) Author: Pablo Yabo (pablo_yabo) Date: 2003-12-09 12:57
a exception ocurrs when compiling some big python files 
(more than 250kb) using the debug library 
(python22_d.dll).
When using the release library in the release version of 
my application the files compile succesfully. 
Attached is the stack trace.

msg19347 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2003-12-15 04:26
Logged In: YES 
user_id=593130

I do not believe this is a compiler bug.  While compiler input 
may by theoretically unbounded, all practical compilers have 
practical limitations that often depend, in part, on the 
amount of memory on your particular system.  This is one 
reason for import and include mechanisms.

As I understand the stack trace, the exception occured 
during an attempt to reallocate memory (ie, move an object 
to a larger block).  (Including Python's exception trace would 
make this clearer).  I presume debug mode uses more memory 
so you hit the limit sooner with that mode.

Your solutions are to either 1) add more memory to your 
computer (should probably work) or try on a system with 
more memory or 2) break your source into more modules 
(certain to work if the problem is, indeed, simply running out 
of memory).  250K is not merely big but huge.  The largest 
file in the standard lib is under 100K and the median is around 
10K.

Unless you have more reason to think this a bug, please 
withdraw or close.
msg19348 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2003-12-15 10:04
Logged In: YES 
user_id=45365

I agree with the original poster that this is a bug. While it may not 
be fixable (and definitely not in the general case) you should get a 
decent error message from Python (at the very least a 
MemoryError), not a crash of the interpreter.
msg19349 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2003-12-16 15:37
Logged In: YES 
user_id=593130

If, by 'exception', PY indeed means a system crash rather 
than a Python exception, then I agree that more graceful 
termination would be desireable.  However, I believe someone 
once pointed out on Py-Dev list that memory failures may 
make interpreter operation, even to produce a Python stack 
trace, impossible.  In any case, the details of system 
software and hardware, including memory, needed to even 
discuss this, are still missing.
msg19350 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-02-20 15:39
Logged In: YES 
user_id=849994

This is likely to be resolved with the new AST compiler in 2.5.

If not, please open another bug report then.
History
Date User Action Args
2022-04-11 14:56:01adminsetgithub: 39686
2003-12-09 12:57:40pablo_yabocreate