php segfault using php 5.3 and Zend Loader 5.5.0

General discussion on Zend Guard / Optimizer
lansoweb
Posts: 14
Joined: Tue Jun 01, 2010 1:47 pm

php segfault using php 5.3 and Zend Loader 5.5.0

Post by lansoweb » Fri Jan 14, 2011 5:56 pm

Hello all!

I have a system used by some clients with php 5.2 and encoded with otimization and obfustation and all works fine. I got the same code and encoded with ZendGuard 5.5 for php 5.3 (the php provided with ubuntu server 10.04 LTS) and some files give me segfault:
[ 5014.116391] php[24480]: segfault at 55ddf277 ip 08318069 sp bf882da8 error 4 in php5[8048000+6db000]

This occurs both via apache2 and cli. Most of the files work, but some do not.
The most basic example is a php that has only a javascript code to open a new window, and i get the segfault:

# php index.php
Segmentation fault

The same file unencoded works fine.

Here is the gdb output:

Starting program: /usr/bin/php index.php
[Thread debugging using libthread_db enabled]
[New Thread 0xb5224b70 (LWP 9975)]
[Thread 0xb5224b70 (LWP 9975) exited]

Program received signal SIGSEGV, Segmentation fault.
0x08318069 in zend_hash_index_find ()

I've try to disable all extensions, same thing ...

Here are my versions:
#uname -a
Linux ubuntu 2.6.32-27-generic-pae #49-Ubuntu SMP Thu Dec 2 00:07:52 UTC 2010 i686 GNU/Linux

# php -v
PHP 5.3.2-1ubuntu4.7 with Suhosin-Patch (cli) (built: Jan 12 2011 18:36:08)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies

# apache2 -v
Server version: Apache/2.2.14 (Ubuntu)
Server built: Nov 18 2010 21:17:19

Any directions?

Thank you very much!
Leandro

lansoweb
Posts: 14
Joined: Tue Jun 01, 2010 1:47 pm

Re: php segfault using php 5.3 and Zend Loader 5.5.0

Post by lansoweb » Fri Jan 14, 2011 6:04 pm

One more information:
I've tried just encoding, without any obfuscation, same thing ...

davehunter
Posts: 3
Joined: Mon Jan 17, 2011 4:24 am

Re: php segfault using php 5.3 and Zend Loader 5.5.0

Post by davehunter » Mon Jan 17, 2011 4:35 am

I'm also being affected by this issue. Getting segfaults from both apache2 and cli.

I'm running Ubuntu 10.04 virtual servers, both in 32 and 64 bit. Segfaults happen on both architectures.

# php -v
PHP 5.3.2-1ubuntu4.7 with Suhosin-Patch (cli) (built: Jan 12 2011 18:36:08)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies


Entry from apache2 error log:

[Mon Jan 17 14:32:24 2011] [notice] child pid 975 exit signal Segmentation fault (11)


# uname -a
Linux joshdev-43 2.6.32-27-generic-pae #49-Ubuntu SMP Thu Dec 2 00:07:52 UTC 2010 i686 GNU/Linux


We'd like to move to php 5.3 using Zend, but can't while this is happening. Any help would be greatly appreciated.

Regards,

Dave.

yoramb
Posts: 35
Joined: Tue Jun 02, 2009 3:48 pm

Re: php segfault using php 5.3 and Zend Loader 5.5.0

Post by yoramb » Wed Jan 19, 2011 9:38 am

Thanks for the detailed information.
Is it possible for you to test if you get the same crash with ZendServer CE (community edition) ? the problem might be related to specific compilation which is done by Ubuntu.
It can also be helpfull to install a debug package of PHP (provided as php5-dbg or similar) to make the backtarce more informative.

davehunter
Posts: 3
Joined: Mon Jan 17, 2011 4:24 am

Re: php segfault using php 5.3 and Zend Loader 5.5.0

Post by davehunter » Fri Jan 21, 2011 1:23 am

I've tried the encrypted code on ZendServer CE and can confirm I don't experience any segfaults.

It may be as you suspect - something to do with the php packages delivered from the Ubuntu repos. I'll do some more testing and post the outcome.

davehunter
Posts: 3
Joined: Mon Jan 17, 2011 4:24 am

Re: php segfault using php 5.3 and Zend Loader 5.5.0

Post by davehunter » Fri Jan 21, 2011 2:15 am

Results of the gdb output:

Program terminated with signal 11, Segmentation fault.
#0 zend_hash_index_find (ht=0x433fa1402a45b7df, h=0, pData=0x7fff237eed38) at /build/buildd/php5-5.3.2/Zend/zend_hash.c:1183
1183 /build/buildd/php5-5.3.2/Zend/zend_hash.c: No such file or directory.
in /build/buildd/php5-5.3.2/Zend/zend_hash.c

Server details:

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.1 LTS
Release: 10.04
Codename: lucid


# php -v
PHP 5.3.2-1ubuntu4.7 with Suhosin-Patch (cli) (built: Jan 12 2011 18:36:55)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies


# apache2 -v
Server version: Apache/2.2.14 (Ubuntu)
Server built: Nov 18 2010 21:19:09


Hope this helps.

jwhitson
Posts: 2
Joined: Thu Jan 12, 2012 6:51 pm

Re: php segfault using php 5.3 and Zend Loader 5.5.0

Post by jwhitson » Thu Jan 12, 2012 6:54 pm

Any luck with this? I am having this issue with the following versions:

Ubuntu 10.04
Linux www-02 2.6.32-33-server #72-Ubuntu SMP Fri Jul 29 21:21:55 UTC 2011 x86_64 GNU/Linux

PHP 5.3
PHP 5.3.2-1ubuntu4.11 with Suhosin-Patch (cli) (built: Dec 13 2011 18:49:27)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

Apache 2.2
Server version: Apache/2.2.14 (Ubuntu)
Server built: Nov 3 2011 03:29:23

I am trying to install FileRun (http://www.filerun.com/) and keep getting "[Thu Jan 12 11:48:45 2012] [notice] child pid 10681 exit signal Segmentation fault (11)"

I installed ZendGuardLoader.so (64-bit) and added the proper lines to my php.ini.

User avatar
kentatzend
Posts: 1778
Joined: Thu Dec 11, 2008 1:08 pm

Re: php segfault using php 5.3 and Zend Loader 5.5.0

Post by kentatzend » Thu Jan 12, 2012 6:58 pm

Was the version of the software you downloaded specifically encoded for PHP 5.3? IUf not you need to get a new version encoded for 5.3.

jwhitson
Posts: 2
Joined: Thu Jan 12, 2012 6:51 pm

Re: php segfault using php 5.3 and Zend Loader 5.5.0

Post by jwhitson » Thu Jan 12, 2012 7:01 pm

Yes. I downloaded "Zend Guard Loader (Runtime for PHP 5.3)" from here: http://www.zend.com/en/products/guard/downloads

User avatar
kentatzend
Posts: 1778
Joined: Thu Dec 11, 2008 1:08 pm

Re: php segfault using php 5.3 and Zend Loader 5.5.0

Post by kentatzend » Fri Jan 13, 2012 11:32 pm

I meant the encoded PHP software .... not Guard loader. The encoded PHP file must be specifically encoded for PHP 5.2 or PHP5.3 One encoded file will not support both.

Post Reply