bogus OverflowError: python bug?

Luke luked at xplantechnology.com
Tue Jun 8 05:35:11 CEST 2004


Martin v. Löwis wrote:

>> Surely that line of source code shouldn't be able to produce an 
>> OverflowError?
> 
> 
> It actually might. If the internal memory of the interpreter got
> corrupted by a buggy extension module, any code may cause any exception.

Good point, though I would expect a memory corruption bug to cause less 
predictable behaviour (I can repeat this problem regularly in a large 
multithreaded program, and the bogus exception is always at this specific 
line of python).

>> (BTW, I know that a traceback can sometimes print the wrong source 
>> line when
>> the .py file has been modified since importing the module into the python
>> process, but I was careful to avoid this problem).
> 
> 
> There are other possible causes for bogus exceptions. A common one is 
> that Python set an exception at some point, but the extension module
> forgot to forward the exception. Then, the next time Python checks
> for exceptions, it sees that there still is an exception pending, and
> raises it. That exception will make no sense that that point, of course.

Oh yes of course, thanks... this sounds to be more consistent with the 
repeatability of the bogus exception.

> Only a gdb session can tell what really happened.

Ouch.  I might try searching the omniORB extension module for a 
forgot-to-forward-exception bug first.

Thanks for your help, Martin.

Luke.



More information about the Python-list mailing list