Live data from Hacker News

Don't Leave Coredumps on Web Servers

blog.hboeck.de

31–34 of 34 posts

Re: Don't Leave Coredumps on Web Servers

#31
post #16
post #10

"PHP used to crash relatively often." ? In 15 years of hosting hundreds of PHP site, I've never seen a single coredump. Is it just me ?

It's easy to make PHP segfault. All you have to do is create an infinite recursion.

Unless you use xdebug.max_nesting_level

Re: Don't Leave Coredumps on Web Servers

#32
post #10

"PHP used to crash relatively often." ? In 15 years of hosting hundreds of PHP site, I've never seen a single coredump. Is it just me ?

No OS I've used in the last ~10 years left a core dump by default. Maybe longer, but I didn't know what core dumps were then, so I wouldn't know what I was looking at if they did.

Almost all Unixes generate coredumps by default. illumos, FreeBSD, and yes GNU/Linux. The reason why you might not have seen coredumps in a cores/ directory is because most GNU/Linux distributions have configured the kernel such that all new coredumps are sent to a processing script (systemd has a coredump script) which results in a coredump file not included in the current directory.

Re: Don't Leave Coredumps on Web Servers

#33
By phrasing it as applicable to "web servers" in general, this article entails an implicit assumption that all HTTP servers "expose secret information" in core dumps. This is not the case. There still exist WWW sites where the HTTP server's code is entirely open, the content being published is entirely open, and no password or other user credentials mechanism is used by the HTTP server.

Not all WWW sites in the world are complex constructions of server-side scripting languages, plug-ins, cookies, user account authentication, and "business logic". Some serve up static content with code that has been around for decades and in the public domain for at least one decade. A core dump does not expose secret information on such sites, because there is no secret information to expose.

It's just untidy. (-:

Of course, it is a lot harder to cause these HTTP servers to dump core in the first place. The article's note about PHP being a source of core dumps again has the implicit assumption that PHP is involved in all WWW servers in the first place. It is not. Moreover, good practice for at least one such of these HTTP servers is to run them under the aegis of an unprivileged and dedicated to the purpose user account that has no owner nor write access to any filesystem object anywhere under its changed root. Thus they cannot create a core dump file irrespective of core dump size resource limits.

Post reply on HN