[xml] Re: update of the XML CVS code

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Tue Jun 22 1999 - 02:54:17 EDT


On Mon, Jun 21, 1999 at 10:31:03PM -0500, Miguel de Icaza wrote:
>
> > I just commited a bunch of changes. At least one breaks the libxml.so.0.0.0
> > binary interface, more precisely xmlEncodeEntities() is now reentrant, but
> > the result string has to freed now. Problem is that freeing the result of
> > the previous implementation results in a SIGSEGV :-\
>
> Daniel, this change is pretty bad, because it means that both released
> Gnumeric and released GnoRPM will memory leak with the the new
> libraries and they will crash if used with the new libraries.

  Released Gnumeric an GnoRPM are linked against libxml.so.0 which
have the old behaviour. The new semantic is present only in libxml.so.1
wich won't be used unless you recompile the application, right ?
  And if you release a new binary version, then force the free and
make sure the dependancy ia against libxml.so.1 .
  
> Could you please consider making a new release of the XML libraries
> reverting this change?
>
> I suggest a binary compatible change like this:
>
> 1. Revert the patch.
> 2. Make the prototype for xmlEncodeEntities be:
>
> const CHAR *xmlEncodeEntities(xmlDocPtr doc, const CHAR *input);
>
> The "const" can be used to tell the user "I am returning
> something that I own, do not dare free()ing it", which is a
> convention we use on the gnome-libs.
> 3. Provide a *new* function entry point:
>
> CHAR *xmlEncodeEntities_r (xmlDocPtr doc, const CHAR *input);
>
> Which can just be:
>
> CHAR *xmlEncodeEntities_r (xmlDocPtr doc, const CHAR *input)
> {
> return g_strdup (xmlEncodeEntities (doc, input));
> }
>
> That way we do not have to resort to terrible hacks in Gnumeric/GnoRPM
> nor any other applications to handle the 2 different APIs.

  I really don't want people to wonder whether their code is reentrant or not
it has to be, the error was in releasing an initial version which was not.
I plead guilty for this one, but would rather avoid having to maintain
both APIs forever, the major revision change in the libxml is the opportunity
to change the API in a sane way IMHO,

Daniel

-- 
	    [Yes, I have moved back to France !]
Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes  | Today's Bookmarks :
Tel : +33 476 615 257  | 655, avenue de l'Europe | Linux, WWW, rpmfind,
Fax : +33 476 615 207  | 38330 Montbonnot FRANCE | rpm2html, XML,
http://www.w3.org/People/W3Cpeople.html#Veillard | badminton, and Kaffe.
----
Message from the list xml@rufus.w3.org
Archived at : http://rufus.w3.org/veillard/XML/messages
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rufus.w3.org


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:29:39 EDT