hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

mongo/cursor.cpp used up all memory when compiling

Open breezewish opened this issue 12 years ago • 7 comments

[ 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 :(

breezewish avatar Dec 21 '13 12:12 breezewish

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.

scannell avatar Dec 21 '13 15:12 scannell

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>

Pomyk avatar Dec 22 '13 09:12 Pomyk

This looks like it might be something we did after import after all looking at the source. I'll check with @ptarjan.

scannell avatar Dec 23 '13 18:12 scannell

Also, what version of gcc is this? Have you tried with the latest 4.7.x and/or 4.8.x releases?

scannell avatar Dec 23 '13 18:12 scannell

I tried 4.7.3 and 4.8.2 and both had this problem.

Pomyk avatar Dec 23 '13 18:12 Pomyk

Yeah, I had to massage some things with this import. You can probably apply the patch (we have good test coverage of mongo).

ptarjan avatar Dec 23 '13 20:12 ptarjan

@Pomyk, if you want to open a PR (and it passes the tests) I'll pull it.

scannell avatar Dec 23 '13 21:12 scannell