Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

502 error with Phalcon 2.0 on Nginx and PHP 5.6, Ubuntu x64 14.04 #2761

Closed
Swader opened this issue Sep 1, 2014 · 39 comments
Closed

502 error with Phalcon 2.0 on Nginx and PHP 5.6, Ubuntu x64 14.04 #2761

Swader opened this issue Sep 1, 2014 · 39 comments

Comments

@Swader
Copy link

Swader commented Sep 1, 2014

Using this tutorial but upgrading the box and using PHP 5.6, the end result is yet another this:

2014/09/01 00:37:31 [error] 17615#0: *16 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 10.0.2.2, server: test.app, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "test.app:8000"
2014/09/01 00:41:04 [error] 17615#0: *26 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 10.0.2.2, server: test.app, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "test.app:8000"

The error happens when the code reaches this part in bootstrap.php:

            return $application->handle()->getContent();

I can still die() before that line and it'll render.

Note that I have disabled Xdebug as per @duythien's advice and set the debug flag to 1 in config, no effect.

Phalcon is successfully installed with version 2.0.0a and Zephir 0.4.6a.

If I can help with providing more information, let me know.


Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.

@Swader
Copy link
Author

Swader commented Sep 1, 2014

@phalcon @niden any way to get a debug dump straight out of Phalcon? Nginx error logs are useless, and I can't really go into PhApplication to debug line by line, especially since Xdebug has to be off too.

@duythien
Copy link
Contributor

duythien commented Sep 1, 2014

@Swader you can move into index file, then running

php index.php

@phalcon
Copy link
Collaborator

phalcon commented Sep 1, 2014

As @duythien said:

cd /path/to/website/public
gdb php
run index.php
bt full

@Swader
Copy link
Author

Swader commented Sep 1, 2014

This is the output:

(gdb) run index.php
Starting program: /usr/bin/php index.php
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00000000006b1a05 in ?? ()
(gdb)

@phalcon
Copy link
Collaborator

phalcon commented Sep 1, 2014

It seems you have to compile Phalcon in debug mode, please compile it as follows:

git clone http://github.com/phalcon/cphalcon
git checkout 2.0.0
cd ext
sudo ./install-test

@Swader
Copy link
Author

Swader commented Sep 1, 2014

@phalcon done and rebooted it all, but the result is exactly the same on all fronts. Where should I be seeing some more information about problems?

@phalcon
Copy link
Collaborator

phalcon commented Sep 1, 2014

Could you try compiling again? Please pull changes down from the 2.0.0 branch

@unisys12
Copy link

unisys12 commented Sep 1, 2014

This makes me feel much better, because I am getting the same thing, but running v5.5.16 in my local Homestead environment. Thought I was just an idiot! Was going to try and run the tests on the v2 branch and got this output...

vagrant@homestead:/vagrant/cphalcon/php-tests/tests$ phpunit
PHPUnit 4.1.3 by Sebastian Bergmann.

Configuration read from /vagrant/cphalcon/php-tests/tests/phpunit.xml

................Segmentation fault (core dumped)

At which point, I tried loading up a local phalcon project and saw the 502 error. I do not have gdb installed, so... cannot confirm my output to @Swader's.

I will also add, when compiling Phalcon v2.0.0 branch, with Zephir, I this is the output...

Warning: Class "APCIterator" does not exist at compile time  in /vagrant/cphalco
n/phalcon/cache/backend/apc.zep on 222 [nonexistent-class]

           apc = new \APCIterator("user", prefixPattern);
        ------------------------------------------------^


Warning: Unreachable code in /vagrant/cphalcon/phalcon/dispatcher.zep on 581 [un
reachable-code]

           if typeof eventsManager == "object" {
        ---------------------------------------^


Warning: Unreachable code in /vagrant/cphalcon/phalcon/dispatcher.zep on 596 [un
reachable-code]

           if method_exists(handler, "afterExecuteRoute") {
        --------------------------------------------------^


Warning: Possible attempt to use non-object in "new" operator in /vagrant/cphalc
on/phalcon/mvc/model.zep on 584 [non-valid-new]

           let hydrate = new \stdclass();
        --------------------------------^


Warning: Variable "columnMap" declared but not used in Phalcon\Mvc\Model\MetaDat
a::_initialize in /vagrant/cphalcon/phalcon/mvc/model/metadata.zep on 94 [unused
-variable]

           dependencyInjector, columnMap, keyName, prefixKey;
        --------------------------------^


Warning: Function "phalcon_orm_singlequotes" does not exist at compile time in /
vagrant/cphalcon/phalcon/mvc/model/query.zep on 511 [nonexistent-function]

               let escapedValue = phalcon_orm_singlequotes(value);
        ---------------------------------------------------------^


Warning: Variable 'sqlJoinConditions' was assigned for the first time in conditi
onal branch, consider initialize it at its declaration in /vagrant/cphalcon/phal
con/mvc/model/query.zep on 935 [conditional-initialization]

          ];
        --^


Compiling...
Installing...
Extension installed!
Don't forget to restart your web server

The second warning is a bit troubling, since it deals with the eventsManager() within the Dispatcher class. Honestly, have not dug into that. This is just my system though.

@Swader, do you see the same warnings when compiling Phalcon?

@phalcon I added the cphalcon repo as an upstream remote, just now, and it states, when performing git pull upstream 2.0.0 that everything is up-to-date

Output of git pull to remote v2 branch

\vagrant@homestead:/vagrant/cphalcon$ git pull upstream 2.0.0
From https://github.com/phalcon/cphalcon
 * branch            2.0.0      -> FETCH_HEAD
Already up-to-date.

Hope that I did not induce information overload... :(

@phalcon
Copy link
Collaborator

phalcon commented Sep 1, 2014

@unisys12 Please try running the tests with --debug flag to see which test is segfaulting:

$ phpunit --debug

@unisys12
Copy link

unisys12 commented Sep 1, 2014

Sorry for the delay... Here is the output at the line of the segfault

Starting test 'Phalcon\Test\Http\Request\UnitTest::testInput'.
Segmentation fault (core dumped)

@phalcon
Copy link
Collaborator

phalcon commented Sep 1, 2014

It's passing on my machine:

$ phpunit --debug
PHPUnit 4.2.0 by Sebastian Bergmann.

Configuration read from /home/andres/cphalcon/php-tests/tests/phpunit.xml

Starting test 'Phalcon\Test\Escaper\UnitTest::testEscapeHtml'.
.
Starting test 'Phalcon\Test\Acl\Resource\UnitTest::testAclResourceName'.
.
Starting test 'Phalcon\Test\Acl\Resource\UnitTest::testAclResourceNameDescription'.
.
Starting test 'Phalcon\Test\Acl\Role\UnitTest::testAclRoleNameEmptyDescription'.
.
Starting test 'Phalcon\Test\Acl\Role\UnitTest::testAclRoleNameDescription'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testInstanceOf'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testHeaderGetEmpty'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testHeaderGet'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testIsAjaxDefault'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testIsAjax'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testGetSchemeDefault'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testGetScheme'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testIsSecureRequestDefault'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testIsSecureRequest'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testGetServerAddressDefault'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testGetServerAddress'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testInput'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testHttpHost'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testMethod'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testAcceptableContent'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testAcceptableCharsets'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testAcceptableLanguage'.
.
Starting test 'Phalcon\Test\Http\Request\UnitTest::testClientAddress'.
.
Starting test 'Phalcon\Test\Security\UnitTest::testHash'.
.

Time: 5.79 seconds, Memory: 3.25Mb

OK (24 tests, 86 assertions)

Anyway I can access your machine?

@unisys12
Copy link

unisys12 commented Sep 1, 2014

I don't know. Might be able to do something over on a G+ hang or some thing. Let me try bring up a new environment and starting from scratch. Maybe do something outside of Homestead, maybe use Puphpet to quickly get something up and running. I will let you know then, if I cannot isolate this issue further.

I would like to prove or disprove weather @Swader and I both have the same issue. Since he and I both are Homestead users, I think it would be best if I explore that first.

Well let you know

@phalcon
Copy link
Collaborator

phalcon commented Sep 1, 2014

I'll try to set up a Vagrant machine with Phalcon 2 as the article describes

@Swader
Copy link
Author

Swader commented Sep 1, 2014

After pulling the latest changes and recompiling without zephir, as you described above, with install-test, everything seems to be working fine. Tests in the php-tests/tests folder of cphalcon are passing, too.

@Swader
Copy link
Author

Swader commented Sep 2, 2014

@unisys12 did you try the new version? Does it work for you too now?

@unisys12
Copy link

unisys12 commented Sep 2, 2014

@Swader No, unfortunately it did not resolve my issue. So I think we may be experiencing different issues. They may lead to same end 502 error page but different cause.

I made a fresh clone into an existing puphpet environment running php v5.5.16. Zephir was already installed in this environment, but I installed it using the methods outlined above (using sudo ./install-test). But still, the same tests fail at the same point and get the same 502 error when accessing the index page.

One thing that I did find was: When instantiating a micro app, as long as I do not config a view and return items directly from a closure, everything seemingly works fine. Similar to this thread on the forums - http://forum.phalconphp.com/discussion/3297/php-5-6-0-gives-an-error-get-failed-net-err-empty-response-

@Swader
Copy link
Author

Swader commented Sep 2, 2014

How about if you follow the instructions from the article in the original
post of this issue? Can you get the phalcon website to run locally on 2.0?

@unisys12
Copy link

unisys12 commented Sep 2, 2014

@Swader Nope, do dice.

I installed gdb and took a stab at what @phalcon and @duythien was working towards earlier in your issue. This was the output

(gdb) run index.php
Starting program: /usr/bin/php index.php
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe9ded700 (LWP 4321)]
[Thread 0x7fffe9ded700 (LWP 4321) exited]

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5088b77 in xdebug_build_fname (edata=0x7fffffffa630, tmp=0x13cbe30)
    at /build/buildd/xdebug-2.2.5/xdebug-2.2.5/xdebug_stack.c:918
918     /build/buildd/xdebug-2.2.5/xdebug-2.2.5/xdebug_stack.c: No such file or
directory.
(gdb) bt full
#0  0x00007ffff5088b77 in xdebug_build_fname (edata=0x7fffffffa630,
    tmp=0x13cbe30)
    at /build/buildd/xdebug-2.2.5/xdebug-2.2.5/xdebug_stack.c:918
        fname = 0x7fffffffccdf ""
#1  xdebug_add_stack_frame (zdata=zdata@entry=0x7fffffffa630, op_array=0x0,
    type=type@entry=1)
    at /build/buildd/xdebug-2.2.5/xdebug-2.2.5/xdebug_stack.c:1039
        edata = 0x7fffffffa630
        opline_ptr = 0x7ffff7fa9320
        tmp = 0x13cbe30
        cur_opcode = <optimized out>
        param = <optimized out>
        i = 0
        aggr_key = 0x0
        aggr_key_len = 0
#2  0x00007ffff5079534 in xdebug_execute_internal (
    current_execute_data=0x7fffffffa630, fci=0x7fffffffa7b0,
    return_value_used=1)
    at /build/buildd/xdebug-2.2.5/xdebug-2.2.5/xdebug.c:1520
        edata = 0x7fffffffa630
        fse = <optimized out>
        cur_opcode = <optimized out>
        do_return = 0
        function_nr = 0
        restore_error_handler_situation = 0
        tmp_error_cb = 0x0
#3  0x00000000006c348b in zend_call_function ()
No symbol table info available.
#4  0x00007fffeaae8b19 in zephir_call_user_function ()
   from /usr/lib/php5/20121212/phalcon.so
No symbol table info available.
#5  0x00007fffeaaf06af in zephir_call_func_aparams ()
   from /usr/lib/php5/20121212/phalcon.so
No symbol table info available.
#6  0x00007fffeaae2295 in zim_Phalcon_Mvc_Micro_handle ()
   from /usr/lib/php5/20121212/phalcon.so
No symbol table info available.
#7  0x00000000006c10fb in dtrace_execute_internal ()
No symbol table info available.
#8  0x00007ffff50795e6 in xdebug_execute_internal (
    current_execute_data=0x7ffff7fa9320, fci=0x0, return_value_used=0)
    at /build/buildd/xdebug-2.2.5/xdebug-2.2.5/xdebug.c:1551
        edata = <optimized out>
        fse = 0x13cb9b0
        cur_opcode = <optimized out>
        do_return = 0
        function_nr = 71
        restore_error_handler_situation = 0
---Type <return> to continue, or q <return> to quit---
        tmp_error_cb = <optimized out>
#9  0x00000000007816d5 in ?? ()
No symbol table info available.
#10 0x00000000006fb3a8 in execute_ex ()
No symbol table info available.
#11 0x00000000006c0ff9 in dtrace_execute_ex ()
No symbol table info available.
#12 0x00007ffff5078b6c in xdebug_execute_ex (execute_data=0x7ffff7fa9320)
    at /build/buildd/xdebug-2.2.5/xdebug-2.2.5/xdebug.c:1437
        op_array = 0x7ffff7fdc588
        edata = <optimized out>
        dummy = 0xe5e828 <compiler_globals+392>
        fse = 0x13c67b0
        xfse = <optimized out>
        magic_cookie = <optimized out>
        do_return = 0
        function_nr = 0
        le = <optimized out>
        clear = 1
        return_val = 0x0
#13 0x00000000006d2c60 in zend_execute_scripts ()
No symbol table info available.
#14 0x0000000000672875 in php_execute_script ()
No symbol table info available.
#15 0x00000000007836ae in ?? ()
No symbol table info available.
#16 0x00000000004605d0 in main ()
No symbol table info available.

FIgure it would be best to get this info, because turning off Xdebug and installing in debug mode is not the way we want do things. Plus, others are going to have this issue as well. Getting info should at least help in researching the problem anyway.

And to think I started out wanting to write a tutorial that might get others inspired to help with writing tests or using the output of tests to write code to fill holes in the code base. And here we are, learning about a whole lot more than I set out to in the first place. Makes things fun though!

@phalcon
Copy link
Collaborator

phalcon commented Sep 2, 2014

It looks like a xdebug bug, it assumes that call_user_func is never called from an internal function, and it's accessing the previous execution data causing the segfault: https://github.com/xdebug/xdebug/blob/9f498af7e5a930a3513f9afc569de1aab882c3d7/xdebug_stack.c#L929

@unisys12
Copy link

unisys12 commented Sep 2, 2014

@phalcon Well, there ya go! :)

Will disable the xdebug extension in my environment tomorrow moring to make I do not have any other issues unrelated to this.

@phalcon
Copy link
Collaborator

phalcon commented Sep 2, 2014

Added a pull request on xdebug to fix the problem: xdebug/xdebug#120

@unisys12
Copy link

unisys12 commented Sep 2, 2014

@Swader, I can confirm that disabling xdebug gets everything working again and all tests pass. I just wanted to make sure that my environment was not experiencing any other issues. @phalcon's pull-request to xdebug should hopefully resolve this once and for all.

@fireburnheart2005
Copy link

I also have output some warning when build phalcon with zephir command : zephir build.I using PHP 5.5

Warning: Class "APCIterator" does not exist at compile time  in /source/cphalcon/phalcon/cache/backend/apc.zep on 222 [nonexistent-class]

           apc = new \APCIterator("user", prefixPattern);
        ------------------------------------------------^


Warning: Possible attempt to use non-object in "new" operator in /source/cphalcon/phalcon/mvc/model.zep on 584 [non-valid-new]

           let hydrate = new \stdclass();
        --------------------------------^


Warning: Function "phalcon_orm_singlequotes" does not exist at compile time in /source/cphalcon/phalcon/mvc/model/query.zep on 511 [nonexistent-function]

               let escapedValue = phalcon_orm_singlequotes(value);
        ---------------------------------------------------------^


Warning: Variable 'sqlJoinConditions' was assigned for the first time in conditional branch, consider initialize it at its declaration in /source/cphalcon/phalcon/mvc/model/query.zep on 935 [conditional-initialization]

          ];
        --^


Compiling...
Installing...
Extension installed!
Don't forget to restart your web server

@Swader
Copy link
Author

Swader commented Sep 5, 2014

yeah that's always there, nothing to worry about
On Sep 5, 2014 12:49 PM, "fireburnheart2005" notifications@github.com
wrote:

I also have output some warning when build phalcon with zephir command : zephir
build

Warning: Class "APCIterator" does not exist at compile time in /source/cphalcon/phalcon/cache/backend/apc.zep on 222 [nonexistent-class]

       apc = new \APCIterator("user", prefixPattern);
    ------------------------------------------------^

Warning: Possible attempt to use non-object in "new" operator in /source/cphalcon/phalcon/mvc/model.zep on 584 [non-valid-new]

       let hydrate = new \stdclass();
    --------------------------------^

Warning: Function "phalcon_orm_singlequotes" does not exist at compile time in /source/cphalcon/phalcon/mvc/model/query.zep on 511 [nonexistent-function]

           let escapedValue = phalcon_orm_singlequotes(value);
    ---------------------------------------------------------^

Warning: Variable 'sqlJoinConditions' was assigned for the first time in conditional branch, consider initialize it at its declaration in /source/cphalcon/phalcon/mvc/model/query.zep on 935 [conditional-initialization]

      ];
    --^

Compiling...
Installing...
Extension installed!
Don't forget to restart your web server


Reply to this email directly or view it on GitHub
#2761 (comment).

@jtunggit
Copy link

jtunggit commented Sep 6, 2014

As the same warning there.

Warning: Class "APCIterator" does not exist at compile time  in /var/www/cphalcon/phalcon/cache/backend/apc.zep on 222 [nonexistent-class]

       apc = new \APCIterator("user", prefixPattern);
    ------------------------------------------------^


Warning: Function "mcrypt_get_iv_size" does not exist at compile time in /var/www/cphalcon/phalcon/crypt.zep on 334 [nonexistent-function]

      let ivSize = mcrypt_get_iv_size(cipher, mode);
    -----------------------------------------------^


Warning: Function "mcrypt_create_iv" does not exist at compile time in /var/www/cphalcon/phalcon/crypt.zep on 340 [nonexistent-function]

      let iv = mcrypt_create_iv(ivSize, MCRYPT_RAND);
    ------------------------------------------------^


Warning: Constant 'MCRYPT_RAND' does not exist at compile time in /var/www/cphalcon/phalcon/crypt.zep on 340 [nonexistent-constant]

      let iv = mcrypt_create_iv(ivSize, MCRYPT_RAND);
    -----------------------------------------------^


Warning: Function "mcrypt_get_block_size" does not exist at compile time in /var/www/cphalcon/phalcon/crypt.zep on 345 [nonexistent-function]

      let blockSize = mcrypt_get_block_size(cipher, mode);
    -----------------------------------------------------^


Warning: Function "mcrypt_encrypt" does not exist at compile time in /var/www/cphalcon/phalcon/crypt.zep on 358 [nonexistent-function]

      return iv . mcrypt_encrypt(cipher, encryptKey, padded, mode, iv);
    ------------------------------------------------------------------^


Warning: Function "mcrypt_get_iv_size" does not exist at compile time in /var/www/cphalcon/phalcon/crypt.zep on 392 [nonexistent-function]

      let ivSize = mcrypt_get_iv_size(cipher, mode);
    -----------------------------------------------^


Warning: Function "mcrypt_decrypt" does not exist at compile time in /var/www/cphalcon/phalcon/crypt.zep on 404 [nonexistent-function]

      let decrypted = mcrypt_decrypt(cipher, decryptKey, substr(text, ivSize), mode, substr(text, 0, ivSize));
    ---------------------------------------------------------------------------------------------------------^


Warning: Function "mcrypt_get_block_size" does not exist at compile time in /var/www/cphalcon/phalcon/crypt.zep on 406 [nonexistent-function]

      let blockSize = mcrypt_get_block_size(cipher, mode);
    -----------------------------------------------------^


Warning: Possible attempt to use non-object in "new" operator in /var/www/cphalcon/phalcon/mvc/model.zep on 584 [non-valid-new]

       let hydrate = new \stdclass();
    --------------------------------^


Warning: Function "phalcon_orm_singlequotes" does not exist at compile time in /var/www/cphalcon/phalcon/mvc/model/query.zep on 511 [nonexistent-function]

           let escapedValue = phalcon_orm_singlequotes(value);
    ---------------------------------------------------------^


Warning: Variable 'sqlJoinConditions' was assigned for the first time in conditional branch, consider initialize it at its declaration in /var/www/cphalcon/phalcon/mvc/model/query.zep on 935 [conditional-initialization]

      ];
    --^
../zephir/bin/zephir: line 39: 27876 Segmentation fault      (core dumped) php $ZEPHIRDIR/compiler.php $*

@fireburnheart2005
Copy link

@jtunggit I think you should install php-mcrypt and rebuild with zephir

@jtunggit
Copy link

jtunggit commented Sep 7, 2014

@fireburnheart2005 thank you .I had install php-mcrypt and rebuild with zephir,and then it also
Warning: Class "APCIterator" does not exist at compile time in /var/www/cphalcon/phalcon/cache/backend/apc.zep on 222 [nonexistent-class]

   apc = new \APCIterator("user", prefixPattern);
------------------------------------------------^

Warning: Possible attempt to use non-object in "new" operator in /var/www/cphalcon/phalcon/mvc/model.zep on 584 [non-valid-new]

   let hydrate = new \stdclass();
--------------------------------^

Warning: Function "phalcon_orm_singlequotes" does not exist at compile time in /var/www/cphalcon/phalcon/mvc/model/query.zep on 511 [nonexistent-function]

       let escapedValue = phalcon_orm_singlequotes(value);
---------------------------------------------------------^

Warning: Variable 'sqlJoinConditions' was assigned for the first time in conditional branch, consider initialize it at its declaration in /var/www/cphalcon/phalcon/mvc/model/query.zep on 935 [conditional-initialization]

  ];
--^

@phalcon

@sergiors
Copy link

in the archlinux phalcon also does not work with php 5.6

@panchtatvam
Copy link

Upgrade to 2.0.0 @sergiors . I too had the issue in Arch with php 5.6 and Apache 2.4.10 . Make sure to copy the compiled phalcon.so from ~/cphalcon/ext/modules to /usr/lib/php/modules as it's not mentioned in the ReadMe.

@iby
Copy link
Contributor

iby commented Oct 16, 2014

Hey everyone, I am having some troubling issues with the view component, so decided to give 2.0 a go and see if its any different there. I am hitting the same 502 problem, just wanted to check if anyone managed to successfully run 2.0 + PHP 5.6.1 + Nginx on a Mac?

@phalcon
Copy link
Collaborator

phalcon commented Oct 16, 2014

@ianbytchek Could you please post a script/app allowing us to produce the problem?

@iby
Copy link
Contributor

iby commented Oct 16, 2014

@phalcon, I'm at the moment stuck with nothing in the logs. I have the latest stable commit dd66f18 and did:

cd ext
./install-test

Gets compiled and installed successfully. phpinfo() shows the enabled extension. When I try to run the app I get:

2014/10/16 23:51:44 [error] 25224#0: *29 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: …, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "…"

When I try to run test (am I using the right ones? seems to be a few too many…):

cd php-tests/tests
phpunit --debug

PHPUnit 4.2.6 by Sebastian Bergmann.

Configuration read from /Users/ianbytchek/Development/cphalcon/php-tests/tests/phpunit.xml



Time: 39 ms, Memory: 3.25Mb

No tests executed!

@iby
Copy link
Contributor

iby commented Oct 16, 2014

@phalcon, when I try to run my own tests it just crashes with Process finished with exit code 139. Again, nothing in the logs… so weird, not even a segfault…

@phalcon
Copy link
Collaborator

phalcon commented Oct 16, 2014

If you can post a simplified PHP file or files that always produce the segfault we could try to reproduce the problem here.

@iby
Copy link
Contributor

iby commented Oct 16, 2014

Ok, I thought nothing is working, but some stuff are functioning. Can you point me in the right direction on two things.

A. What tests should I run in 2.0 branch to ensure standard Phalcon tests are passing?
B. What is the best way to establish where the error happens? GDB is that? Logs are empty, as I'm saying, there's no even a segfault anywhere. It just dies and thats it.

@phalcon
Copy link
Collaborator

phalcon commented Oct 16, 2014

Have a full environment to run all the Phalcon 2 tests would require several tools like: Memcached, Mysql, PostgreSQL, SQLite, Redis, Mongo, Xcache, Apc, Igbinary, etc:

However you can run the tests this way:

cd cphalcon
php codecept.phar build
php codecept.phar run

Second part:

phpunit --debug -c unit-tests/phpunit.xml --testsuite=stable

@iby
Copy link
Contributor

iby commented Oct 16, 2014

I tried the second part, I'm really not sure why, but I get the No tests executed! message, would you have any idea what's wrong with it? The first part gives a segfault, but that might be due to no env configured (or something else on my side).

phpunit --debug -c unit-tests/phpunit.xml --testsuite=stable
PHPUnit 4.2.6 by Sebastian Bergmann.
Configuration read from /Users/ianbytchek/Development/cphalcon/unit-tests/phpunit.xml
Time: 42 ms, Memory: 2.25Mb
No tests executed!

image

@iby
Copy link
Contributor

iby commented Oct 16, 2014

Ok, figured out PHPUnit issue, it doesn't like the global version, but works like this:

$ vendor/phpunit/phpunit/composer/bin/phpunit --debug -c unit-tests/phpunit.xml --testsuite=stable

Produces segfault as well. Will report separately.

@phalcon
Copy link
Collaborator

phalcon commented Oct 17, 2014

Closing this as it's fixed, following last bug in #2914

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants