[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] Nasty crash running sound.py then stars.py



Hi,

Recently upgraded to pygame-1.4 and decided to run through the examples.
All went fine until I ran "sound.py" followed by "stars.py" which
produced this :

PYTHON caused an invalid page fault in
module <unknown> at 0000:b00db560. etc., etc.,

and prevented any further execution of python. If the computer wasn't
restarted I was treated to a BSOD and forced use of the reset-button,
ouch!

This was 100% reproducible, and when I tried pygame-1.3 it did the same
thing. I then wasted a few hours reinstalling python, my sound and video
drivers and DirectX. I even tried the old Windows95 partition I hadn't
used for ages. Still insisted on crashing.

Tried on my Win2k machine and an old Win95 box in the corner, both were
fine.

Also discovered that if I put :

time.delay(1000)
pygame.quit()
print "Exiting..."

at the end of "sound.py" the problem "went away". This, of course, is not a
solution but possibly a clue...


The next day, I discovered that pygame-1.1 worked fine, but from 1.2 onwards
this one machine insisted on crashing. Did a diff of the code and came
across some changes in the initialization code in "base.c".

There is a chunk of code that has moved from initbase() to init() and is
executed only once by using the static variable "initialized_once".
I also noticed that sound.py doesn't explicitly call pygame.init().

So I try moving the code back into initbase() and lo-and-behold the problem
is gone. I move the code back into init() again and it returns. 100%
reproducible.
[Also checked that everything was still ok with my other machines]

I am not a Python/C expert but initbase() is the entry point
into the DLL and surely an excellent spot for one-time initialization.

So, Pete, I was just wondering why the code moved and if it would be ok if
it was moved back again?

Also wondering if anyone else can reproduce this problem (maybe intermitent
on other systems)?

cheers,
John Popplewell.
PS. Eliminated the possibility that it was an SDL version problem
by using the latest win32 SDL binaries, and also my own compiled
versions - no effect on the results.

[Using Windows98SE, AWE64 soundcard (ISA bus), TNT2 M64 video, 256M RAM,
DirectX 8.0, AMD K6-2 400Mhz, SuperSocket-7 MOBO, Python 2.0.1]


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org