LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > PHP > [RESOLVED] Core dumps not generated in PHP 5.3

Reply
 
Thread Tools Display Modes
  #1  
Old 05-12-2010, 12:18 PM
rm31 rm31 is offline
New Member
 
Join Date: May 2010
Posts: 3
Default [RESOLVED] Core dumps not generated in PHP 5.3

Hi,

I've been trying to debug php crashes. The problem is similar to what others have posted here in the past - 503 errors, load goes through the roof, etc. We've tried several different combinations of php, litespeed, and apc. PHP 5.3.1 with APC and LSAPI 5.3 seems to be working best (always tried PHP without APC first to make sure APC didn't introduce more problems).

When we were on 5.2.10, LSAPI_ALLOW_CORE_DUMP worked fine to generate core.xxxx files in the docroot directories. But the newer php versions haven't been generating core files - PHP 5.3 definitely doesn't and I think 5.2.13 didn't either.

Is this a known issue? Are there any workarounds to still get core dumps? The core dump was pretty helpful in determining that most of the crashes were centered around unserializing objects after retrieval from memcache. We modified our __sleep/__wakeup methods to make sure not so much data was serialized and the problem has gone away.

We had crashes in 5.3.2, but since we weren't finding core dump files, I couldn't debug it. Going to 5.3.1 fixed the crashes. Maybe there's a way to specify the directory for litespeed to place the core dumps? I did a unix "find" in case the location moved, but didn't get any results.

Thanks a lot!!
Reply With Quote
  #2  
Old 05-12-2010, 01:44 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
You can run "ulimit -a" from PHP see if you get none-zero "core file size". If it is non-zero, you should check the permission of the directory that core dump file should be created in.
Reply With Quote
  #3  
Old 05-12-2010, 02:08 PM
rm31 rm31 is offline
New Member
 
Join Date: May 2010
Posts: 3
Thanks for the reply. I ran "echo `ulimit -a`" from a php script through litespeed and it looks like core file size is correctly set to unlimited:

core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 8256
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1500
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 400
virtual memory (kbytes, -v) 524288
file locks (-x) unlimited

All of my docroot directories have write permissions for litespeed which is the user for lsphp5. Maybe the core dump file is trying to get created somewhere else? Again, this was working before in php 5.2.
Reply With Quote
  #4  
Old 05-12-2010, 04:28 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
check
http://linux.die.net/man/5/core

also check lsws/fcgi-bin/ directory for core files.
Reply With Quote
  #5  
Old 05-13-2010, 09:05 AM
rm31 rm31 is offline
New Member
 
Join Date: May 2010
Posts: 3
Thanks a lot for your help! I found that lsws/fcgi-bin was only writable to root. Opening it to litespeed did the trick. So it seems that the core dump location moved at some point from the php script dir to the lsphp5 dir.

And from the core dumps, it seems that they're occuring during shutdown and some other points when linking libraries - no php user functions in the backtrace. I'm on 64-bit CentOS 5. I noticed that at some point I must have lost "--with-libdir=lib64" from my php configure, so I pretty sure that's the problem. Thanks again.
Reply With Quote
  #6  
Old 05-13-2010, 01:28 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
If it crashes in middle of a request, the core file will be in the directory that the script located, if it crash after a request complete, the core file will be under fcgi-bin/ directory.
Reply With Quote
Reply

Tags
5.3, apc, core dump, crash, php

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:44 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.