classification
Title: numeric overflow in IDLE
Type: crash Stage:
Components: IDLE Versions: Python 2.5
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: kbk Nosy List: Qodosh, amaury.forgeotdarc, kbk
Priority: normal Keywords:

Created on 2008-04-08 15:19 by Qodosh, last changed 2008-05-31 21:57 by kbk. This issue is now closed.

Files
File name Uploaded Description Edit
for_loop.py Qodosh, 2008-04-08 15:19 for loop
unnamed Qodosh, 2008-05-22 22:46
Messages (8)
msg65167 - (view) Author: Tim Wilcoxson (Qodosh) Date: 2008-04-08 15:19
According to the documentation there is not suppose to be numeric
overflow in python 2.5. However....

If you run a for loop with the range(1, 300000000)a couple of times (for
me 2 or 3 times worked) in the IDLE (1.2.2)GUI . It will cause what
appears to be a memory leak, at least under vista home edition. Haven't
tested out other platforms yet. Vista's logon process will fail to start
security dialog as well if you try to ctrl-alt-del. Which effectively
cripples the system. I haven't tested to see if the condition will get
better over long period of time. I've waited a max of 10 minutes for the
system to respond. 

I tested running the script multiple times under cmd in windows, and it
spits out a memory error after a minute of not responding and then the
cmd prompts will close and the system will begin responding. So it
appears to be isolated to IDLE.
msg65177 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-04-08 16:08
I wonder why do you suspect a numeric overflow.

It may very well be that the system needs more time to become
responsive, when the script is run by Idle.
Idle actually spawns another python process to execute commands.

> then the cmd prompts will close
Did you try to close the cmd window?
msg65192 - (view) Author: Tim Wilcoxson (Qodosh) Date: 2008-04-08 16:51
msg65177, i did try to close cmd. thats why it closed. i wasnt clear
enough. my apologies.  it merely lags in command line in gives a memory
error. in IDLE, it wont respond, and it gives a logon process erorr in
windows if you try to view the security dialog. Let's just say this. i
got dressed, walked out my apartment several flights of strairs, went
across a large parking lot, grabbed a bag, came back, got comfortable,
looked at my computer, and it was still completely unresponsive. I did
this several times, same problem.
msg65201 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-04-08 18:11
So let's it interpret this way:
range(1, 300000000) consumes more and more memory, and causes the system
to hang.
When python.exe is in a console, you have the ability to close the
window and kill the process.
When using Idle, the interpreter cannot be killed so easily: I suppose
you closed the main windows, but this did not kill the subprocess used
to run commands.

BTW1: did you try xrange(1, 30000000)

BTW2: msg65177 is not a pseudo... it's the message ID in the bug tracker ;-)
msg65205 - (view) Author: Tim Wilcoxson (Qodosh) Date: 2008-04-08 19:14
not a nick aye? lol. I am new cant you tell.

And when i ran the script nothing could be closed. And, yes, I realize
it could be a memory exhaustion issue with windows. windows is notorious
for crappy resource handling. However, my concern came when I actually
got an error and a clean exit with cmd prompt but not with the GUI.
explorer.exe didn't crash. And I've had memory exhaustion under windows
before, and it still allowed me enough memory to (albeit slowly)
ctrl-alt-del. However the login process wouldnt even function. I did try
xrange, it hung as the other.
msg67200 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2008-05-22 17:06
When this is running, what happens if you hit Control-c a few times, 
especially in the first few seconds?  Does it abort with a 
KeyboardInterrupt? Does it stop responding to Control-c after the window 
fills up?

Note that IDLE slows down when very large quantities of text are printed 
to the shell window.  This is an issue with the Tk library.

The subprocess is supposed to exit when it notices that the socket has 
closed.  This doesn't work well on Windows, unfortunately.  We are 
thinking about it ;-)

It doesn't seem that what you are attempting to fix has any realistic 
application.

I don't run Vista.  Check your resources right after you start your 
code.  Is your system unresponsive because you are running out of memory 
or because you are using CPU 100%?


Patient: My head hurts when I bang it against a wall.
Doctor: So, don't do that!
msg67202 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2008-05-22 18:33
BTW, instead of a reboot, use Task Manager (or whatever they needlessly 
renamed it to on Vista :) to kill all python processes.  That should free 
up your machine.
msg67208 - (view) Author: Tim Wilcoxson (Qodosh) Date: 2008-05-22 22:46
I guess my only reply is....fair enough.

heh.

On Thu, May 22, 2008 at 1:07 PM, Kurt B. Kaiser <report@bugs.python.org>
wrote:

>
> Kurt B. Kaiser <kbk@shore.net> added the comment:
>
> When this is running, what happens if you hit Control-c a few times,
> especially in the first few seconds?  Does it abort with a
> KeyboardInterrupt? Does it stop responding to Control-c after the window
> fills up?
>
> Note that IDLE slows down when very large quantities of text are printed
> to the shell window.  This is an issue with the Tk library.
>
> The subprocess is supposed to exit when it notices that the socket has
> closed.  This doesn't work well on Windows, unfortunately.  We are
> thinking about it ;-)
>
> It doesn't seem that what you are attempting to fix has any realistic
> application.
>
> I don't run Vista.  Check your resources right after you start your
> code.  Is your system unresponsive because you are running out of memory
> or because you are using CPU 100%?
>
>
> Patient: My head hurts when I bang it against a wall.
> Doctor: So, don't do that!
>
> __________________________________
> Tracker <report@bugs.python.org>
> <http://bugs.python.org/issue2584>
> __________________________________
>
History
Date User Action Args
2008-05-31 21:57:52kbksetstatus: open -> closed
resolution: wont fix
2008-05-22 22:46:23Qodoshsetfiles: + unnamed
messages: + msg67208
2008-05-22 18:34:04kbksetmessages: + msg67202
2008-05-22 17:07:09kbksetmessages: + msg67200
2008-04-26 21:03:09kbksetpriority: normal
assignee: kbk
nosy: + kbk
2008-04-08 19:14:25Qodoshsetmessages: + msg65205
2008-04-08 18:11:52amaury.forgeotdarcsetmessages: + msg65201
2008-04-08 16:51:01Qodoshsetmessages: + msg65192
2008-04-08 16:08:31amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg65177
2008-04-08 15:19:12Qodoshcreate