During a cache clear, .info files are parsed by drupal_parse_info_format using preg_match_all. The expression used triggers a bug that exists in PHP5.3.13 (PCRE version 8.12), at least under Windows. The same .info files work fine on Windows using PHP5.2.11 (PCRE version 7.8). It works fine on Ubuntu with PHP 5.3.2 (PCRE 7.8). The PHP/PCRE versions are documented here.
To reproduce the problem, download the AddToAny module and flush the cache. Apache (2.2.22) will reset. AddToAny is by no means the only module which triggers this bug.
You can reproduce it directly using devel's Execute PHP block:
<?php
print_r(drupal_parse_info_format('sites/all/modules/addtoany/addtoany.info')); // or ...info_file for Drupal 6
?>
It is difficult to tell exactly what is causing the bug, except that I believe it is related to the positive look-back assertions in the regular expression:
<?php
if (preg_match_all('
@^\s* # Start at the beginning of a line, ignoring leading whitespace
((?:
[^=;\[\]]| # Key names cannot contain equal signs, semi-colons or square brackets,
\[[^\[\]]*\] # unless they are balanced and not nested
)+?)
\s*=\s* # Key/value pairs are separated by equal signs (ignoring white-space)
(?:
("(?:[^"]|(?<=\\\\)")*")| # Double-quoted string, which may contain slash-escaped quotes/slashes
(\'(?:[^\']|(?<=\\\\)\')*\')| # Single-quoted string, which may contain slash-escaped quotes/slashes
([^\r\n]*?) # Non-quoted string
)\s*$ # Stop at the next end of a line, ignoring trailing whitespace
@msx', $data, $matches, PREG_SET_ORDER)) {
?>
The offending line from addtoany.info (all fits on one line):
description = "Helps readers share, bookmark, and email your articles and pages using any service, such as Facebook, Twitter, Google+, StumbleUpon, and over 100 more using the <a href='http://share.lockerz.com/' target='_blank'>Lockerz Share / AddToAny</a> widget."
Shortening the line makes it work, as does removing the quotes. This may be related to #618400: Cannot install google_auth, getting a "connection was reset" error in the Google Analytic module, where a multi-line description caused a crash, which was fixed by adjusting the .info file, rather than addressing the underlying problem.
Clearly the regular expression *should* work, but it it doesn't work with the recent PCRE version, then I would argue that as a practical matter, Drupal is broken.
I think the easiest way to fix this is simply to remove the two look-back assertions:
|(?<=\\\\)"
|(?<=\\\\)\'
The only difference is in how an improperly-formatted .info file would be processed. Currently something like the following would be processed as a non-quoted string ("Joe said, "hi there!""). If we remove the look-back assertion, it would be treated as a quoted string (Joe said, "hi there!"). Not clearly worse; probably better.
key = "Joe said, "hi there!""
I am unclear why more people aren't reporting this. Maybe no one is using current releases of PHP5.3. Or maybe it only happens on Windows. But given that Drupal completely crashes (connection reset), and that it is caused by multiple modules, for those unlucky folks with configuration that trigger it, it is a major -- if not critical -- bug.
ADDENDUM:
Report to PCRE: Bug 1338