Windows Vista Forums

BUG: All http access blocked after running Perl script
  1. #1


    Mikko Noromaa Guest

    BUG: All http access blocked after running Perl script

    BUG: All http access blocked after running Perl script

    SUMMARY: Windows Vista blocks all http access from all users after running
    the attached script (at the end of this post).

    DESCRIPTION:

    Create a file accessible at http://127.0.0.1/test.htm and run the attached
    script. After about 12000-13000 fetches, the script starts reporting an
    unknown error. After that, all http access on the computer is blocked on all
    user accounts (after logging off and back on). When starting IE, it reports
    an error immediately. I found no other way of fixing this than rebooting my
    computer.

    The problem can be reproduced by using any URL in the script, including a
    real remote URL. The problem first occurred when I was running a real script
    that fetched lots of real Web pages in a loop like the test script.

    My guess is that either Perl is leaking some socket resources (and Vista
    can't release them on process exit), or that Vista is somehow considering
    the flood of http requests as an attack, and disabling http because of that.
    It probably shouldn't disable http indefinitely, though. I have uninstalled
    all anti-virus software and disabled the Windows Firewall, but the problem
    persists.

    Notice that the script was running without Administrative access, but it
    still caused a systemwide problem.

    TEST SCRIPT:

    use strict;
    use LWP::UserAgent;
    my $n=1;
    while (1) {
    print "Fetching page $n...";
    my $ua = LWP::UserAgent->new;
    my $req = HTTP::Request->new(GET => "http://127.0.0.1/test.htm");
    $req->header('Accept' => 'text/html');
    my $res = $ua->request($req);
    if ($res->is_success) {
    print " OK!\n";
    $n++;
    }
    else {
    print " ERROR: " . $res->status_line . ".\n";
    sleep 1;
    }
    }


    --

    Mikko Noromaa (mikkon@excelsql.com)
    - SQL in Excel, check out ExcelSQL! - see http://www.excelsql.com -





      My System SpecsSystem Spec

  2. #2



    Junior Member
    Join Date : May 2007
    Posts : 25
    Local Time: 04:05 AM


     
    Are you running the latest version of ActiveState Perl (5.8.8.820)? Did you download the correct version (x86 vs x64)? The latest version is here: ActiveState - ActivePerl free Perl open source binary language distribution - Dynamic Tools for Dynamic Languages

    Anything interesting reported in your computer's Event Logs?

    If you have found a bug in Perl, I suggest reporting it to ActiveState so that they can fix it in the next release. ActiveState's bug tracker is here: ActiveState Bug Database - Simple Query Page

      My System SpecsSystem Spec

  3. #3


    Mikko Noromaa Guest

    Re: BUG: All http access blocked after running Perl script

    Hi,

    Yes, I am running the latest x86 version of ActiveState Perl (5.8.8. "with
    50 registered patches").

    There are no interesting messages in the Event Logs, but after the problem
    appears, I start getting other strange errors as well. For example,
    PostgreSQL starts rejecting new connections, and other network-related apps
    fail. Also, the following is logged in the System log: "The DNS proxy agent
    was unable to allocate 0 bytes of memory". Memory seems fine in Task Manager
    (my computer has 3 GB installed). DameWare Mini Remote Control reports
    "error 10013: An attempt was made to access a socket in a way forbidden by
    its access permissions". Generally all socket-related operations seem to
    fail (not just http).

    I don't think this is a Perl problem because of the following reasons:

    1. It only happens on Vista. XP runs the test script fine for hours.

    2. The problem persists after Perl.exe has exited. Windows should release
    all resources held by user-mode applications, shouldn't it? And especially
    Vista should not let non-administrative programs affect other users.

    3. The problem doesn't appear if I add a "sleep 1" in the test script and
    run the script for hours. It only appears when many http requests are made
    in rapid succession. This sounds like some kind of attack detection logic
    that doesn't get properly reset.

    Did you (or anyone else) reproduce the problem?

    --

    Mikko Noromaa (mikkon@excelsql.com)
    - SQL in Excel, check out ExcelSQL! - see http://www.excelsql.com -


    "Scissor" <Scissor.2qarh8@no-mx.forums.net> wrote in message
    news:Scissor.2qarh8@no-mx.forums.net...
    >
    > Are you running the latest version of ActiveState Perl (5.8.8.820)? Did
    > you download the correct version (x86 vs x64)? The latest version is
    > here: 'ActiveState - ActivePerl free Perl open source binary language
    > distribution - Dynamic Tools for Dynamic Languages'
    > (http://www.activestate.com/Products/ActivePerl/)
    >
    > Anything interesting reported in your computer's Event Logs?
    >
    > If you have found a bug in Perl, I suggest reporting it to ActiveState
    > so that they can fix it in the next release. ActiveState's bug tracker
    > is here: 'ActiveState Bug Database - Simple Query Page'
    > (http://bugs.activestate.com/query.cg...uct=ActivePerl)
    >
    >
    > --
    > Scissor




      My System SpecsSystem Spec

  4. #4



    Junior Member
    Join Date : May 2007
    Posts : 25
    Local Time: 04:05 AM


     
    I ran your above script for 57,000+ fetches against a remote web server without running into any problems.

    I changed the GET => "http://127.0.0.1/test.htm" section GET => "http://172.16.96.14/"

    What is in your test.htm file?

    Note that on my laptop I am running 32-bit Vista Ultimate and Perl -v shows v5.8.8 and "Binary build 820 [274739] provided by ActiveState http://www.ActiveState.com"

      My System SpecsSystem Spec

  5. #5



    Junior Member
    Join Date : May 2007
    Posts : 25
    Local Time: 04:05 AM


     
    Not that this matters, but I noticed that your test script is a little inefficient because it recreates the LWP::UserAgent and HTTP::Request objects for each iteration of the while loop.

    You should be able to create the objects just once ahead of time and then reuse the objects inside the while loop. Below is an updated script explaining my suggestion.

    Note that the suggested changes should not have any effect on the possible bug you originally reported.


    Code:
    #!perl
    
    use strict;
    use warnings;
    use LWP::UserAgent;
    
    my $n   = 1;
    my $ua  = LWP::UserAgent->new;
    my $req = HTTP::Request->new(GET => "http://127.0.0.1/test.htm");
    $req->header('Accept' => 'text/html');
    
    while (1) {
        print "Fetching page $n...";
        my $res = $ua->request($req);
    
        if ($res->is_success) {
            print " OK!\n";
            $n++;
        }
        else {
            print " ERROR: " . $res->status_line . ".\n";
            sleep 1;
        }
    }

      My System SpecsSystem Spec

  6. #6


    Mikko Noromaa Guest

    Re: BUG: All http access blocked after running Perl script

    Hi,

    Thank you for the info! I am running 32-bit Vista Business on a desktop
    Intel Core 2 Quad. My perl -v reported the exact same version as yours.

    My test.htm file is a simple 5-byte text file containing the string "abc".
    And I just got an involuntary repro from my real script that does about 1.5
    requests per second against a remote server...

    If anyone else can confirm this bug, I'd appreciate the info. I think I'll
    have to contact MS support on this one.

    --

    Mikko Noromaa (mikkon@excelsql.com)
    - SQL in Excel, check out ExcelSQL! - see http://www.excelsql.com -


    "Scissor" <Scissor.2qbxu0@no-mx.forums.net> wrote in message
    news:Scissor.2qbxu0@no-mx.forums.net...
    >
    > I ran your above script for 57,000+ fetches against a remote web server
    > without running into any problems.
    >
    > I changed the GET => "http://127.0.0.1/test.htm" section GET =>
    > "http://172.16.96.14/"
    >
    > What is in your test.htm file?
    >
    > Note that on my laptop I am running 32-bit Vista Ultimate and Perl -v
    > shows v5.8.8 and "Binary build 820 [274739] provided by ActiveState
    > http://www.ActiveState.com"
    >
    >
    > --
    > Scissor




      My System SpecsSystem Spec

  7. #7


    Mikko Noromaa Guest

    Re: All http access blocked after running Perl script

    Hi,

    I've found out some new information about the problem:

    1. The Internet Connection Sharing (ICS) service seems to be the culprit.
    The problem goes away when I stop this service. However, restarting brings
    the problem back immediately.

    2. While ICS is enabled, and my Vista computer is crippled, other computers
    on my network can succesfully connect to the Internet through ICS.

    3. I found several other posts on the net describing probably the same
    problem. All of them pointed to ICS and described the same symptoms.
    However, none of them offered any real solutions.

    So this definately looks like some kind of badly broken "intrusion
    detection" logic in the Internet Connection Sharing service. I hope someone
    from MS is reading this and takes appropriate actions. Contrary to other
    reports on the net, I believe I have a solid repro case (the Perl script in
    the original post).

    --

    Mikko Noromaa (mikkon@excelsql.com)
    - SQL in Excel, check out ExcelSQL! - see http://www.excelsql.com -


    "Mikko Noromaa" <excelsql@newsgroup.nospam> wrote in message
    news:OW%23wh5ckHHA.3452@TK2MSFTNGP04.phx.gbl...
    > BUG: All http access blocked after running Perl script
    >
    > SUMMARY: Windows Vista blocks all http access from all users after running
    > the attached script (at the end of this post).
    >
    > DESCRIPTION:
    >
    > Create a file accessible at http://127.0.0.1/test.htm and run the attached
    > script. After about 12000-13000 fetches, the script starts reporting an
    > unknown error. After that, all http access on the computer is blocked on
    > all user accounts (after logging off and back on). When starting IE, it
    > reports an error immediately. I found no other way of fixing this than
    > rebooting my computer.
    >
    > The problem can be reproduced by using any URL in the script, including a
    > real remote URL. The problem first occurred when I was running a real
    > script that fetched lots of real Web pages in a loop like the test script.
    >
    > My guess is that either Perl is leaking some socket resources (and Vista
    > can't release them on process exit), or that Vista is somehow considering
    > the flood of http requests as an attack, and disabling http because of
    > that. It probably shouldn't disable http indefinitely, though. I have
    > uninstalled all anti-virus software and disabled the Windows Firewall, but
    > the problem persists.
    >
    > Notice that the script was running without Administrative access, but it
    > still caused a systemwide problem.
    >
    > TEST SCRIPT:
    >
    > use strict;
    > use LWP::UserAgent;
    > my $n=1;
    > while (1) {
    > print "Fetching page $n...";
    > my $ua = LWP::UserAgent->new;
    > my $req = HTTP::Request->new(GET => "http://127.0.0.1/test.htm");
    > $req->header('Accept' => 'text/html');
    > my $res = $ua->request($req);
    > if ($res->is_success) {
    > print " OK!\n";
    > $n++;
    > }
    > else {
    > print " ERROR: " . $res->status_line . ".\n";
    > sleep 1;
    > }
    > }
    >
    >
    > --
    >
    > Mikko Noromaa (mikkon@excelsql.com)
    > - SQL in Excel, check out ExcelSQL! - see http://www.excelsql.com -
    >
    >




      My System SpecsSystem Spec

  8. #8


    Mikko Noromaa Guest

    Re: BUG: All http access blocked after running Perl script

    Thanks, I'll check if my real app has the same inefficiency.

    --

    Mikko Noromaa (mikkon@excelsql.com)
    - SQL in Excel, check out ExcelSQL! - see http://www.excelsql.com -

    "Scissor" <Scissor.2qbzx7@no-mx.forums.net> wrote in message
    news:Scissor.2qbzx7@no-mx.forums.net...
    >
    > Not that this matters, but I noticed that your test script is a little
    > inefficient because it recreates the LWP::UserAgent and HTTP::Request
    > objects for each iteration of the while loop.
    >
    > You should be able to create the objects just once ahead of time and
    > then reuse the objects inside the while loop. Below is an updated
    > script explaining my suggestion.
    >
    > Note that the suggested changes should not have any effect on the
    > possible bug you originally reported.
    >
    >
    >
    > Code:
    > --------------------
    >
    > #!perl
    >
    > use strict;
    > use warnings;
    > use LWP::UserAgent;
    >
    > my $n = 1;
    > my $ua = LWP::UserAgent->new;
    > my $req = HTTP::Request->new(GET => "http://127.0.0.1/test.htm");
    > $req->header('Accept' => 'text/html');
    >
    > while (1) {
    > print "Fetching page $n...";
    > my $res = $ua->request($req);
    >
    > if ($res->is_success) {
    > print " OK!\n";
    > $n++;
    > }
    > else {
    > print " ERROR: " . $res->status_line . ".\n";
    > sleep 1;
    > }
    > }
    >
    > --------------------
    >
    >
    > --
    > Scissor




      My System SpecsSystem Spec

  9. #9


    Chuck Guest

    Re: BUG: All http access blocked after running Perl script

    On Wed, 9 May 2007 03:10:10 +0300, "Mikko Noromaa" <excelsql@newsgroup.nospam>
    wrote:

    >BUG: All http access blocked after running Perl script
    >
    >SUMMARY: Windows Vista blocks all http access from all users after running
    >the attached script (at the end of this post).


    OK, I'll bite.

    What purpose does the script serve?

    "If it hurts every time you poke yourself in the eye with a sharp stick
    (AOHELL), the obvious solution is to quit poking yourself in the eye with a
    sharp stick (AOHELL).

    If you absolutely MUST poke yourself in the eye with a sharp stick (AOHELL),
    then feel free to seek assistance from the maker of the sharp stick (AOHELL)."

    --
    Cheers,
    Chuck, MS-MVP [Windows - Networking]
    http://nitecruzr.blogspot.com/
    Paranoia is not a problem, when it's a normal response from experience.
    My email is AT DOT
    actual address pchuck mvps org.

      My System SpecsSystem Spec

  10. #10


    Mikko Noromaa Guest

    Re: BUG: All http access blocked after running Perl script

    > What purpose does the script serve?

    From my original post:

    "The problem can be reproduced by using any URL in the script, including a
    real remote URL. The problem first occurred when I was running a real script
    that fetched lots of real Web pages in a loop like the test script."

    Ever heard of Web spidering?

    --

    Mikko Noromaa (mikkon@excelsql.com)
    - SQL in Excel, check out ExcelSQL! - see http://www.excelsql.com -

    "Chuck" <none@example.net> wrote in message
    news:rlo4439dm17ho8ei25uthq6ch62p0qtlri@4ax.com...
    > On Wed, 9 May 2007 03:10:10 +0300, "Mikko Noromaa"
    > <excelsql@newsgroup.nospam>
    > wrote:
    >
    >>BUG: All http access blocked after running Perl script
    >>
    >>SUMMARY: Windows Vista blocks all http access from all users after running
    >>the attached script (at the end of this post).

    >
    > OK, I'll bite.
    >
    > What purpose does the script serve?
    >
    > "If it hurts every time you poke yourself in the eye with a sharp stick
    > (AOHELL), the obvious solution is to quit poking yourself in the eye with
    > a
    > sharp stick (AOHELL).
    >
    > If you absolutely MUST poke yourself in the eye with a sharp stick
    > (AOHELL),
    > then feel free to seek assistance from the maker of the sharp stick
    > (AOHELL)."
    >
    > --
    > Cheers,
    > Chuck, MS-MVP [Windows - Networking]
    > http://nitecruzr.blogspot.com/
    > Paranoia is not a problem, when it's a normal response from experience.
    > My email is AT DOT
    > actual address pchuck mvps org.




      My System SpecsSystem Spec

Page 1 of 2 12 LastLast
BUG: All http access blocked after running Perl script problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to send request by HTTP POST method in VBS script? Shucheng Liu VB Script 4 02 Apr 2010
Script to output single HTTP GET ? Vilius Mockûnas VB Script 5 10 Oct 2009
security permissions set by perl script Gary Ferland Vista security 0 28 Aug 2008
Software publisher has been blocked from running brianosaur General Discussion 1 26 Jul 2008
Script blocked Mike Truman Vista performance & maintenance 3 25 Feb 2008