[Python-Dev] Is core dump always a bug? Advice requested

Tim Peters tim.one at comcast.net
Wed May 12 16:17:58 EDT 2004


[Armin]
>> Even without these, checking if a bytecode could possibly over/underflow
>> the stack is indeed equivalent to the halting problem; a silly example:
>>
>>     <some algorithm which may stop or not>
>>     POP_TOP
>>
>> This underflows the stack if and only if the algorithm stops.

[Guido]
> Uninteresting though, since no compiler will emit such code, and we
> only need to accept a reasonable subset.  The same arguments could
> prove that Java's bytecode verification is "impossible", but
> nevertheless it's done.

That's right.  Anyone who intends to "do something" here (as opposed to just
talking about it) is strongly encouraged to read the Java docs I posted a
link to last time.  Their answer to my original question ("verify what,
precisely?") is "what the algorithm described here checks".  As also with
Java's compile-time guarantee of "no use of uninitialized variables",
there's no attempt to solve impossible problems.  Instead they give a
reasonable, conservative algorithm, and define "it's OK" as "what this
algorithm allows".  The difference between that and theoretical perfection
isn't an issue in practice.





More information about the Python-Dev mailing list