Eval not reseting

Discussion in 'Perl Misc' started by Cosmic Cruizer, Dec 23, 2005.

  1. I'm trying to use the follow eval statement in a sub. The first time
    through it works fine, but the second time it fails to timeout. I'm trying
    to run it on a Solaris box with Perl v5.6.1. It looks like patch 11510
    "eval 'format foo=' would loop indefinitely" has alrady been applied. Any
    suggestions? I'm not going to be able to upgrade the version of Perl on
    this box.

    eval {
    sigaction(SIGALRM, POSIX::SigAction->new("main::alrm"));
    alarm 10; # Timeout after x seconds
    @rpcinfo = `rpcinfo -p $server_address`;
    alarm 0;
    };


    Thanks
     
    Cosmic Cruizer, Dec 23, 2005
    #1
    1. Advertising

  2. Cosmic Cruizer

    Guest

    What happens on your system if you do this?

    eval {
    $SIG{ALRM} = sub { die "alarm" };
    alarm 1; # Timeout after x seconds
    @rpcinfo = `sleep 500`;
    alarm 0;
    };
     
    , Dec 23, 2005
    #2
    1. Advertising

  3. wrote in news:1135369705.348005.221340
    @g47g2000cwa.googlegroups.com:

    > What happens on your system if you do this?
    >
    > eval {
    > $SIG{ALRM} = sub { die "alarm" };
    > alarm 1; # Timeout after x seconds
    > @rpcinfo = `sleep 500`;
    > alarm 0;
    > };
    >


    Gave it a try, but it did not make any difference. I also tried setting
    sleep to 50 to see what would happened. The first time through took about
    one second, then it took about 50 seconds for the next four.
     
    Cosmic Cruizer, Dec 23, 2005
    #3
  4. Cosmic Cruizer <> wrote in
    news:Xns97357A749A404ccruizermydejacom@207.115.17.102:

    > I'm trying to use the follow eval statement in a sub. The first time
    > through it works fine, but the second time it fails to timeout. I'm
    > trying to run it on a Solaris box with Perl v5.6.1. It looks like
    > patch 11510 "eval 'format foo=' would loop indefinitely" has alrady
    > been applied. Any suggestions? I'm not going to be able to upgrade the
    > version of Perl on this box.
    >
    > eval {
    > sigaction(SIGALRM, POSIX::SigAction->new("main::alrm"));
    > alarm 10; # Timeout after x seconds
    > @rpcinfo = `rpcinfo -p $server_address`;
    > alarm 0;
    > };
    >
    >
    > Thanks



    Found the problem (kind of...). Tried the script on a different Solaris box
    that's running Perl v. 5.005_03. The script runs without any problems.
     
    Cosmic Cruizer, Dec 23, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steven Menk

    Reseting on an edge or one-shot

    Steven Menk, Feb 13, 2006, in forum: VHDL
    Replies:
    6
    Views:
    1,692
  2. =?Utf-8?B?RGF2ZQ==?=

    Reseting cache for SQL server query

    =?Utf-8?B?RGF2ZQ==?=, Dec 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    334
  3. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    Problem reseting CheckBoxList when not checked.

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Jun 23, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    465
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=
    Jun 23, 2005
  4. Simon Harvey
    Replies:
    3
    Views:
    354
    ThunderMusic
    Feb 20, 2006
  5. matt
    Replies:
    1
    Views:
    378
    Alf P. Steinbach
    Mar 6, 2004
Loading...

Share This Page