I have been using lighttpd with cgi on ubuntu. I have come across a "500 - Internal Server Error" case which I want to debug.
Is there a way I can ask lighttpd/cgi to dump core when my binary crashes?
I came across this page, it has a field for enabling core dump but including server.core-files="enable"
in lighhtpd.conf doesn't seem to work.
Any idea?
Thanks.
P.S. Following is the test program I used for generating core:
int main()
{
char* html = "<html>\n"\
"<header>" \
"<title>This is title</title></header>\n" \
"<body>\n"\
"Hello world\n"\
"</body>\n"\
"</html>";
html[1] = 'r';
std::cout<<html;
return 0;
}
I have set limit to unlimited by doing "ulimit -c unlimited". I can see a core in my current directory when I run binary from command line. But no core in cgi-bin when called from browser. Cgi log has following entries:
2018-07-29 17:20:41: (server.c.1558) server stopped by UID = 0 PID = 1
2018-07-29 17:21:18: (log.c.164) server started
2018-07-29 21:29:16: (mod_cgi.c.601) cgi died, pid: 28197
2018-07-29 21:29:17: (mod_cgi.c.601) cgi died, pid: 28202