On 1/10/06, M.-A. Lemburg <[EMAIL PROTECTED]> wrote:
>
> We'd also have to make sure that old extensions don't
> just import with a warning, since the change will introduce
> buffer overflows and seg faults in extensions that are not
> aware of the change.

I agree that on 64-bit platforms we should prevent the import.  In the
past we only provided a warning and the users were on their own.  This
is different.

If you read my massive checkin to check the return results of
Py_InitModule*(), you'll realize this isn't as simple as just failing
in Py_InitMethod*().  I was hoping to just modify Py_InitModule4() in
Python/modsupport.c to fail and return NULL.  That doesn't seem
practical given that we didn't check return results.  We will just
crash the interpreter with standard python 2.4 modules.

ISTM we need to modify _PyImport_LoadDynamicModule() in
Python/importdl.c before calling the init function (line 56, (*p)())
to check for some magic symbol that is defined only when compiling 2.5
and above.  For example we could add a static int  _64_bit_clean = 1;
in modsupport.h.  Without some trickery we will get this defined in
every .o file though, not just modules.

Other ideas?

n
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to