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

Armin Rigo arigo at tunes.org
Tue May 11 16:56:02 EDT 2004


Hello,

As discussed already some time ago, on Linux you can just write random data
into /proc/self/mem.  There is no way the interpreter can be guaranteed not to
crash.

Moreover, writing a bytecode verifier is a difficult task which goes against
the purpose of new.code(), which was to create strange bytecodes that the
compiler would never produce itself.  It is possible to write a bytecode
verifier that accepts all bytecodes produced by the compiler and then some
more, but it is not possible to write any algorithm that can tell for sure
whether some bytecode is going to crash or can be proved safe (not even to
mention that there exist bytecodes which are safe but that no mathematician --
not just no machine -- will ever be able to prove so).

More concretely, what about issuing a warning the first time new.code() is
called?  People who really use new.code() in their application can silence it
with the warnings module.


A bientot,

Armin.



More information about the Python-Dev mailing list