Re: [xslt] segfaults & limits



On Wed, Jun 11, 2003 at 12:37:23AM +0200, Bernhard Zwischenbrugger wrote:
> Hi
>  
> > >> lately, we're running into more and more segfaults.
> > >   I can't really do anything with such a report honnestly.
> 
> For me I found a solution - use XSLT -> no runtime errors.
> But for Daniel it must be very hard...
> 
> Is there no possibility to avoid segfaults in C?
> I don't like C because of the segfaults but aren't there
> automatic checkers that help to find that kind of errors?
> 
> If there is no possibility to avoid segfaults in extension functions
> - is it possible to find the function that makes the segfault,
> collect this information and avoid bad functions?

  Okay in a nutshell the problem is the following:
    - allocation and deallocation of "temporary trees"
    - functions like node-set() or the use of variables create temporary trees
    - those trees must be deallocated when not used anymore
    - libxml2/libxslt does not do reference counting of nodes
    - a tree cannot be deallocated as long as a single nodeset somewhere
      reference one of its nodes
 the probelm is "when is it okay to free a tree". 
It's a problem typically due to the nature of C
It is a pain in the ... to try to handle
Extensions to the initial XSLT-1.0 data model are breaking all the 
reasons why working without reference counting was possible, this
is the case of node-set() and exslt:function constructs

C.f. the bugs in bugzilla about xslt instabilities which are not fixed.
I don't have the time and bandwith now to try again to fix the problem.
Each fix to the problem ends up breaking another part (e.g. 1.0.30 fixed
most of them but made exslt:function instable).
This is hard, none of the people who suggested extending the initial
XSLT-1.0 data model ever tried or understood the problems related to 
implementation not based on a garbage collected language apparently.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]