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

Segmentation fault with PHP 5.6.16 #195

Closed
prolic opened this issue Dec 26, 2015 · 12 comments
Closed

Segmentation fault with PHP 5.6.16 #195

prolic opened this issue Dec 26, 2015 · 12 comments

Comments

@prolic
Copy link
Contributor

prolic commented Dec 26, 2015

see also: https://bugs.php.net/bug.php?id=71011

Bug appears in 5.6.15 & 5.6.16.
5.6.11 however is good!
5.6.09 and 5.6.13 seems to be good as well (tested on other machines).

I could not yet isolate the bug, but can show how to reproduce it.

Steps to reproduce:

git clone https://github.com/zendframework/ZendSkeletonApplication
cd ZendSkeletonApplication
composer install
composer require prolic/humus-supervisor-module dev-master
composer require prolic/humus-amqp-demo-module v0.1.1

vi config/application.config.php
add to your module's array:

'HumusAmqpModule',
'HumusAmqpDemoModule',

php public/index.php humus amqp setup-fabric

Output:
Setting up the AMQP fabric
Declaring exchanges ...
Declaring queues ...
[1] 15474 segmentation fault (core dumped)

Backtrace:
`
#0 _zend_mm_free_int (heap=0x135c940, p=0x1aa4978) at /home/sasa/Downloads/php-5.6.16/Zend/zend_alloc.c:2104
#1 0x0000000000870697 in zend_object_std_dtor (object=0x1adc620, tsrm_ls=) at /home/sasa/Downloads/php-5.6.16/Zend/zend_objects.c:54
#2 0x00000000008706c9 in zend_objects_free_object_storage (object=0x1adc620, tsrm_ls=)

at /home/sasa/Downloads/php-5.6.16/Zend/zend_objects.c:137

#3 0x0000000000877596 in zend_objects_store_del_ref_by_handle_ex (handle=, handlers=, tsrm_ls=tsrm_ls@entry=0x135c3a0)

at /home/sasa/Downloads/php-5.6.16/Zend/zend_objects_API.c:226

#4 0x00000000008775ee in zend_objects_store_del_ref (zobject=0x1ae3750, tsrm_ls=0x135c3a0)

at /home/sasa/Downloads/php-5.6.16/Zend/zend_objects_API.c:178

#5 0x00000000008baa62 in _zval_dtor (zvalue=0x1ae3750) at /home/sasa/Downloads/php-5.6.16/Zend/zend_variables.h:35
#6 zend_assign_to_variable (tsrm_ls=0x135c3a0, value=0x17c9c88, variable_ptr_ptr=0x7f8a708bafc0)

at /home/sasa/Downloads/php-5.6.16/Zend/zend_execute.c:922

#7 ZEND_ASSIGN_SPEC_CV_VAR_HANDLER (execute_data=0x7f8a708baec0, tsrm_ls=0x135c3a0) at /home/sasa/Downloads/php-5.6.16/Zend/zend_vm_execute.h:37468
#8 0x000000000088754b in execute_ex (execute_data=0x7f8a708baec0, tsrm_ls=0x135c3a0) at /home/sasa/Downloads/php-5.6.16/Zend/zend_vm_execute.h:363
#9 0x0000000000834fb6 in zend_call_function (fci=fci@entry=0x7ffcc0819960, fci_cache=, fci_cache@entry=0x7ffcc0819930,

tsrm_ls=tsrm_ls@entry=0x135c3a0) at /home/sasa/Downloads/php-5.6.16/Zend/zend_execute_API.c:829

#10 0x0000000000714e0c in zif_call_user_func (ht=, return_value=0x198a3a0, return_value_ptr=, this_ptr=,

return_value_used=<optimized out>, tsrm_ls=0x135c3a0) at /home/sasa/Downloads/php-5.6.16/ext/standard/basic_functions.c:4759

#11 0x000000000090091e in zend_do_fcall_common_helper_SPEC (execute_data=, tsrm_ls=0x135c3a0)

at /home/sasa/Downloads/php-5.6.16/Zend/zend_vm_execute.h:558

#12 0x000000000088754b in execute_ex (execute_data=0x7f8a708b9880, tsrm_ls=0x135c3a0) at /home/sasa/Downloads/php-5.6.16/Zend/zend_vm_execute.h:363
#13 0x000000000084767c in zend_execute_scripts (type=type@entry=8, tsrm_ls=tsrm_ls@entry=0x135c3a0, retval=retval@entry=0x0,

file_count=file_count@entry=3) at /home/sasa/Downloads/php-5.6.16/Zend/zend.c:1341

#14 0x00000000007d428a in php_execute_script (primary_file=primary_file@entry=0x7ffcc081bfe0, tsrm_ls=tsrm_ls@entry=0x135c3a0)

at /home/sasa/Downloads/php-5.6.16/main/main.c:2597

#15 0x00000000009026f6 in do_cli (argc=5, argv=0x135c300, tsrm_ls=0x135c3a0) at /home/sasa/Downloads/php-5.6.16/sapi/cli/php_cli.c:994
#16 0x0000000000434254 in main (argc=5, argv=0x135c300) at /home/sasa/Downloads/php-5.6.16/sapi/cli/php_cli.c:1378

`

@pinepain
Copy link
Contributor

Hi! Thanks for reporting!

To help to locate a problem, please provide following info:

  • platform info (uname -a, lsb_release -a);
  • whether any virtualization used (docket, vagrant, etc.);
  • php interpreter version (php -v);
  • SAPI mode (cli, fpm, cgi, etc) extension is used in;
  • php-amqp extension version (php --ri amqp) and a way it was installed (pecl, from sources or binaries, if from binaries, post a link to it, if it an option);
  • librabbitmq version and a way it was installed (sources, from distro repo, third-party binaries);
  • RabbitMQ server version.

If you are able (or will be, in case you locate problem), please, provide also minimal code to reproduce the problem.

P.S.: Please, put stacktrace in codeblock while hash-numbers #<number> parsed as a reference to issues and pull-request and creates there unnecessary mentions which may be confused for further researches.

@prolic
Copy link
Contributor Author

prolic commented Dec 27, 2015

uname -a

Linux sasa-X1 4.2.0-22-generic #27-Ubuntu SMP Thu Dec 17 22:57:08 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.10
Release: 15.10
Codename: wily

no docker / vagrant in use, plain ubuntu, tested on several machines

php -v
PHP 5.6.16 (cli) (built: Dec 1 2015 21:29:40)
(problem is also there with 5.6.15 and could be reproduced with 5.6.11 as well today)

sapi module:
cli

ext-amqp 1.6.1. (from pecl)

librabbitmq-version: 0.5.2

RabbitMQ Server 3.5.4

@prolic
Copy link
Contributor Author

prolic commented Dec 27, 2015

Will update to librabbitmq-c v0.7.1 and test again.

@pinepain
Copy link
Contributor

Please, try php-amqp 1.7.0alpha2 or from my branch from PR #194. Using more recent librabbitmq is also good idea.

@prolic
Copy link
Contributor Author

prolic commented Dec 27, 2015

I just compiled librabbitmq-c v0.7.1 and reinstalled amqp extension, same problem.

@pinepain
Copy link
Contributor

librabbitmq is less likely the problem, try more recent php-amqp extension itself (as I suggested in post above).

After your original report I tried to reproduce as you described and everything looks working on PHP 7:

using 1.7.0alpha2

$ php --ri amqp

amqp

Version => v1.7.0alpha2-master-dev
Revision => 8573ac1

...

$ php public/index.php humus amqp setup-fabric
Setting up the AMQP fabric
Declaring exchanges ...
Declaring queues ...
DONE

and using my branch from PR #194:

$ php --ri amqp

amqp

Version => v1.7.0alpha1-fix_stalled_connection_resource-dev
Revision => 5879bc3

...

$ php public/index.php humus amqp setup-fabric
Setting up the AMQP fabric
Declaring exchanges ...
Declaring queues ...
DONE

Give it a try with PHP 5, since php-amqp 1.7.0 we support both PHP 5 and PHP 7.

@prolic
Copy link
Contributor Author

prolic commented Dec 27, 2015

I just recompiled php amqp extension from your PR #194 and the problem is gone.
Thank you very much!!!

When will it be merged and ready for release?

Btw: When is the php 7 support finalized?

@pinepain
Copy link
Contributor

I guess PR will be reviewd and merged after xmas and ny holidays.

PHP 7 fully supported in 1.7.0 already (if I understood your question correct). You can always check what versions "officially" supported by checking travis build matrix (PHP 7 with memcheck builds are red due to outdated valgrind version).

@pinepain
Copy link
Contributor

P.S.: Please, put stacktrace in codeblock while hash-numbers # parsed as a reference to issues and pull-request and creates there unnecessary mentions which may be confused for further researches.

@prolic
Copy link
Contributor Author

prolic commented Dec 27, 2015

1.7.0 is only alpha2 and not final, as far as I can see. My question was about when I can expect a final release. I really apprieciate your work !!!

FYI: I am working on a rewrite of my amqp lib for php at https://github.com/prolic/HumusAmqp. Perhaps you'll find it useful. Any feedback is welcome :)

Closing this issue now, as your PR #194 solves it.

@prolic prolic closed this as completed Dec 27, 2015
@pinepain
Copy link
Contributor

I have https://github.com/pinepain/amqpy (there are branch where I start rewriting to add php-amqplib support) and https://github.com/pinepain/parsley, which is more a proof of concept, needs refactoring and redesign, but may be used as a reference for further works. Check it, maybe you will find it useful.

@prolic
Copy link
Contributor Author

prolic commented Dec 27, 2015

Thanks! Will definitely take a look!

Wish you a happy new year!

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

2 participants