#40138 [NEW]: curl_multi, PHP/CLI crash, abnormally CPU load and Blue screen

Ask a Question related to PHP Bugs, Design and Development.

  1. #1

    Default #40138 [NEW]: curl_multi, PHP/CLI crash, abnormally CPU load and Blue screen

    From: rvadmin at mail dot ru
    Operating system: Windows XP
    PHP version: 5.2.0
    PHP Bug Type: cURL related
    Bug description: curl_multi, PHP/CLI crash, abnormally CPU load and Blue screen

    Description:
    ------------
    I use curl_multi on php command line version at Windows XP.
    After some time, php crashes (sometimes php.net, sometimes php_curl.dll).
    If php after 1 hour working normal, after 2 hours winsock crashes. My
    script is web crawler that downloading web pages and save them.
    I tried many builds of Windows XP, many versions of PHP5 and many
    computers!!!.
    On php 5.2.0 php not crashes, but windows crashes!!! (blue screen of
    death:).
    Usually I use 30 threads.

    I need help, because I dont know how to resolve this problem!
    Please, sorry for my bad English!!!

    Thank you.



    Reproduce code:
    ---------------
    <?
    /*Only part of script*/
    $urls=array("http://php.net"/*.... and other*/);
    function read_header($ch, $string)
    {
    $length = strlen($string);
    if(substr($string,0,13)=="Content-Type:" &&
    !preg_match("#(text/html|text/plain)#",$string))
    return false; # if it is not HTML
    else
    return $length;
    }
    $mh = curl_multi_init();

    foreach ($urls as $i => $url)
    {

    $conn[$i]=curl_init();
    curl_setopt($conn[$i],CURLOPT_URL,$url);
    curl_setopt($conn[$i],CURLOPT_RETURNTRANSFER,1);//return data as string
    curl_setopt($conn[$i],CURLOPT_CONNECTTIMEOUT,30);//timeout
    curl_setopt($conn[$i], CURLOPT_TIMEOUT, 120);
    curl_setopt($conn[$i], CURLOPT_MAXREDIRS, 1);
    curl_setopt($conn[$i], CURLOPT_NOSIGNAL, 1);
    curl_setopt($conn[$i], CURLOPT_NOPROGRESS, 1);
    curl_setopt($conn[$i], CURLOPT_FAILONERROR, 1);
    curl_setopt($conn[$i],CURLOPT_SSL_VERIFYPEER,0);
    curl_setopt($conn[$i],CURLOPT_SSL_VERIFYHOST,0);
    curl_setopt($conn[$i],CURLOPT_HEADERFUNCTION, 'read_header');
    curl_setopt($conn[$i],CURLOPT_FOLLOWLOCATION,1);
    curl_setopt($conn[$i],CURLOPT_USERAGENT,"Mozilla/4.0 (compatible; MSIE
    6.0; Windows NT 5.1)");

    curl_multi_add_handle ($mh,$conn[$i]);

    }

    do { $mrc=curl_multi_exec($mh,$active); } while ($mrc ==
    CURLM_CALL_MULTI_PERFORM);

    while ($active and $mrc == CURLM_OK) {
    // wait for network
    if (curl_multi_select($mh) != -1) {
    // pull in any new data, or at least handle timeouts
    do {
    $mrc = curl_multi_exec($mh, $active);
    } while ($mrc == CURLM_CALL_MULTI_PERFORM);
    }
    }
    $ret=array();

    foreach ($data as $i => $url)
    {
    if (($err = curl_error($conn[$i])) == '')
    {
    $c=curl_multi_getcontent($conn[$i]);
    if($c!==false)
    $ret[$i]=$c;
    }

    curl_multi_remove_handle($mh,$conn[$i]);
    curl_close($conn[$i]);
    }
    curl_multi_close($mh);
    /*...*/
    ?>

    Expected result:
    ----------------
    Curl and php/cli must work normal without high CPU loading when working
    long time and without winsock and php crashes.

    Actual result:
    --------------
    Php crashes or (if php works long time) winsock crashes or windows XP (at
    PHP 5.2.0 ) blue screen crash

    --
    Edit bug report at [url]http://bugs.php.net/?id=40138&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40138&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40138&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40138&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40138&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=40138&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=40138&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40138&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=40138&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=40138&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=40138&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=40138&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=40138&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=40138&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40138&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=40138&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=40138&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40138&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=40138&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40138&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40138&r=mysqlcfg[/url]
    rvadmin at mail dot ru Guest

  2. Similar Questions and Discussions

    1. MS04-011 NT 4.0 blue screen after install
      I installed MS04-011 on a couple of servers but after it was loaded the servers would not re-boot into NT 4 and just came up with a blue screen,...
    2. Blue Screen Of Death!
      As I reach the latter stages of the design of a Director Movie to be distributed on CD via a projector (MX), I was horrified to be told of a blue...
    3. Win XP crashes (blue screen of death)
      At more-or-less random, Elements crashes my Win XP Home, showing me a blue screen with white letters followed by a reboot. It has happened using the...
    4. Blue Screen on Boot after Power Off.
      A friend of mine says that her laptop has a blue screen upon booting it up. I shut down the machine by using power off: why is this happening? Is...
    5. Blue screen with v7 but not v6
      Hi, I've recently upgraded from v6 to v7 and have both still installed (installed 7 into its own folder). Today I looked at Liquify in v7 for the...
  3. #2

    Default #40138 [Opn]: curl_multi, PHP/CLI crash, abnormally CPU load and Blue screen

    ID: 40138
    User updated by: rvadmin at mail dot ru
    Reported By: rvadmin at mail dot ru
    Status: Open
    Bug Type: cURL related
    Operating System: Windows XP
    PHP Version: 5.2.0
    New Comment:

    OOPS, not php.net but php.exe!
    (sometimes php.exe, sometimes
    php_curl.dll)


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-01-15 20:13:13] rvadmin at mail dot ru

    Description:
    ------------
    I use curl_multi on php command line version at Windows XP.
    After some time, php crashes (sometimes php.net, sometimes
    php_curl.dll). If php after 1 hour working normal, after 2 hours
    winsock crashes. My script is web crawler that downloading web pages
    and save them.
    I tried many builds of Windows XP, many versions of PHP5 and many
    computers!!!.
    On php 5.2.0 php not crashes, but windows crashes!!! (blue screen of
    death:).
    Usually I use 30 threads.

    I need help, because I dont know how to resolve this problem!
    Please, sorry for my bad English!!!

    Thank you.



    Reproduce code:
    ---------------
    <?
    /*Only part of script*/
    $urls=array("http://php.net"/*.... and other*/);
    function read_header($ch, $string)
    {
    $length = strlen($string);
    if(substr($string,0,13)=="Content-Type:" &&
    !preg_match("#(text/html|text/plain)#",$string))
    return false; # if it is not HTML
    else
    return $length;
    }
    $mh = curl_multi_init();

    foreach ($urls as $i => $url)
    {

    $conn[$i]=curl_init();
    curl_setopt($conn[$i],CURLOPT_URL,$url);
    curl_setopt($conn[$i],CURLOPT_RETURNTRANSFER,1);//return data as
    string
    curl_setopt($conn[$i],CURLOPT_CONNECTTIMEOUT,30);//timeout
    curl_setopt($conn[$i], CURLOPT_TIMEOUT, 120);
    curl_setopt($conn[$i], CURLOPT_MAXREDIRS, 1);
    curl_setopt($conn[$i], CURLOPT_NOSIGNAL, 1);
    curl_setopt($conn[$i], CURLOPT_NOPROGRESS, 1);
    curl_setopt($conn[$i], CURLOPT_FAILONERROR, 1);
    curl_setopt($conn[$i],CURLOPT_SSL_VERIFYPEER,0);
    curl_setopt($conn[$i],CURLOPT_SSL_VERIFYHOST,0);
    curl_setopt($conn[$i],CURLOPT_HEADERFUNCTION, 'read_header');
    curl_setopt($conn[$i],CURLOPT_FOLLOWLOCATION,1);
    curl_setopt($conn[$i],CURLOPT_USERAGENT,"Mozilla/4.0 (compatible; MSIE
    6.0; Windows NT 5.1)");

    curl_multi_add_handle ($mh,$conn[$i]);

    }

    do { $mrc=curl_multi_exec($mh,$active); } while ($mrc ==
    CURLM_CALL_MULTI_PERFORM);

    while ($active and $mrc == CURLM_OK) {
    // wait for network
    if (curl_multi_select($mh) != -1) {
    // pull in any new data, or at least handle timeouts
    do {
    $mrc = curl_multi_exec($mh, $active);
    } while ($mrc == CURLM_CALL_MULTI_PERFORM);
    }
    }
    $ret=array();

    foreach ($data as $i => $url)
    {
    if (($err = curl_error($conn[$i])) == '')
    {
    $c=curl_multi_getcontent($conn[$i]);
    if($c!==false)
    $ret[$i]=$c;
    }

    curl_multi_remove_handle($mh,$conn[$i]);
    curl_close($conn[$i]);
    }
    curl_multi_close($mh);
    /*...*/
    ?>

    Expected result:
    ----------------
    Curl and php/cli must work normal without high CPU loading when working
    long time and without winsock and php crashes.

    Actual result:
    --------------
    Php crashes or (if php works long time) winsock crashes or windows XP
    (at PHP 5.2.0 ) blue screen crash


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40138&edit=1[/url]
    rvadmin at mail dot ru Guest

  4. #3

    Default #40138 [Bgs->Opn]: curl_multi, PHP/CLI crash, abnormally CPU load and Blue screen

    ID: 40138
    User updated by: rvadmin at mail dot ru
    Reported By: rvadmin at mail dot ru
    -Status: Bogus
    +Status: Open
    Bug Type: cURL related
    Operating System: Windows XP
    PHP Version: 5.2.0
    New Comment:

    ok, but why php_curl.dll crashes on PHP <5.2.0???


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-01-15 20:37:51] [email]tony2001@php.net[/email]

    Windows crashes are not PHP problems, even if they are reproducible
    only with PHP.

    ------------------------------------------------------------------------

    [2007-01-15 20:14:31] rvadmin at mail dot ru

    OOPS, not php.net but php.exe!
    (sometimes php.exe, sometimes
    php_curl.dll)

    ------------------------------------------------------------------------

    [2007-01-15 20:13:13] rvadmin at mail dot ru

    Description:
    ------------
    I use curl_multi on php command line version at Windows XP.
    After some time, php crashes (sometimes php.net, sometimes
    php_curl.dll). If php after 1 hour working normal, after 2 hours
    winsock crashes. My script is web crawler that downloading web pages
    and save them.
    I tried many builds of Windows XP, many versions of PHP5 and many
    computers!!!.
    On php 5.2.0 php not crashes, but windows crashes!!! (blue screen of
    death:).
    Usually I use 30 threads.

    I need help, because I dont know how to resolve this problem!
    Please, sorry for my bad English!!!

    Thank you.



    Reproduce code:
    ---------------
    <?
    /*Only part of script*/
    $urls=array("http://php.net"/*.... and other*/);
    function read_header($ch, $string)
    {
    $length = strlen($string);
    if(substr($string,0,13)=="Content-Type:" &&
    !preg_match("#(text/html|text/plain)#",$string))
    return false; # if it is not HTML
    else
    return $length;
    }
    $mh = curl_multi_init();

    foreach ($urls as $i => $url)
    {

    $conn[$i]=curl_init();
    curl_setopt($conn[$i],CURLOPT_URL,$url);
    curl_setopt($conn[$i],CURLOPT_RETURNTRANSFER,1);//return data as
    string
    curl_setopt($conn[$i],CURLOPT_CONNECTTIMEOUT,30);//timeout
    curl_setopt($conn[$i], CURLOPT_TIMEOUT, 120);
    curl_setopt($conn[$i], CURLOPT_MAXREDIRS, 1);
    curl_setopt($conn[$i], CURLOPT_NOSIGNAL, 1);
    curl_setopt($conn[$i], CURLOPT_NOPROGRESS, 1);
    curl_setopt($conn[$i], CURLOPT_FAILONERROR, 1);
    curl_setopt($conn[$i],CURLOPT_SSL_VERIFYPEER,0);
    curl_setopt($conn[$i],CURLOPT_SSL_VERIFYHOST,0);
    curl_setopt($conn[$i],CURLOPT_HEADERFUNCTION, 'read_header');
    curl_setopt($conn[$i],CURLOPT_FOLLOWLOCATION,1);
    curl_setopt($conn[$i],CURLOPT_USERAGENT,"Mozilla/4.0 (compatible; MSIE
    6.0; Windows NT 5.1)");

    curl_multi_add_handle ($mh,$conn[$i]);

    }

    do { $mrc=curl_multi_exec($mh,$active); } while ($mrc ==
    CURLM_CALL_MULTI_PERFORM);

    while ($active and $mrc == CURLM_OK) {
    // wait for network
    if (curl_multi_select($mh) != -1) {
    // pull in any new data, or at least handle timeouts
    do {
    $mrc = curl_multi_exec($mh, $active);
    } while ($mrc == CURLM_CALL_MULTI_PERFORM);
    }
    }
    $ret=array();

    foreach ($data as $i => $url)
    {
    if (($err = curl_error($conn[$i])) == '')
    {
    $c=curl_multi_getcontent($conn[$i]);
    if($c!==false)
    $ret[$i]=$c;
    }

    curl_multi_remove_handle($mh,$conn[$i]);
    curl_close($conn[$i]);
    }
    curl_multi_close($mh);
    /*...*/
    ?>

    Expected result:
    ----------------
    Curl and php/cli must work normal without high CPU loading when working
    long time and without winsock and php crashes.

    Actual result:
    --------------
    Php crashes or (if php works long time) winsock crashes or windows XP
    (at PHP 5.2.0 ) blue screen crash


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40138&edit=1[/url]
    rvadmin at mail dot ru Guest

  5. #4

    Default #40138 [Opn->Bgs]: curl_multi, PHP/CLI crash, abnormally CPU load and Blue screen

    ID: 40138
    Updated by: [email]tony2001@php.net[/email]
    Reported By: rvadmin at mail dot ru
    -Status: Open
    +Status: Bogus
    Bug Type: cURL related
    Operating System: Windows XP
    PHP Version: 5.2.0
    New Comment:

    Update PHP to the latest version.
    I don't think we can go to the past and re-fix something that has been
    already fixed in 5.2.0.


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-01-16 08:18:55] rvadmin at mail dot ru

    ok, but why php_curl.dll crashes on PHP <5.2.0???

    ------------------------------------------------------------------------

    [2007-01-15 20:37:51] [email]tony2001@php.net[/email]

    Windows crashes are not PHP problems, even if they are reproducible
    only with PHP.

    ------------------------------------------------------------------------

    [2007-01-15 20:14:31] rvadmin at mail dot ru

    OOPS, not php.net but php.exe!
    (sometimes php.exe, sometimes
    php_curl.dll)

    ------------------------------------------------------------------------

    [2007-01-15 20:13:13] rvadmin at mail dot ru

    Description:
    ------------
    I use curl_multi on php command line version at Windows XP.
    After some time, php crashes (sometimes php.net, sometimes
    php_curl.dll). If php after 1 hour working normal, after 2 hours
    winsock crashes. My script is web crawler that downloading web pages
    and save them.
    I tried many builds of Windows XP, many versions of PHP5 and many
    computers!!!.
    On php 5.2.0 php not crashes, but windows crashes!!! (blue screen of
    death:).
    Usually I use 30 threads.

    I need help, because I dont know how to resolve this problem!
    Please, sorry for my bad English!!!

    Thank you.



    Reproduce code:
    ---------------
    <?
    /*Only part of script*/
    $urls=array("http://php.net"/*.... and other*/);
    function read_header($ch, $string)
    {
    $length = strlen($string);
    if(substr($string,0,13)=="Content-Type:" &&
    !preg_match("#(text/html|text/plain)#",$string))
    return false; # if it is not HTML
    else
    return $length;
    }
    $mh = curl_multi_init();

    foreach ($urls as $i => $url)
    {

    $conn[$i]=curl_init();
    curl_setopt($conn[$i],CURLOPT_URL,$url);
    curl_setopt($conn[$i],CURLOPT_RETURNTRANSFER,1);//return data as
    string
    curl_setopt($conn[$i],CURLOPT_CONNECTTIMEOUT,30);//timeout
    curl_setopt($conn[$i], CURLOPT_TIMEOUT, 120);
    curl_setopt($conn[$i], CURLOPT_MAXREDIRS, 1);
    curl_setopt($conn[$i], CURLOPT_NOSIGNAL, 1);
    curl_setopt($conn[$i], CURLOPT_NOPROGRESS, 1);
    curl_setopt($conn[$i], CURLOPT_FAILONERROR, 1);
    curl_setopt($conn[$i],CURLOPT_SSL_VERIFYPEER,0);
    curl_setopt($conn[$i],CURLOPT_SSL_VERIFYHOST,0);
    curl_setopt($conn[$i],CURLOPT_HEADERFUNCTION, 'read_header');
    curl_setopt($conn[$i],CURLOPT_FOLLOWLOCATION,1);
    curl_setopt($conn[$i],CURLOPT_USERAGENT,"Mozilla/4.0 (compatible; MSIE
    6.0; Windows NT 5.1)");

    curl_multi_add_handle ($mh,$conn[$i]);

    }

    do { $mrc=curl_multi_exec($mh,$active); } while ($mrc ==
    CURLM_CALL_MULTI_PERFORM);

    while ($active and $mrc == CURLM_OK) {
    // wait for network
    if (curl_multi_select($mh) != -1) {
    // pull in any new data, or at least handle timeouts
    do {
    $mrc = curl_multi_exec($mh, $active);
    } while ($mrc == CURLM_CALL_MULTI_PERFORM);
    }
    }
    $ret=array();

    foreach ($data as $i => $url)
    {
    if (($err = curl_error($conn[$i])) == '')
    {
    $c=curl_multi_getcontent($conn[$i]);
    if($c!==false)
    $ret[$i]=$c;
    }

    curl_multi_remove_handle($mh,$conn[$i]);
    curl_close($conn[$i]);
    }
    curl_multi_close($mh);
    /*...*/
    ?>

    Expected result:
    ----------------
    Curl and php/cli must work normal without high CPU loading when working
    long time and without winsock and php crashes.

    Actual result:
    --------------
    Php crashes or (if php works long time) winsock crashes or windows XP
    (at PHP 5.2.0 ) blue screen crash


    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40138&edit=1[/url]
    tony2001@php.net Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139