strange behaviour when writing a large amount of data on stdout


M

Manlio Perillo

Regards.

On my system:
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]

Traceback (most recent call last):
File "xxx", line xxx, in ?
print data
IOError: [Errno 12] Not enough space


Can someone reproduce this bug?
I begin to think that my system is messed up...



Thanks Manlio Perillo
 
Ad

Advertisements

B

bruno at modulix

Manlio said:
Regards.

On my system:
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]


Traceback (most recent call last):
File "xxx", line xxx, in ?
print data
IOError: [Errno 12] Not enough space

Can someone reproduce this bug?

Not here, but it's a bipro amd64 with a couple Mb of ram !-)
(for the record, it works fine for far greater values, ie n = 128000000)
I begin to think that my system is messed up...

<troll>
OF course it's messed up, else it wouldn't be a real Windows box !-)
</troll>
 
J

jepler

That code works here.

Python2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32

It's Windows XP, Pentium 4, unknown amount of RAM. I'm running python.exe in a
console window. It also worked in IDLE.

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDhHMuJd01MZaTXX0RArcvAKCfg5BwudQXHtvWTXxj6R8BBb14eQCeOfN1
RdsnJ9yHOreKL7WBr2qVA2A=
=0+zD
-----END PGP SIGNATURE-----
 
F

Fredrik Lundh

Manlio said:
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]

Traceback (most recent call last):
File "xxx", line xxx, in ?
print data
IOError: [Errno 12] Not enough space

errno 12 is ENOMEM (that is, the system did not have enough memory
to finish an operation).

is the above a complete interpreter session? if it is, why did you xxx out
the filename (<stdin>) and line number?

</F>
 
M

Manlio Perillo

Manlio said:
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
n = 61409 + 1
data = 'x' * n
print data

Traceback (most recent call last):
File "xxx", line xxx, in ?
print data
IOError: [Errno 12] Not enough space

errno 12 is ENOMEM (that is, the system did not have enough memory
to finish an operation).

....

However I think the error message is not a good one.
Better a "Not enough memory"
is the above a complete interpreter session? if it is, why did you xxx out
the filename (<stdin>) and line number?

I put these instructions in a script and executed it (from the
console).

The same problem with a complete interpreter session.



Regards Manlio Perillo
 
M

Manlio Perillo

That code works here.

Python2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32

It's Windows XP, Pentium 4, unknown amount of RAM. I'm running python.exe in a
console window. It also worked in IDLE.

Jeff


Thanks.
So, it's seem to be a specific problem of Windows XP(?).

Nobody can test it on a Windows 98/2000 machine?



Regards Manlio Perillo
 
Ad

Advertisements

G

Grant Edwards

That code works here.

Python2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32

It's Windows XP, Pentium 4, unknown amount of RAM. I'm running python.exe in a
console window. It also worked in IDLE.

Jeff


Thanks.
So, it's seem to be a specific problem of Windows XP(?).

Nobody can test it on a Windows 98/2000 machine?

Works fine under Windows Me with 32MB of RAM

ActivePython 2.3.4 Build 233 (ActiveState Corp.) based on
Python 2.3.4 (#53, Oct 18 2004, 20:35:07) [MSC v.1200 32 bit (Intel)] on win32
 
F

Fredrik Lundh

Manlio said:
print data

Traceback (most recent call last):
File "xxx", line xxx, in ?
print data
IOError: [Errno 12] Not enough space

errno 12 is ENOMEM (that is, the system did not have enough memory
to finish an operation).

However I think the error message is not a good one.
Better a "Not enough memory"

the message text is provided by the operating system (or rather, by
the C library). I'm not sure rewriting error messages is a good thing...

(if Python itself runs out of memory, it'll raise a MemoryError instead)

</F>
 
F

Fredrik Lundh

Manlio said:
So, it's seem to be a specific problem of Windows XP(?).

Nobody can test it on a Windows 98/2000 machine?

works fine on assorted XP and 2000 boxes for me.

is the "n = 61409 + 1" stuff necessary, or do you get the same
problem for all outputs over a given size ? even if you just do,
say,

print '*'*61410

? does print '*'*61409 work? is it always the same number, or
does it vary depending on, say, what other programs you're using,
how much you've already printed to the console, etc. are you
using a standard cmd.exe in a standard console? no cygwin or
other oddities?

</F>
 
S

snoe

Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on
win32

No problems on Windows 2000 Pro with 512MB of RAM
 
M

Manlio Perillo

works fine on assorted XP and 2000 boxes for me.

That's very strange.
is the "n = 61409 + 1" stuff necessary, or do you get the same
problem for all outputs over a given size ? even if you just do,
say,

print '*'*61410

? does print '*'*61409 work?

It works for n said:
is it always the same number, or
does it vary depending on, say, what other programs you're using,
how much you've already printed to the console, etc.

Well, if I try with n = 61409 (that works), then it works even with n
But, as an example, with n = 614100, it fails again...
are you
using a standard cmd.exe in a standard console? no cygwin or
other oddities?

No.
Only cmd.exe, started with /k "chcp.com 1252"
(but is is the same without it).


What a mess!


P.S.
Do you have installed SP1 or SP2 on Windows XP?



Regards Manlio Perillo
 
Ad

Advertisements

D

Dennis Lee Bieber

So, it's seem to be a specific problem of Windows XP(?).
Pardon? I think the prior respondent said it /did/ work on WinXP.

Sure works on my WinXP Pro; 3.4GHz, 2GB RAM -- Even setting

n = 99999 + 1
Nobody can test it on a Windows 98/2000 machine?

W98se, 733MHz, 256MB; n = 99999 + 1

No problem -- just took twice as long to display


Python 2.3.x in both cases.
--
 
M

Manlio Perillo

Pardon? I think the prior respondent said it /did/ work on WinXP.

Sure works on my WinXP Pro; 3.4GHz, 2GB RAM -- Even setting

I have added a question mark...

However: did you have installed SP1 or SP2?




Regards Manlio Perillo
 
F

Fredrik Lundh

Manlio said:
I have added a question mark...

However: did you have installed SP1 or SP2?

running XP without service packs is a really bad idea. you're not
telling me that you haven't updated, are you?

(the machines I tested on are all fully up to date)

</F>
 
M

Manlio Perillo

running XP without service packs is a really bad idea. you're not
telling me that you haven't updated, are you?

I have only installed security patches...

The problem, here, is that when running the bug script with Twisted,
the Python interpreter crashes (and this should never happen).





Regards Manlio Perillo
 
B

Bengt Richter

Manlio said:
print data

Traceback (most recent call last):
File "xxx", line xxx, in ?
print data
IOError: [Errno 12] Not enough space

errno 12 is ENOMEM (that is, the system did not have enough memory
to finish an operation).

However I think the error message is not a good one.
Better a "Not enough memory"

the message text is provided by the operating system (or rather, by
the C library). I'm not sure rewriting error messages is a good thing...

(if Python itself runs out of memory, it'll raise a MemoryError instead)
Maybe there's a bare except: somewhere blocking earlier & perhaps more informative
messages?

If windows has been running a long time (a few days or a week may be long ;-) it
may get fragmented in some smallish memory arena reserved for special things (I forgot
what versions, but I wouldn't be surprised if something still had s specialized limit).

Does the program involve dynamic generation of desktop icons by any chance? Especially
a lot of large true-color ones? I have some faint inkling of some correlation of that
and memory problems with still huge amounts of heap memory available.


Has the OP rebooted and just run the offending program alone?

BTW, if the OP wants to find out how much memory is on the windows system,
the amount of memory probably shows in the "about" window of the task manager
(the NT task manager will give you a scrolling real-time graph of different kinds
of memory usage as well). Also if the OP has windows word editor (probably winword.exe
will start it from the console command line), the "about" dialog may have a
"system info ..." button that will show memory and a lot more. What that button
runs is C:\Program Files\Common Files\Microsoft Shared\MSInfo\MSINFO32.exe
on my system. Since it's accessible from Word, I wouldn't think it would be
too unsafe to run, but I guess the OP might not want to start diagnostic things
on arbitrary devices etc., if that's accessible from his session.

Regards,
Bengt Richter
 
Ad

Advertisements

B

bonono

Bengt said:
If windows has been running a long time (a few days or a week may be long ;-) it
may get fragmented in some smallish memory arena reserved for special things (I forgot
what versions, but I wouldn't be surprised if something still had s specialized limit).
I know it is a tease and not serious but I run my XP for weeks without
rebooting without any problem, just using the sleep/suspend/resume. So
it really is myth that Windows cannot be running long with reboot.
 
B

Bengt Richter

I know it is a tease and not serious but I run my XP for weeks without
rebooting without any problem, just using the sleep/suspend/resume. So
it really is myth that Windows cannot be running long with reboot.
Depends on what you run ;-) Maybe how many times buggy apps die in unusual ways.
Or worse, buggy drivers. Your car might have bad 4-wheel drive that you never used,
so you thought your car reliable ;-)

Regards,
Bengt Richter
 
B

bonono

Bengt said:
Depends on what you run ;-) Maybe how many times buggy apps die in unusual ways.
Or worse, buggy drivers. Your car might have bad 4-wheel drive that you never used,
so you thought your car reliable ;-)
Sure, no casual toys are allowed. But this is true in general, whatever
OS it is.
 
Ad

Advertisements

D

Dennis Lee Bieber

However: did you have installed SP1 or SP2?
This machine is SP2... Forgive me if I don't dig up my laptop, which
has everything /except/ the SP2 mass patch...
--
 
Ad

Advertisements


Top