owasp-modsecurity / ModSecurity

ModSecurity is an open source, cross platform web application firewall (WAF) engine for Apache, IIS and Nginx. It has a robust event-based programming language which provides protection from a range of attacks against web applications and allows for HTTP traffic monitoring, logging and real-time analysis.
https://www.modsecurity.org
Apache License 2.0
8.14k stars 1.59k forks source link

internal compiler error Makefile:1803: recipe for target 'parser/libmodsecurity_la-seclang-parser.lo' failed #1693

Closed bill-thedbaguy closed 6 years ago

bill-thedbaguy commented 6 years ago

I am trying to compile ModSecurity V3 on Debian 9 with NGINX 1.13.9. I am following the steps in this article: https://www.nginx.com/blog/compiling-and-installing-modsecurity-for-open-source-nginx/ it fails on the make command. here is the dump from running the command sudo make: Making all in others make[1]: Entering directory '/etc/ModSecurity/others' depbase=echo libinjection/src/libinjection_html5.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||';\ /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../src -g -O2 -MT libinjection/src/libinjection_html5.lo -MD -MP -MF $depbase.Tpo -c -o libinjection/src/libinjection_html5.lo libinjection/src/libinjection_html5.c &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../src -g -O2 -MT libinjection/src/libinjection_html5.lo -MD -MP -MF libinjection/src/.deps/libinjection_html5.Tpo -c libinjection/src/libinjection_html5.c -fPIC -DPIC -o libinjection/src/.libs/libinjection_html5.o libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../src -g -O2 -MT libinjection/src/libinjection_html5.lo -MD -MP -MF libinjection/src/.deps/libinjection_html5.Tpo -c libinjection/src/libinjection_html5.c -o libinjection/src/libinjection_html5.o >/dev/null 2>&1 depbase=echo libinjection/src/libinjection_sqli.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||';\ /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../src -g -O2 -MT libinjection/src/libinjection_sqli.lo -MD -MP -MF $depbase.Tpo -c -o libinjection/src/libinjection_sqli.lo libinjection/src/libinjection_sqli.c &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../src -g -O2 -MT libinjection/src/libinjection_sqli.lo -MD -MP -MF libinjection/src/.deps/libinjection_sqli.Tpo -c libinjection/src/libinjection_sqli.c -fPIC -DPIC -o libinjection/src/.libs/libinjection_sqli.o libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../src -g -O2 -MT libinjection/src/libinjection_sqli.lo -MD -MP -MF libinjection/src/.deps/libinjection_sqli.Tpo -c libinjection/src/libinjection_sqli.c -o libinjection/src/libinjection_sqli.o >/dev/null 2>&1 depbase=echo libinjection/src/libinjection_xss.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||';\ /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../src -g -O2 -MT libinjection/src/libinjection_xss.lo -MD -MP -MF $depbase.Tpo -c -o libinjection/src/libinjection_xss.lo libinjection/src/libinjection_xss.c &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../src -g -O2 -MT libinjection/src/libinjection_xss.lo -MD -MP -MF libinjection/src/.deps/libinjection_xss.Tpo -c libinjection/src/libinjection_xss.c -fPIC -DPIC -o libinjection/src/.libs/libinjection_xss.o libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../src -g -O2 -MT libinjection/src/libinjection_xss.lo -MD -MP -MF libinjection/src/.deps/libinjection_xss.Tpo -c libinjection/src/libinjection_xss.c -o libinjection/src/libinjection_xss.o >/dev/null 2>&1 /bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -lpcre -o libinjection.la libinjection/src/libinjection_html5.lo libinjection/src/libinjection_sqli.lo libinjection/src/libinjection_xss.lo
libtool: link: ar cru .libs/libinjection.a libinjection/src/.libs/libinjection_html5.o libinjection/src/.libs/libinjection_sqli.o libinjection/src/.libs/libinjection_xss.o ar: u' modifier ignored sinceD' is the default (see U') libtool: link: ranlib .libs/libinjection.a libtool: link: ( cd ".libs" && rm -f "libinjection.la" && ln -s "../libinjection.la" "libinjection.la" ) /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../src -D MBEDTLS_CONFIG_FILE=\"mbed-tls-config.h\" -Iothers -g -O2 -MT mbedtls/libmbedtls_la-base64.lo -MD -MP -MF mbedtls/.deps/libmbedtls_la-base64.Tpo -c -o mbedtls/libmbedtls_la-base64.lotest -f 'mbedtls/base64.c' || echo './'mbedtls/base64.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../src -D MBEDTLS_CONFIG_FILE=\"mbed-tls-config.h\" -Iothers -g -O2 -MT mbedtls/libmbedtls_la-base64.lo -MD -MP -MF mbedtls/.deps/libmbedtls_la-base64.Tpo -c mbedtls/base64.c -fPIC -DPIC -o mbedtls/.libs/libmbedtls_la-base64.o libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../src -D MBEDTLS_CONFIG_FILE=\"mbed-tls-config.h\" -Iothers -g -O2 -MT mbedtls/libmbedtls_la-base64.lo -MD -MP -MF mbedtls/.deps/libmbedtls_la-base64.Tpo -c mbedtls/base64.c -o mbedtls/libmbedtls_la-base64.o >/dev/null 2>&1 mv -f mbedtls/.deps/libmbedtls_la-base64.Tpo mbedtls/.deps/libmbedtls_la-base64.Plo /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../src -D MBEDTLS_CONFIG_FILE=\"mbed-tls-config.h\" -Iothers -g -O2 -MT mbedtls/libmbedtls_la-md5.lo -MD -MP -MF mbedtls/.deps/libmbedtls_la-md5.Tpo -c -o mbedtls/libmbedtls_la-md5.lotest -f 'mbedtls/md5.c' || echo './'mbedtls/md5.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../src -D MBEDTLS_CONFIG_FILE=\"mbed-tls-config.h\" -Iothers -g -O2 -MT mbedtls/libmbedtls_la-md5.lo -MD -MP -MF mbedtls/.deps/libmbedtls_la-md5.Tpo -c mbedtls/md5.c -fPIC -DPIC -o mbedtls/.libs/libmbedtls_la-md5.o libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../src -D MBEDTLS_CONFIG_FILE=\"mbed-tls-config.h\" -Iothers -g -O2 -MT mbedtls/libmbedtls_la-md5.lo -MD -MP -MF mbedtls/.deps/libmbedtls_la-md5.Tpo -c mbedtls/md5.c -o mbedtls/libmbedtls_la-md5.o >/dev/null 2>&1 mv -f mbedtls/.deps/libmbedtls_la-md5.Tpo mbedtls/.deps/libmbedtls_la-md5.Plo /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../src -D MBEDTLS_CONFIG_FILE=\"mbed-tls-config.h\" -Iothers -g -O2 -MT mbedtls/libmbedtls_la-sha1.lo -MD -MP -MF mbedtls/.deps/libmbedtls_la-sha1.Tpo -c -o mbedtls/libmbedtls_la-sha1.lotest -f 'mbedtls/sha1.c' || echo './'mbedtls/sha1.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../src -D MBEDTLS_CONFIG_FILE=\"mbed-tls-config.h\" -Iothers -g -O2 -MT mbedtls/libmbedtls_la-sha1.lo -MD -MP -MF mbedtls/.deps/libmbedtls_la-sha1.Tpo -c mbedtls/sha1.c -fPIC -DPIC -o mbedtls/.libs/libmbedtls_la-sha1.o libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../src -D MBEDTLS_CONFIG_FILE=\"mbed-tls-config.h\" -Iothers -g -O2 -MT mbedtls/libmbedtls_la-sha1.lo -MD -MP -MF mbedtls/.deps/libmbedtls_la-sha1.Tpo -c mbedtls/sha1.c -o mbedtls/libmbedtls_la-sha1.o >/dev/null 2>&1 mv -f mbedtls/.deps/libmbedtls_la-sha1.Tpo mbedtls/.deps/libmbedtls_la-sha1.Plo /bin/bash ../libtool --tag=CC --mode=link gcc -D MBEDTLS_CONFIG_FILE=\"mbed-tls-config.h\" -Iothers -g -O2 -lpcre -o libmbedtls.la mbedtls/libmbedtls_la-base64.lo mbedtls/libmbedtls_la-md5.lo mbedtls/libmbedtls_la-sha1.lo libtool: link: ar cru .libs/libmbedtls.a mbedtls/.libs/libmbedtls_la-base64.o mbedtls/.libs/libmbedtls_la-md5.o mbedtls/.libs/libmbedtls_la-sha1.o ar:u' modifier ignored since D' is the default (seeU') libtool: link: ranlib .libs/libmbedtls.a libtool: link: ( cd ".libs" && rm -f "libmbedtls.la" && ln -s "../libmbedtls.la" "libmbedtls.la" ) make[1]: Leaving directory '/etc/ModSecurity/others' Making all in src make[1]: Entering directory '/etc/ModSecurity/src' (CDPATH="${ZSH_VERSION+.}:" && cd .. && /bin/bash /etc/ModSecurity/missing autoheader) fatal: No names found, cannot describe anything. fatal: No names found, cannot describe anything. rm -f stamp-h1 touch config.h.in cd .. && /bin/bash ./config.status src/config.h config.status: creating src/config.h config.status: src/config.h is unchanged make all-recursive make[2]: Entering directory '/etc/ModSecurity/src' make[3]: Entering directory '/etc/ModSecurity/src' /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_GEOIP -I/usr/include/ -DWITH_YAJL -I/usr/include/yajl -DPCRE_HAVE_JIT -I/usr/include/libxml2 -DWITH_LIBXML2 -g -O2 -MT parser/libmodsecurity_la-seclang-parser.lo -MD -MP -MF parser/.deps/libmodsecurity_la-seclang-parser.Tpo -c -o parser/libmodsecurity_la-seclang-parser.lo test -f 'parser/seclang-parser.cc' || echo './'parser/seclang-parser.cc libtool: compile: g++ -DHAVE_CONFIG_H -I. -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_GEOIP -I/usr/include/ -DWITH_YAJL -I/usr/include/yajl -DPCRE_HAVE_JIT -I/usr/include/libxml2 -DWITH_LIBXML2 -g -O2 -MT parser/libmodsecurity_la-seclang-parser.lo -MD -MP -MF parser/.deps/libmodsecurity_la-seclang-parser.Tpo -c parser/seclang-parser.cc -fPIC -DPIC -o parser/.libs/libmodsecurity_la-seclang-parser.o g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See file:///usr/share/doc/gcc-6/README.Bugs for instructions. Makefile:1803: recipe for target 'parser/libmodsecurity_la-seclang-parser.lo' failed make[3]: [parser/libmodsecurity_la-seclang-parser.lo] Error 1 make[3]: Leaving directory '/etc/ModSecurity/src' Makefile:3126: recipe for target 'all-recursive' failed make[2]: [all-recursive] Error 1 make[2]: Leaving directory '/etc/ModSecurity/src' Makefile:989: recipe for target 'all' failed make[1]: [all] Error 2 make[1]: Leaving directory '/etc/ModSecurity/src' Makefile:954: recipe for target 'all-recursive' failed make: [all-recursive] Error 1

What can I do to get past this?

zimmerle commented 6 years ago

Hi @bill-goadvntr,

It seems like you dont have enogth memory in your virtual machine, to proceed with the compilation. Can you double check that?

bill-thedbaguy commented 6 years ago

A little over a week ago I built on a similar vm (these are in the google cloud on f1 micro vm's) and it built just fine.

On Mon, Mar 5, 2018 at 2:42 PM, Felipe Zimmerle notifications@github.com wrote:

Hi @bill-goadvntr https://github.com/bill-goadvntr,

It seems like you dont have enogth memory in your virtual machine, to proceed with the compilation. Can you double check that?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SpiderLabs/ModSecurity/issues/1693#issuecomment-370557880, or mute the thread https://github.com/notifications/unsubscribe-auth/ATPU5jdEQCygTFADlfK66Fl0I8-IZ5wFks5tbaNHgaJpZM4Sbg38 .

-- Bill Soranno Development Lead/DBA Bill@GoAdvntr.com

zimmerle commented 6 years ago

I am not sure why. My educated guess was based on the fact that the compilation broken during a memory exhaustive process. Perhaps you may want to enable a swap file and give it another shot.

https://geekbacon.com/2015/03/04/how-to-create-a-swap-file-on-google-compute-engine-virtual-machines/

bill-thedbaguy commented 6 years ago

Thanks for the link.

On Mon, Mar 5, 2018 at 3:40 PM, Felipe Zimmerle notifications@github.com wrote:

I am not sure why. My educated guess was based on the fact that the compilation broken during a memory exhaustive process. Perhaps you may want to enable a swap file and give it another shot.

https://geekbacon.com/2015/03/04/how-to-create-a-swap-file- on-google-compute-engine-virtual-machines/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SpiderLabs/ModSecurity/issues/1693#issuecomment-370575763, or mute the thread https://github.com/notifications/unsubscribe-auth/ATPU5ma158YT4sU2DUsK_NoppeGLYrT6ks5tbbCxgaJpZM4Sbg38 .

-- Bill Soranno Development Lead/DBA Bill@GoAdvntr.com