Re: [xslt] xsltApplyStylesheet not returning?

On Thu, 13 Feb 2003, Daniel Veillard wrote:

> On Thu, Feb 13, 2003 at 11:36:13AM +0000, Matt Sergeant wrote:
> > If a stylesheet causes an error (in my case it was a variable being used
> > that never existed) xsltApplyStylesheet doesn't seem to return - is it
> > doing a longjmp or something?
> >
> > In LibXSLT.xs I have:
> >
> >         xsltSetGenericDebugFunc(NULL, NULL);
> >         real_dom = xsltApplyStylesheet(self, doc, xslt_params);
> >         if (real_dom == NULL) {
> >            // handle error
> >         }
> >
> > And it never gets to teh if() statement if there's an error. But it
> > doesn't segfault - for some reason it's causing my method (implemented in
> > perl XS) to just return, which causes perl's stack to be corrupt and I get
> > a perl error.
>   Well, if it was C code I would say you have a compiler error.
> But it's apparently not C code. At the C level the function will return,
> there is no longjmp or anything like that, unless this was added to
> one of the extension callbacks. libxslt code is purely procedural.

Well it is C code. XS is just a simple wrapper that gives you easier
access to the perl stack. It's all converted to C before its compiled. I
can send along some generated C code if you want.

> > Any ideas what to look for? I tried setting/unsetting various error
> > handler functions but I always get the same results, whether or not I'm
> > printing out the error myself or letting libxslt do it.
>   Can you gdb perl ? Put a breakpoint there, ask for next and see if
> it stops. If not the function didn't returned, and that's a callback problem
> breaking the control flow. If yes I would suspect the xs->C or xs->code
> generator to have inserted something funky there.

I tried GDB but I couldn't get the breakpoint to work (something to do
with shared libraries on Mac OSX I think). But I'll try on a linux box
where it'll probably work.

<!-- Matt -->
<:->get a SMart net</:->
Spam trap - do not mail:

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