mongo/cursor.cpp used up all memory when compiling
[ 31%] Building CXX object hphp/runtime/CMakeFiles/hphp_runtime_static.dir/ext_zend_compat/mongo/cursor.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
I allocated 6 GB Memory and 5 GB Swap but the memory is still used up. So I think there might be issues when applying macros. Sorry I am not a c++ developer and I cannot give some valueable information :(
Thanks for reporting this. We neither authored nor support the mongo extension and this is a gcc error so there's not much we can do here. I'd follow up with the author of the mongo extension and/or gcc. If you figure out that it is a bug in HHVM, let us know.
Fix:
diff --git a/hphp/runtime/ext_zend_compat/mongo/cursor.cpp b/hphp/runtime/ext_zend_compat/mongo/cursor.cpp
index 0828f22..604ccf6 100644
--- a/hphp/runtime/ext_zend_compat/mongo/cursor.cpp
+++ b/hphp/runtime/ext_zend_compat/mongo/cursor.cpp
@@ -14,8 +14,6 @@
* limitations under the License.
*/
-#pragma GCC optimize "no-strict-aliasing"
-#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#include <php.h>
#include <zend_interfaces.h>
This looks like it might be something we did after import after all looking at the source. I'll check with @ptarjan.
Also, what version of gcc is this? Have you tried with the latest 4.7.x and/or 4.8.x releases?
I tried 4.7.3 and 4.8.2 and both had this problem.
Yeah, I had to massage some things with this import. You can probably apply the patch (we have good test coverage of mongo).
@Pomyk, if you want to open a PR (and it passes the tests) I'll pull it.