[Tutor] Illegal Operation??

D-Man dsh8290@rit.edu
Wed, 30 May 2001 08:14:52 -0400


On Wed, May 30, 2001 at 07:33:07PM +1000, Glen Wheeler wrote:
|   Hello again,
| 
|   Well, this one definitely has me stumped (yes, even more so than
|   the phantom radiobutton).  After playing my game for a period of
|   time, PYTHON will cause an illegal operation in module tcl83.dll
|   and it shuts down.

Ooh, fun with windows.  At least *nix systems give you a core dump to
inspect!  I have a friend who had a temporary job doing C++ work on
Windows a few months ago.  He said that sometimes he got "Invalid
operation in kernel.dll" messages.  Not surprising that the kernel
didn't work right, but needless to say it was his code that needed
fixing.  He never wants to do development on windows again.

|   Needless to say this is very annoying.  It happens at the same
|   memory address every single time, so I imagine it is something
|   happening around there.  I'm running win98.
|   My script is a little...large to be posting here.  Also, if it was
|   an error with my code then wouldn't there be at least some kind of
|   traceback?

Only if it is an error that Python is prepared to check for.  It is
conceivable that there is some condition not being checked by tcl,
then it executes some invalid C/C++ level instruction (it is a dll)
causing the crash.

I would recommend adding a bunch of print statements in strategic
locations in your script.  Since you are using threads be sure to
include the thread name in the output (Java has a  Thread.getName()
method).  Output such as "got to this function" is sufficient.  When
it crashes, see the last thing that was printed (oh, yeah, be sure to
flush stdout so that it actually makes it to the screen ;-)) and
follow the code from there adding more prints until the problem is
identified.

HTH,
-D