UNITCHECK and require

A

Adrien BARREAU

Hi all.

I just found a way to kill my Perl and I don't find anything about that.
Here it is:

=====
$ perl --version

This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
(with 61 registered patches, see perl -V for more detail)


$ cat death.pm
package death;
UNITCHECK { require stuff; }
1;

$ cat stuff.pm
package stuff;
1;

$ perl -e 'use death; print "ok\n";'
$ perl -e 'require death; print "ok\n";'
Segmentation fault
=====

Well, perhaps trying to require something in a UNITCHECK is not a good idea.
But still, segfault...

That's strange that the "use" version does not actually display anything
at all, although that seems to be quite random.

Does anybody have any piece of information about that?


Adrien.
 
A

Adrien BARREAU

For the record, I suspect this is the same bug as
https://rt.perl.org/rt3/Public/Bug/Display.html?id=70614 . It doesn't
look the same until you remember that 'require' is really just a
variation of string-eval.

Ben

I can reproduce something strange behaviours like that:

=====
$ cat death.pm
package death;
UNITCHECK { eval '' }
1;

$ perl -e 'require death; print "ok\n"'
$
# ---

$ cat death.pm
package death;
UNITCHECK { eval {} }
1;

$ perl -e 'require death; print "ok\n"'
ok
=====

No segfault, but nothing either with an eval-string.
Strange...

Adrien.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top