Jamie,
someone else will hopefully comment on the mod_perl aspect of this; let
me just say what SablotFree() does. It's simple and you probably looked
at the code, but anyway. SablotProcessStrings allocates a new buffer for
the result document. The shared library user cannot free this using
free() (as this produces a segmentation fault) so that's why
SablotFree's there. It just calls free() itself, but sitting in the
shared library, it's OK.
Tom Kaiser
Jamie wrote:
>
> Hi All,
>
> Sablotron looks extremely promising, and as a command line utility it's
> already useful, but I'm having some problems getting it to work under apache
> with mod_perl.
>
> The problem is it gets a segfault when it runs, I think it's related to the
> SablotFree(foo); routine.
>
> I'm not a native C coder, but I did find something interesting.
>
> This doesn't crash under mod_perl, but it doesn't work either. :-( The
> fprintf(stderr,"Result: %s\n",result); line prints something completely
> different (in the apache error log file) under mod_perl then it does under
> regular perl.
>
> It prints some kind of binary data, leading me to believe it's a memory
> allocation mix-up of some kind, particular to mod_perl.
>
> Any idea on whats happening?
>
> (cut)