Skip to content

Issue with php crash on the same server with tarantool #103

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

Closed
arthurkushman opened this issue Sep 2, 2016 · 8 comments
Closed

Issue with php crash on the same server with tarantool #103

arthurkushman opened this issue Sep 2, 2016 · 8 comments
Assignees
Labels
bug Something isn't working need feedback php7
Milestone

Comments

@arthurkushman
Copy link

arthurkushman commented Sep 2, 2016

The error:
2016/09/02 10:33:19 [error] 103403#0: *94 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: x.x.x.x, server: xxx.com, request: "POST /oauth2/token HTTP/1.1", upstream: "fastcgi://127.0.0.1:9007", host: "xxx.com"

The code:

    public function checkUserCredentials($username, $password)
    {
        $user = $this->connection->select($this->config['user_key'], $username)[0][1];
//        print_r($user);die;
// if printing with die; - ok, result:
// Array
// (
//    [username] => testuser
//    [password] => xxx
//    [first_name] => First
//    [last_name] => Last
//)
// if trying to return any value with taking data from Tarantool - code fails, 
// otherwise - if trying to return without taking data from Tarantool code works ok. 
//        return (bool) (!empty($user) && $user['password'] === $password);
        return true;
    }

The error is stable.

Server configuration:

CentOS 7.2.x
// ---------
PHP 7.0.10 (cli) (built: Aug 31 2016 18:07:34) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.10, Copyright (c) 1999-2016, by Zend Technologies
// ---------- 
tarantool: version 1.6.8-530-g9c48ea8
// ----------
branch of php-tarantool extension, php7-v1

Hope You can find the solution soon, Your mates from TASS, Russia/Moscow - thx.

@arthurkushman
Copy link
Author

arthurkushman commented Sep 2, 2016

Tried several things:

  • kill the arr data with something like unset($user[0]); and reassign to variable
  • gc_collect_cycles(); in case when objects not cleared properly in RAM

No luck with those above.

@arthurkushman
Copy link
Author

arthurkushman commented Sep 2, 2016

Trace from backlog:

#0  0x00007f599b560a81 in _emalloc ()
#1  0x00007f598339a140 in php_mp_unpack_str () from /usr/lib64/php/modules/tarantool.so
#2  0x00007f598339a4dd in php_mp_unpack_map () from /usr/lib64/php/modules/tarantool.so
#3  0x00007f598339a65c in php_mp_unpack_array () from /usr/lib64/php/modules/tarantool.so
#4  0x00007f598339a65c in php_mp_unpack_array () from /usr/lib64/php/modules/tarantool.so
#5  0x00007f598339a4dd in php_mp_unpack_map () from /usr/lib64/php/modules/tarantool.so
#6  0x00007f5983395339 in tarantool_step_recv () from /usr/lib64/php/modules/tarantool.so
#7  0x00007f5983397ab1 in zim_tarantool_class_select () from /usr/lib64/php/modules/tarantool.so

@arthurkushman
Copy link
Author

arthurkushman commented Sep 2, 2016

#2  zend_string_init (persistent=0, len=8, 
    str=0x7f599d894693 "testuser\250password\253querty12345\252first_name\246Arthur\251last_name\247Kushman")
    at /usr/include/php/Zend/zend_string.h:157
        ret = <optimized out>
#3  php_mp_unpack_str (oval=0x7ffe2effc010, str=<optimized out>)
    at /usr/src/debug/php7-tarantool-0.1.0.0/src/tarantool_msgpack.c:237
        __z = 0x7ffe2effc010
        __s = <optimized out>
        len = 8
        out = 0x7f599d894693 "testuser\250password\253querty12345\252first_name\246Arthur\251last_name\247Kushman"

We even found the string where error occurs, credentials are fake one - so we don't care, good luck.

@arthurkushman
Copy link
Author

WTF? 4 days - no answer.

@bigbes bigbes self-assigned this Sep 6, 2016
@bigbes bigbes added bug Something isn't working php7 labels Sep 6, 2016
@bigbes
Copy link
Contributor

bigbes commented Sep 6, 2016

Sorry for long response.

Can you provide full request contents? Something like this gdb commands:

b tarantool_step_recv
-- + `n` while not on 274 line
-- OR
b tarantool.c:274
-- and then hexdump from position `pos` to `pos + body_size`
dump binary memory dump.bin pos pos+body_size

then convert it to hex (using xxd, for example) and paste it here, please.

@bigbes
Copy link
Contributor

bigbes commented Sep 6, 2016

It's problem with decoding msgpack. I've tried to repeat it with data, that you've provided before and had no luck, sorry.

@kostja kostja changed the title Issue with php crush on the same server with tarantool Issue with php crash on the same server with tarantool Sep 22, 2016
@bigbes
Copy link
Contributor

bigbes commented Sep 22, 2016

Any update on giving me data?

@bigbes bigbes added this to the 0.2.0 milestone Sep 22, 2016
@bigbes
Copy link
Contributor

bigbes commented Feb 6, 2017

This issue is very long. Closing due to lack of data.
Feel free to reopen this ticket on new data.

@bigbes bigbes closed this as completed Feb 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need feedback php7
Projects
None yet
Development

No branches or pull requests

2 participants