Search code examples
phpphing

Phing throws "Segmentation Fault" on a Copy Task with stripphpcomments in the filter chain


I'm using Phing to set up a build process for a large PHP project. I thought the stripphpcomments directive would be useful when copying files, so I added it. When I run Phing with this directive included, however, the copy process errors out with a "segmentation fault" message. After a lot of testing with exclude/include statements, I narrowed the culprits down to two files in particular -- jquery-1.4.2.min.js and a rather large HTML file.

I solved my problem by splitting my one fileset into two filesets: PHP class files and everything else, and applying the filterchain with stripphpcomments only to the first set, but I'm curious to know if anyone has run into this problem before, and what the condition is that causes the segmentation fault to be thrown. The only thing I can possibly imagine the two files above have in common is that they're both really long.


Solution

  • A "segmentation fault" is a crash of PHP itself. Upgrade to the latest php version (5.3.6 at the moment) and try it with that. If you still get the fault, look at #php.pecl on the EFnet IRC servers for instructions how to file a good PHP bug report.