Raygun4WP causing PHP cgi segfaults

Brian Prodoehl

Posted on
Jan 21 2014

I installed Raygun4WP through the WordPress admin panel, and after entering an API key, my server began dishing up error code 500 for every request, and I'm seeing general protection faults out of php5-cgi.

OS: Debian 6.0 (Squeeze) lighttpd/1.4.28 (ssl) (Nov 14 2013 10:39:45) - a light and fast webserver PHP 5.3.28-1~dotdeb.0 with Suhosin-Patch (cli) (built: Dec 13 2013 01:38:56) WordPress 3.8

I have the curl library installed, and I believe it is properly enabled. If I restart lighttpd, there's a chance that the server will function normally for a minute or two before it starts serving up 500's again.

In the php error log, I see this:

2014-01-20 18:37:34: (modfastcgi.c.3356) response not received, request sent: 1806 on socket: unix:/tmp/php.socket-3 for /index.php?, closing connection 2014-01-20 18:37:34: (modfastcgi.c.2568) unexpected end-of-file (perhaps the fastcgi process died): pid: 4688 socket: unix:/tmp/php.socket-3

In /var/log/messages, I see this:

Jan 20 18:08:30 www kernel: [26990552.337792] php5-cgi[5177] general protection ip:6af2ed sp:7fffe8bcf210 error:0 in php5-cgi[400000+816000]

On a test server, running CentOS 6.5 with lighttpd 1.4.32 and PHP 5.3.3, Raygun4WP appears to work, but migrating this WP install is out of the question at the moment.

Any insights? Are there plans to update the Raygun4PHP that is used by Raygun4WP?


John-Daniel Trask

Raygun

Posted on
Jan 21 2014

Hi Brian,

Thanks for reporting this issue and the comprehensive logs. I will begin looking into the cause of this and inform you of the course of action soon. Raygun4PHP shouldn't contain any additional logic that would affect the errors you're seeing, but after completing the investigation we will also update Raygun4WP to the latest Raygun4PHP.

Regards,

Callum Gavin
Mindscape Limited


Brian Prodoehl

Posted on
Jan 21 2014

Thanks so much for the quick reply. On a cloned machine, we tried upgrading PHP to 5.4.24, and that worked out better. Errors from our WordPress were immediately showing up in the dashboard, but then we went to upgrade all our WordPress plugins, and we encountered basically the same problem as what I stated in the original post. Since things went down in the middle of upgrading the plugins, WordPress was left in a terrible state, and we had to disable all the plugins via the database just to get back into the admin panel. After disabling all the plugins, and then updating them, and then re-enabling them, and finally re-enabling Raygun4WP, it looks like we have something working.

I'd be interested to know what you see with Raygun4WP on Debian 6.


John-Daniel Trask

Raygun

Posted on
Jan 24 2014

Sorry for the delay on this reply, had a bit of a backlog this week and it's taken some time to get the environment set up. I'm still looking at this problem in detail but have a candidate fix in the meantime that you might be able to try, which hopefully will stop the segfaults from occurring.

In your WP plugins directory/raygun4wordpress/main.php, if you replace line 98:

$client = new Raygun4php\RaygunClient(getoption('rg4wpapikey'));

with:

$client = new Raygun4php\RaygunClient(getoption('rg4wpapikey'), false);

this will use the alternate streamsocketclient sending method. If you have the chance to edit the plugin I would greatly be interested in the result and if this is successful on Squeeze/PHP 5.3.28. I can also create a Git branch/zip up the fix if you'd also prefer.

In the meantime I will continue to investigate the source of the curl segfaults.

Regards,

Callum Gavin
Mindscape Limited


Brian Prodoehl

Posted on
Jan 24 2014

Great, I'll give that a try tomorrow, and I'll let you know the results. Thanks!


Reply