Bug#486069: perl: embedding perl hangs on hppa without PERL_SYS_INIT3() since 5.10.0

Russ Allbery rra at stanford.edu
Sat Jun 28 18:15:33 UTC 2008


Julien ÉLIE <julien at trigofacile.com> writes:

> I do not know whether PERL_SYS_INIT3() is in Perl 5.004_03 (as INN is said
> to compile with it).

Hm, yeah, it may not be around before Perl 5.8, even.  You could try
checking with #ifdef before calling it, since the capital letters would
imply it's a macro.

> I do not know why there is that comment just below the definition of sub
> _load_ and sub _eval_:
>
>    /* We can't call 'eval' and 'do' directly for some reason, so we define
>       some wrapper functions to give us access. */
>
> Maybe eval_pv does not work for what we need?

I wish I could remember all the investigation I did of this at some point.
I figured out what the problem was and how to fix it, and then I didn't
write it down.  :/

I think I may have decided that the code had previously tried to use
perl_call_argv directly on eval or do, which of course doesn't work
because they're weird built-ins and not subs.

> +        /* The Perl expression which will be evaluated. */
> +        asprintf(&evalfile, "do %s", startupfile);

You need some quoting here of the file and in any other similar place.
That may be the problem.

>         PerlSilence();
> -        rc = perl_call_argv ("_load_",G_DISCARD, argv) ;
> +        eval_pv(evalfile, TRUE);
>         PerlUnSilence();

I'm not *sure* on this, but this possibly should be perl_eval_pv to be
safer (although either probably works).  I don't remember exactly how the
namespacing works when embedding.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.


More information about the inn-workers mailing list