For Programmers: Free Programming Magazines  


Home > Archive > PHP Eaccelerator > January 2006 > eA && PHP 5.1









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author eA && PHP 5.1
Sönke Ruempler

2006-01-10, 12:07 am

Hi,

I hope you all had a few happy und relaxing christmas holidays :)

Just some PITA question: did anyone proceed with the bugfixing of the
segfaults? I'd be proud to test and help hunting. ;)

--

soenke



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Hans Rakers

2006-01-10, 12:07 am


Hello,

I've done some work on it in collaboration with Bart vanBrabant aka=20
zoeloelip. There is a preliminary patch at=20
http://home.parse.nl/~hans/eaccel/

Note that this is a work in progress. Your milage may vary.

Please report your succes/failure/suggestions.

Greetings,

Hans Rakers



S=F6nke Ruempler wrote:

>Hi,
>
>I hope you all had a few happy und relaxing christmas holidays :)
>
>Just some PITA question: did anyone proceed with the bugfixing of the
>segfaults? I'd be proud to test and help hunting. ;)
>
>--
>
>soenke
>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: Splunk Inc. Do you grep through log f=

iles
>for problems? Stop! Download the new AJAX search engine that makes
>searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
>http://ads.osdn.com/?ad_id=3D7637&a...6865&op=3Dclick
> ________________________________________
_______
>eAccelerator-developers mailing list
>eAccelerator-developers@lists.sourceforge.net
>https://lists.sourceforge.net/lists...ator-developers
> =20
>




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi=
les
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=3D7637&a...6865&op=3Dclick
Sönke Ruempler

2006-01-10, 12:07 am

Hi Hans,

eaccelerator-developers-admin@lists.sourceforge.net <> wrote on :

> I've done some work on it in collaboration with Bart vanBrabant aka
> zoeloelip. There is a preliminary patch at
> http://home.parse.nl/~hans/eaccel/
>
> Note that this is a work in progress. Your milage may vary.
>
> Please report your succes/failure/suggestions.


Thx for your work! Yeah I couldn't wait to try the patch. ;)

Caching seems to work:

eAccelerator
eAccelerator support enabled
Version 0.9.4-rc1
Caching Enabled true
Optimizer Enabled false
Memory Size 33,554,392 Bytes
Memory Available 15,292,320 Bytes
Memory Allocated 18,262,072 Bytes
Cached Scripts 289
Removed Scripts 0
Cached Keys 0

Directive Local Value Master Value
eaccelerator.cache_dir /tmp/eaccelerator /tmp/eaccelerator
eaccelerator.check_mtime 1 1
eaccelerator.compress 1 1
eaccelerator.compress_level 0 0
eaccelerator.debug 0 0
eaccelerator.enable 1 1
eaccelerator.filter no value no value
eaccelerator.keys shm_and_disk shm_and_disk
eaccelerator.log_file no value no value
eaccelerator.name_space no value no value
eaccelerator.optimizer 0 0
eaccelerator.shm_max 0 0
eaccelerator.shm_only 0 0
eaccelerator.shm_prune_period 0 0
eaccelerator.shm_size 0 0
eaccelerator.shm_ttl 0 0


But restoring and executing the bytecode (as doing a second request to a
page) makes the apache (2.0) segfault.

I tried this primarily with mediawiki software. Is there a way to generate
backtraces like gdb in apache? Or how can we help you for further
developement / bugfixing?

soenke



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Hans Rakers

2006-01-10, 12:07 am


Hi S=F6nke,

See http://httpd.apache.org/dev/debugging.html

The way i do it is with gdb, running apache in single thread mode (run=20
-X in gdb)

You will probably need to isolate your development/debugging work on a=20
webserver that does not serve any other reqs at that time.

The segfault on restore problem is one of the problems i have remaining.=20
Simple scripts work fine, even phpMyAdmin works, but complex class=20
usage/OOP constructions still seem to fail on restore.

Could you please test if the problem persists with the optimizer turned o=
ff?

Thanks for your effort,

Hans





S=F6nke Ruempler wrote:

>Hi Hans,
>
>eaccelerator-developers-admin@lists.sourceforge.net <> wrote on :
>
> =20
>
>
>Thx for your work! Yeah I couldn't wait to try the patch. ;)
>
>Caching seems to work:
>
>eAccelerator
>eAccelerator support enabled
>Version 0.9.4-rc1
>Caching Enabled true
>Optimizer Enabled false
>Memory Size 33,554,392 Bytes
>Memory Available 15,292,320 Bytes
>Memory Allocated 18,262,072 Bytes
>Cached Scripts 289
>Removed Scripts 0
>Cached Keys 0
>
>Directive Local Value Master Value
>eaccelerator.cache_dir /tmp/eaccelerator /tmp/eaccelerator
>eaccelerator.check_mtime 1 1
>eaccelerator.compress 1 1
>eaccelerator.compress_level 0 0
>eaccelerator.debug 0 0
>eaccelerator.enable 1 1
>eaccelerator.filter no value no value
>eaccelerator.keys shm_and_disk shm_and_disk
>eaccelerator.log_file no value no value
>eaccelerator.name_space no value no value
>eaccelerator.optimizer 0 0
>eaccelerator.shm_max 0 0
>eaccelerator.shm_only 0 0
>eaccelerator.shm_prune_period 0 0
>eaccelerator.shm_size 0 0
>eaccelerator.shm_ttl 0 0
>
>
>But restoring and executing the bytecode (as doing a second request to a
>page) makes the apache (2.0) segfault.
>
>I tried this primarily with mediawiki software. Is there a way to genera=

te
>backtraces like gdb in apache? Or how can we help you for further
>developement / bugfixing?
>
>soenke
>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: Splunk Inc. Do you grep through log f=

iles
>for problems? Stop! Download the new AJAX search engine that makes
>searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
>http://ads.osdn.com/?ad_id=3D7637&a...6865&op=3Dclick
> ________________________________________
_______
>eAccelerator-developers mailing list
>eAccelerator-developers@lists.sourceforge.net
>https://lists.sourceforge.net/lists...ator-developers
> =20
>




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi=
les
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=3D7637&a...6865&op=3Dclick
Sönke Ruempler

2006-01-10, 12:07 am

eaccelerator-developers-admin@lists.sourceforge.net <> wrote on :

> See http://httpd.apache.org/dev/debugging.html
>
> The way i do it is with gdb, running apache in single thread
> mode (run
> -X in gdb)
>
> You will probably need to isolate your development/debugging
> work on a
> webserver that does not serve any other reqs at that time.


Thx for instructions.

Here the first output:

(gdb) file /usr/sbin/httpd
Reading symbols from /usr/sbin/httpd...done.
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) set args -X
(gdb) run
Starting program: /usr/sbin/httpd -X
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xffffe000
[Thread debugging using libthread_db enabled]
[New Thread -1213249856 (LWP 18670)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1213249856 (LWP 18670)]
_efree (ptr=0x0) at /usr/src/php-5.1.1/Zend/zend_alloc.c:286
286 CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);
(gdb)

> The segfault on restore problem is one of the problems i have
> remaining. Simple scripts work fine, even phpMyAdmin works, but
> complex class usage/OOP constructions still seem to fail on restore.


Yep - I've experienced exactly the same here.

> Could you please test if the problem persists with the
> optimizer turned off?


The optimizer is turned off as well as sessions etc.



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Bart Vanbrabant

2006-01-10, 12:07 am

Sönke Ruempler wrote:
> eaccelerator-developers-admin@lists.sourceforge.net <> wrote on :
>
>
>
> Thx for instructions.
>
> Here the first output:
>
> (gdb) file /usr/sbin/httpd
> Reading symbols from /usr/sbin/httpd...done.
> Using host libthread_db library "/lib/libthread_db.so.1".
> (gdb) set args -X
> (gdb) run
> Starting program: /usr/sbin/httpd -X
> Reading symbols from shared object read from target memory...done.
> Loaded system supplied DSO at 0xffffe000
> [Thread debugging using libthread_db enabled]
> [New Thread -1213249856 (LWP 18670)]
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1213249856 (LWP 18670)]
> _efree (ptr=0x0) at /usr/src/php-5.1.1/Zend/zend_alloc.c:286
> 286 CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);
> (gdb)
>


When you get here, please type bt. It will generate a backtrace.

g,

Bart

--
Bart Vanbrabant <bart.vanbrabant@zoeloelip.be>
PGP fingerprint: 093C BB84 17F6 3AA6 6D5E FC4F 84E1 FED1 E426 64D1



Hans Rakers

2006-01-10, 12:07 am

Bart Vanbrabant wrote:

>S=F6nke Ruempler wrote:
> =20
>
>
>When you get here, please type bt. It will generate a backtrace.
>
>g,
>
>Bart
>
> =20
>


Its exactly the same point where it crashes here. I already have a=20
backtrace of this particular case. This one is from=20
eaccelerator.php?dump=3D with Smarty classes in the cache. Looks to me=20
like the class entries get screwed somewhere.


Program received signal SIGSEGV, Segmentation fault.
_efree (ptr=3D0x0) at /usr/src/php-5.1.1/Zend/zend_alloc.c:286
286 CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);
(gdb) bt
#0 _efree (ptr=3D0x0) at /usr/src/php-5.1.1/Zend/zend_alloc.c:286
#1 0xb7429450 in dump_op_array (p=3D0xb640c8b8) at=20
/usr/src/eaccelerator-cvs/eaccelerator/webui.c:801
#2 0xb742afb7 in eaccelerator_dump_all () at=20
/usr/src/eaccelerator-cvs/eaccelerator/webui.c:1173
#3 0xb742c534 in zif_eaccelerator (ht=3D0, return_value=3D0x81b1854,=20
return_value_ptr=3D0x0, this_ptr=3D0x0, return_value_used=3D0) at=20
/usr/src/eaccelerator-cvs/eaccelerator/webui.c:1651
#4 0xb7b68b33 in zend_do_fcall_common_helper_SPEC=20
(execute_data=3D0xbfaa4dc0) at zend_vm_execute.h:188
#5 0xb7b68389 in execute (op_array=3D0x81b16a4) at zend_vm_execute.h:88
#6 0xb7b43f7c in zend_execute_scripts (type=3D8, retval=3D0x0,=20
file_count=3D3) at /usr/src/php-5.1.1/Zend/zend.c:1090
#7 0xb7b0977f in php_execute_script (primary_file=3D0xbfaa7140) at=20
/usr/src/php-5.1.1/main/main.c:1704
#8 0xb7bc56be in apache_php_module_main (r=3D0x81a708c,=20
display_source_mode=3D0) at /usr/src/php-5.1.1/sapi/apache/sapi_apache.c:=
53
#9 0xb7bc6237 in send_php (r=3D0x81a708c, display_source_mode=3D0,=20
filename=3D0x0) at /usr/src/php-5.1.1/sapi/apache/mod_php5.c:644
#10 0xb7bc63f2 in send_parsed_php (r=3D0x81a708c) at=20
/usr/src/php-5.1.1/sapi/apache/mod_php5.c:659
#11 0x0805411f in ap_invoke_handler ()
#12 0x080691c7 in process_request_internal ()
#13 0x08069226 in ap_process_request ()
#14 0x08060236 in child_main ()
#15 0x080603de in make_child ()
#16 0x08060544 in startup_children ()
#17 0x08060be4 in standalone_main ()
#18 0x08061402 in main ()



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi=
les
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=3D7637&a...6865&op=3Dclick
Bart Vanbrabant

2006-01-10, 12:07 am

Hans Rakers wrote:
> Bart Vanbrabant wrote:
>
>
> Its exactly the same point where it crashes here. I already have a
> backtrace of this particular case. This one is from
> eaccelerator.php?dump= with Smarty classes in the cache. Looks to me
> like the class entries get screwed somewhere.
>
>
> Program received signal SIGSEGV, Segmentation fault.
> _efree (ptr=0x0) at /usr/src/php-5.1.1/Zend/zend_alloc.c:286
> 286 CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);
> (gdb) bt
> #0 _efree (ptr=0x0) at /usr/src/php-5.1.1/Zend/zend_alloc.c:286
> #1 0xb7429450 in dump_op_array (p=0xb640c8b8) at
> /usr/src/eaccelerator-cvs/eaccelerator/webui.c:801
> #2 0xb742afb7 in eaccelerator_dump_all () at
> /usr/src/eaccelerator-cvs/eaccelerator/webui.c:1173
> #3 0xb742c534 in zif_eaccelerator (ht=0, return_value=0x81b1854,
> return_value_ptr=0x0, this_ptr=0x0, return_value_used=0) at
> /usr/src/eaccelerator-cvs/eaccelerator/webui.c:1651
> #4 0xb7b68b33 in zend_do_fcall_common_helper_SPEC
> (execute_data=0xbfaa4dc0) at zend_vm_execute.h:188
> #5 0xb7b68389 in execute (op_array=0x81b16a4) at zend_vm_execute.h:88
> #6 0xb7b43f7c in zend_execute_scripts (type=8, retval=0x0,
> file_count=3) at /usr/src/php-5.1.1/Zend/zend.c:1090
> #7 0xb7b0977f in php_execute_script (primary_file=0xbfaa7140) at
> /usr/src/php-5.1.1/main/main.c:1704
> #8 0xb7bc56be in apache_php_module_main (r=0x81a708c,
> display_source_mode=0) at /usr/src/php-5.1.1/sapi/apache/sapi_apache.c:53
> #9 0xb7bc6237 in send_php (r=0x81a708c, display_source_mode=0,
> filename=0x0) at /usr/src/php-5.1.1/sapi/apache/mod_php5.c:644
> #10 0xb7bc63f2 in send_parsed_php (r=0x81a708c) at
> /usr/src/php-5.1.1/sapi/apache/mod_php5.c:659
> #11 0x0805411f in ap_invoke_handler ()
> #12 0x080691c7 in process_request_internal ()
> #13 0x08069226 in ap_process_request ()
> #14 0x08060236 in child_main ()
> #15 0x080603de in make_child ()
> #16 0x08060544 in startup_children ()
> #17 0x08060be4 in standalone_main ()
> #18 0x08061402 in main ()

Maybe this piece of code is usefull. I got it from segv a while ago.
It's quite hacky and it doesn't work with php5.1 anymore.
http://zoeloelip.be/ea/dprint.c

Take a look at the last function:

dprint_compiler_retval

It print's out the op_array and the function hashtable and class hashtable. It does this in the way vimdiff can show very nice. You can print out these variables after compilation, when it's returned from cache, after optimisation. This way you can track what parts are changed by eAccelerator.

I hope this helps.

g,

Bart



--
Bart Vanbrabant <bart.vanbrabant@zoeloelip.be>
PGP fingerprint: 093C BB84 17F6 3AA6 6D5E FC4F 84E1 FED1 E426 64D1



Sönke Ruempler

2006-01-10, 12:07 am

eaccelerator-developers-admin@lists.sourceforge.net <> wrote on :

> When you get here, please type bt. It will generate a backtrace.


Starting program: /usr/sbin/httpd -X
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xffffe000
[Thread debugging using libthread_db enabled]
[New Thread -1213397312 (LWP 11118)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1213397312 (LWP 11118)]
_efree (ptr=3D0x0) at /usr/src/php-5.1.1/Zend/zend_alloc.c:286
286 CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);
(gdb) bt
#0 _efree (ptr=3D0x0) at /usr/src/php-5.1.1/Zend/zend_alloc.c:286
#1 0xb7900d0b in destroy_zend_class (pce=3D0x0) at
/usr/src/php-5.1.1/Zend/zend_opcode.c:168
#2 0xb7910ca5 in zend_hash_del_key_or_index (ht=3D0x825de00, =
arKey=3DVariable
"arKey" is not available.
) at /usr/src/php-5.1.1/Zend/zend_hash.c:490
#3 0xb791118c in zend_hash_reverse_apply (ht=3D0x825de00,
apply_func=3D0xb78fd504 <is_not_internal_class> )
at /usr/src/php-5.1.1/Zend/zend_hash.c:736
#4 0xb78fe051 in shutdown_executor () at
/usr/src/php-5.1.1/Zend/zend_execute_API.c:264
#5 0xb79085f8 in zend_deactivate () at =
/usr/src/php-5.1.1/Zend/zend.c:835
#6 0xb78d4ca4 in php_request_shutdown (dummy=3D0x0) at
/usr/src/php-5.1.1/main/main.c:1268
#7 0xb798a38a in php_handler (r=3D0x8348dd0) at
/usr/src/php-5.1.1/sapi/apache2handler/sapi_apache2.c:443
#8 0x080676ce in ap_run_handler (r=3D0x8348dd0) at config.c:152
#9 0x08067a46 in ap_invoke_handler (r=3D0x8348dd0) at config.c:364
#10 0x08065199 in ap_process_request (r=3D0x8348dd0) at =
http_request.c:249
#11 0x08060bd9 in ap_process_http_connection (c=3D0x833e970) at
http_core.c:251
#12 0x0806feda in ap_run_process_connection (c=3D0x833e970) at =
connection.c:43
#13 0x08065e6e in child_main (child_num_arg=3DVariable "child_num_arg" =
is not
available.
) at prefork.c:610
#14 0x08066021 in make_child (s=3D0x809ce58, slot=3D0) at prefork.c:650
#15 0x080660ea in startup_children (number_to_start=3D5) at =
prefork.c:722
#16 0x080668ac in ap_mpm_run (_pconf=3D0x809b0a8, plog=3D0x80c5150, =
s=3D0x809ce58)
at prefork.c:941
#17 0x0806bb7f in main (argc=3D2, argv=3D0xbf824e44) at main.c:618

--=20

Mit freundlichem Gru=DF

S=F6nke Ruempler
Technik

top concepts Internetmarketing GmbH
Am Steinkamp 7 - D-21684 Stade - Germany
------------------------------------------------------------
http://www.topconcepts.de Tel. +49 1805 9977 501*
mail: ruempler@topconcepts.de Fax. +49 1805 9977 502*
------------------------------------------------------------
SMS Versand ab 9.9 Cent: http://sms-gw.topconcepts.de
------------------------------------------------------------
Handelsregister: AG Tostedt HRB 100687 - UstId: DE 213645563
------------------------------------------------------------
*) EUR 0,12/Min. (CNS24)
------------------------------------------------------------
--> http://efn.no/html-bad.html
--> http://learn.to/quote



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com