[Python-checkins] r53420 - in python/trunk: Lib/sqlite3/dbapi2.py Lib/sqlite3/test/factory.py Lib/sqlite3/test/regression.py Lib/sqlite3/test/types.py Modules/_sqlite/cache.c Modules/_sqlite/cache.h Modules/_sqlite/connection.c Modules/_sqlite/connection.h Modules/_sqlite/cursor.c Modules/_sqlite/cursor.h Modules/_sqlite/microprotocols.c Modules/_sqlite/microprotocols.h Modules/_sqlite/module.c Modules/_sqlite/module.h Modules/_sqlite/prepare_protocol.c Modules/_sqlite/prepare_protocol.h Modules/_sqlite/row.c Modules/_sqlite/row.h Modules/_sqlite/statement.c Modules/_sqlite/statement.h Modules/_sqlite/util.c Modules/_sqlite/util.h

"Martin v. Löwis" martin at v.loewis.de
Sun Jan 14 09:04:45 CET 2007


gerhard.haering schrieb:
> - gcc on Linux sucks. It exports all symbols by default in shared
>   libraries, so if symbols are not unique it can lead to problems with
>   symbol lookup.  pysqlite used to crash under Apache when mod_cache
>   was enabled because both modules had the symbol cache_init. I fixed
>   this by applying the prefix pysqlite_ almost everywhere. Sigh.

The right reaction should have been to make more symbols static; that
includes cache_init. Static symbols don't conflict dynamically. They
are guaranteed to be visible only in the translation unit (i.e. C file)
where they are defined.

Also, it's not gcc which sucks but Apache. Python loads extension
modules with RTLD_LOCAL, causing all symbols of the module to be
encapsulated and not available for relocation of other shared objects.
If Apache would have also used RTLD_LOCAL to load its own modules,
this problem would not exist.

Regards,
Martin



More information about the Python-checkins mailing list