Question

When I run the following test case in simpletest, Apache crashes if I use line B, but everything seems to work if I use line A.

class TestPredicateRequest extends UnitTestCase
{
    function testConstructWithPredicate()
    {
        Mock::generate("IQueryRequest");
        $oRequest = new MockIQueryRequest();

        $oPrototype = new QueryPrototype("TEST_COMMAND_STRING", 
                                         array(1 => QueryTypeConstants::CHARACTER_ID, 
                                               2 => QueryTypeConstants::CHARACTER_ID), 
                                         QueryTypeConstants::BOOLEAN);


        $oRequest->returns("GetArguments", array(2 => 102));  //only argument 2 is set.
        $oRequest->returns("GetPrototype", $oPrototype);
        $oRequest->returns("GetUnsetArguments", array(1)); //only argument 1 is unset

        $oToTest = new CharacterPredicateRequest($oRequest);

        $this->Here(101);                   //LINE A
        //$oItem = $this->Here(101);        //LINE B
    }

    function Here($CharacterID)
    {
        return $CharacterID;
    }
}

What possible reason would there be that storing the return value of the function or not is what controls whether or not an error happens?


Additional info:

If I throw an exception after either line A or line B, the exception bubbles up to the top and I get an error result page, as appropriate. This suggests to me that for some reason the SimpleTest framework doesn't like the case with Line B. Is it because there aren't any asserts in it?


Update x2:

Error log file from Apache seems pretty useless:

[Wed Aug 07 19:57:28.123436 2013] [mpm_winnt:notice] [pid 6908:tid 392] AH00455: Apache/2.4.4 (Win64) PHP/5.4.12 configured -- resuming normal operations
[Wed Aug 07 19:57:28.123436 2013] [mpm_winnt:notice] [pid 6908:tid 392] AH00456: Server built: Feb 22 2013 22:08:37
[Wed Aug 07 19:57:28.123436 2013] [core:notice] [pid 6908:tid 392] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4'
[Wed Aug 07 19:57:28.124436 2013] [mpm_winnt:notice] [pid 6908:tid 392] AH00418: Parent: Created child process 2444
[Wed Aug 07 19:57:28.863478 2013] [mpm_winnt:notice] [pid 2444:tid 284] AH00354: Child: Starting 150 worker threads.

(Crash would be here)

[Wed Aug 07 19:59:23.551038 2013] [mpm_winnt:notice] [pid 6908:tid 392] AH00428: Parent: child process 2444 exited with status 255 -- Restarting.
[Wed Aug 07 19:59:23.751049 2013] [mpm_winnt:notice] [pid 6908:tid 392] AH00455: Apache/2.4.4 (Win64) PHP/5.4.12 configured -- resuming normal operations
[Wed Aug 07 19:59:23.751049 2013] [mpm_winnt:notice] [pid 6908:tid 392] AH00456: Server built: Feb 22 2013 22:08:37
[Wed Aug 07 19:59:23.751049 2013] [core:notice] [pid 6908:tid 392] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4'
[Wed Aug 07 19:59:23.755050 2013] [mpm_winnt:notice] [pid 6908:tid 392] AH00418: Parent: Created child process 7288
[Wed Aug 07 19:59:24.608098 2013] [mpm_winnt:notice] [pid 7288:tid 284] AH00354: Child: Starting 150 worker threads.
Was it helpful?

Solution

it maybe because you have limited memory access for B. use set_ini() to -1 in start of your page to use unlimited resources.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top