LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-23-2015, 11:24 AM   #1
gamelaster
LQ Newbie
 
Registered: Nov 2012
Posts: 7

Rep: Reputation: Disabled
PHP - zend_hash_find throwing segmentation fault


Good day,

first, this is a first forum where i though i can write my trouble, so if im wrong, + move or delete. Thanks

To topic, i trying to run a (relative) old DBUS library for PHP (https://github.com/GAMELASTER/php-dbus - my fork and upgrade for success building) and SkypePHP library (https://github.com/fujimoto/php-skype ). I successfully fixed a DBUS (just trivial forgot of rename) and builded. When i execute skype_bot.php from console as root, its little work but then PHP throw Segmentation fault. Im not a newbie in programming and linux, but with c++ and linux building-debugging i dont have some skills. But i gets a GDB dump and found the root of trouble.
GDB pastebins:
http://pastebin .com/aXnumw74
http://pastebin .com/kWsKkipV

PHP Code:
/* {{{ _dbus_message_resource */
static DBusMessage_dbus_message_resource(zval *obj TSRMLS_DC) {
   
zval **tmp;
   
int resource_type;
   
   if (
obj == NULL) {
      return 
NULL;
   }
   
dbus_objprop_get(*obj"message"tmp0); // line 308
   
if (tmp == NULL) {
      return 
NULL;
   }
   
void *message = (void*)zend_list_find(Z_LVAL_PP(tmp), &resource_type);
   if (
message == NULL || resource_type != le_dbus_message) {
      
php_error_docref(NULL TSRMLS_CCE_WARNING"message identifier not found");
      return 
NULL;
   }

   return 
message;


Here is macro for dbus_objprop_get:
PHP Code:
#define   dbus_objprop_get(zv, key, element, on_error) { \
   
fprintf(stderr"execute dbus_objprop_get\n");\
   if (
zend_hash_find(Z_OBJPROP(zv), keystrlen(key)+1, (void**)&element) != SUCCESS) { \
      
fprintf(stderr"all good\n");\
      
php_error_docref(NULL TSRMLS_CCE_WARNING"property [%s] is not set"key); \
      
fprintf(stderr"good2\n");\
      
element NULL; \
      
on_error; \
   } \

So trouble is in zend_hash_find... As i said, i dont have so much experiences but... :-) I tryied to print a zv, key, element, on_error ... But i dont knowed the values of zend_hash_find so i cant fprintf (my low skills in C++). So, what to do now?

Thanks

P.S. If im fully wrong, where i can ask to this problem? (I tryied ask a author of PHP DBUS but he is inactive... :/ )
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] PHP segmentation fault, .dynamic section "libcrypto.so.6" is not at the expected addr lithos Linux - Software 3 12-08-2011 01:14 PM
php https wrapper giving Segmentation fault but not http imraven Linux - Software 2 03-27-2009 02:20 AM
php core dump with segmentation fault ohcarol *BSD 9 10-14-2008 09:19 AM
PHP-ODBC on OpenBSD 4.1 causes Segmentation fault IMNOboist *BSD 0 06-04-2007 12:33 PM
yast segmentation fault, system freezing - nvidia driver at fault? BaltikaTroika SUSE / openSUSE 2 12-02-2005 09:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 04:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration