Forum Moderators: coopster

Message Too Old, No Replies

gearman PHP extension: Segmentation Fault

         

httpwebwitch

10:31 pm on Apr 14, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've installed gearman, and it's running

I added the gearman PECL extension, and it installed OK once I figured out I also needed to install libgearman-devel.

I cut & pasted the out-of-the-box example PHP script, with a worker and a client,

worker is running in the background, like a daemon should (#php worker.php &)

when I run client.php, I get the error "Segmentation Fault".

I don't know how to fix a Segmentation Fault.

What should I do?

eelixduppy

4:10 pm on Apr 22, 2011 (gmt 0)



Sounds like a bug with the PHP extension, and/or missing libraries, etc, because this is not a PHP error, but the code you are running is accessing parts of memory that it shouldn't be.

These types of things are a pain to debug, especially when it's not your code you're using.

Use GDB and try to identify the cause of the seg fault, then proceed from there. This is assuming you are absolutely sure your installation was perfectly correct.

httpwebwitch

5:45 am on Apr 23, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



there's a sad lack of publicized info about this problem.

darn. if this can't be resolved, I might need to degrade the server back to a more stable distro.

My plan was to use gearman to solve a file processing problem; from what I've read it's easier to use gearman than try to write my own daemon.

httpwebwitch

4:31 pm on Apr 23, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



good news.

I tried the Net_Gearman package from PEAR, and it works. I never did get the PECL extension going, but at least now I've got a worker that accepts client commands.

[pear.php.net...]

The syntax is awkward compared to the PECL examples, but I think I can make this do what I want to do

eelixduppy

1:53 pm on Apr 24, 2011 (gmt 0)



Nice, much better way than debugging it the way I suggested. ;)

coopster

2:07 pm on Apr 28, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Out of curiosity, what version of PHP? I had a very hard time with my first PEAR install on a 5.3 box (using PEAR2). I haven't taken a run at it yet with the latest update but am going to give it a whirl soon.

httpwebwitch

5:12 pm on Apr 28, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This server is running 5.3.6

httpwebwitch

5:15 pm on Apr 28, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



btw, this thread was an aside to a different problem I was trying to solve, executing a chattr command from PHP. Turns out that getting a Gearman worker to do a job enables PHP to do things that normally PHP is not allowed to do.

[webmasterworld.com...]

I posted plenty of detail about getting Gearman set up in the other post

coopster

2:52 pm on May 2, 2011 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



From the other thread ...

pear install Net_Gearman


This part is exactly what I am referring to. The PEAR maintainers have changed PEAR/PECL in the 5.3 release. You can find it in the PEAR notes in the PHP distribution as well as on the PEAR install page. You'll notice there is a PEAR2 now that uses Pyrus. It was most confusing/frustrating for me while attempting set up during RC stage so I backed off for awhile. I have configured two 5.3 servers at this point, but no PEAR repository on either yet. I need to dig in soon. More info on Pyrus ...
[pear.php.net...]