Re: [mp1] Safe segfaults with mp1

2003-07-25 Thread Stas Bekman
Stas Bekman wrote: [...] It's handy to have p5p people sitting next to you. Just asked this question Tim Bunce, and he replied: Safe is a failed experiment. It works only for several cases. TIEHANDLE is not one of them [print under mod_perl uses a tied STDOUT]. Do not use it if it

[mp1] Safe segfaults with mp1

2003-07-24 Thread Joel Palmius
This works, separate file /tmp/test.pl: use Safe; my($compartment) = new Safe; $compartment-permit(qw(:browse)); $compartment-reval(print \gnu\n\;); if($@) { die $@; } print \n\n; (Script prints gnu) This does not work, in perl-handler Handler.pm: [...] use Safe;

Re: [mp1] Safe segfaults with mp1

2003-07-24 Thread Stas Bekman
Joel Palmius wrote: This works, separate file /tmp/test.pl: use Safe; my($compartment) = new Safe; $compartment-permit(qw(:browse)); $compartment-reval(print \gnu\n\;); if($@) { die $@; } print \n\n; (Script prints gnu) This does not work, in perl-handler Handler.pm:

Re: [mp1] Safe segfaults with mp1

2003-07-24 Thread Stas Bekman
Stas Bekman wrote: Joel Palmius wrote: use Safe; my($compartment) = new Safe; $compartment-permit(qw(:browse)); $compartment-reval(print \gnu\n\;); [...] Request results in segfault: [Thu Jul 24 12:59:56 2003] [notice] child pid 3003 exit signal Segmentation fault (11) [...]

Re: [mp1] Safe segfaults with mp1

2003-07-24 Thread Joel Palmius
Ah, well, after a five hours of experimentation I thought up a working workaround anyway. This works with an unpatched version of mp1 ($substr is any perl code fetched from external source): my(@ops) = split(/\x0a/,$substr); my($cell,$reval); foreach $cell (@ops) {

Re: [mp1] Safe segfaults with mp1

2003-07-24 Thread Stas Bekman
Joel Palmius wrote: Ah, well, after a five hours of experimentation I thought up a working workaround anyway. This works with an unpatched version of mp1 ($substr is any perl code fetched from external source): my(@ops) = split(/\x0a/,$substr); my($cell,$reval); foreach $cell