[ python-Bugs-1772916 ] xmlrpclib crash when PyXML installed

SourceForge.net noreply at sourceforge.net
Tue Aug 14 08:23:25 CEST 2007


Bugs item #1772916, was opened at 2007-08-13 18:15
Message generated for change (Comment added) made by ldeller
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1772916&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: lplatypus (ldeller)
Assigned to: Nobody/Anonymous (nobody)
Summary: xmlrpclib crash when PyXML installed

Initial Comment:
The xmlrpclib module in the standard library will use a 3rd party C extension called "sgmlop" if it is present.

The last version of PyXML (0.8.4) includes this module, but it causes crashes with Python 2.5 due to the use of mismatched memory allocation/deallocation functions (PyObject_NEW and PyMem_DEL).

It is unlikely that sgmlop will be fixed, as PyXML is no longer maintained.  Therefore sgmlop support should be removed from xmlrpclib.

(In case you're wondering why anyone would install PyXML with Python 2.5 anyway:  there are still some 3rd party libraries which depend upon PyXML, such as ZSI and twisted).

----------------------------------------------------------------------

>Comment By: lplatypus (ldeller)
Date: 2007-08-14 16:23

Message:
Logged In: YES 
user_id=1534394
Originator: YES

Yes the standalone sgmlop-1.1.1 looks fine: in its sgmlop.c I can see that
matching allocator and deallocator functions are used.

I installed PyXML-0.8.4 from source ("python setup.py install" on Win32
which picked up the C compiler from MSVS7.1).  The cause of the problem is
quite visible in the PyXML source code (see that PyObject_NEW and PyMem_DEL
are used together):
   
http://pyxml.cvs.sourceforge.net/pyxml/xml/extensions/sgmlop.c?view=markup

Interestingly PyXML-0.8.4 was released more recently than sgmlop-1.1.1.  I
guess they weren't keeping in sync with each other.

----------------------------------------------------------------------

Comment By: Alan McIntyre (alanmcintyre)
Date: 2007-08-14 13:32

Message:
Logged In: YES 
user_id=1115903
Originator: NO

I tried out xmlrpclib on the trunk (2.6) with sgmlop-1.1.1 and it works
just fine.  At the moment I don't have time to try out PyXML, but seeing
that the most recent sgmlop works with xmlrpclib makes me lean towards not
removing sgmlop support (not that I have a say about it, but still).

How did you install PyXML? If it wasn't from source or from an installer
compiled for 2.5, that might be a problem. If PyXML installed from source
or compiled for 2.5 still causes this problem, it could be that it needs to
be updated to the current sgmlop.


----------------------------------------------------------------------

Comment By: lplatypus (ldeller)
Date: 2007-08-14 11:07

Message:
Logged In: YES 
user_id=1534394
Originator: YES

Choice of XML parser is an implementation detail of xmlrpclib not visible
to users of the module.  This change would not affect the behaviour of
xmlrpclib (other than to fix a crash introduced in Python 2.5).  Does this
mean that a DeprecationWarning would not be necessary?  Does it also mean
that the fix might qualify for the maintenance branch?

Adding a DeprecationWarning in 2.6 without removing use of sgmlop is
pointless, because the DeprecationWarning would be followed by a process
crash anyway.

----------------------------------------------------------------------

Comment By: Alan McIntyre (alanmcintyre)
Date: 2007-08-13 21:06

Message:
Logged In: YES 
user_id=1115903
Originator: NO

I'm assuming that stuff won't be removed from 2.5 because it's in
maintenance, so should this be removed or changed to raise a deprecation
warning in 2.6?

As an aside, how about removing references to _xmlrpclib (which appears to
have been removed long ago) as well?  

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1772916&group_id=5470


More information about the Python-bugs-list mailing list