Skip to content

Make compile errors on Raspberry Pi 4 64 Bit version of Ubuntu Server 20.04 #2666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Danrancan opened this issue Jan 1, 2022 · 5 comments
Closed

Comments

@Danrancan
Copy link

Danrancan commented Jan 1, 2022

The make command runs into compile errors on Ubuntu Server 20.04 64bit for Raspberry Pi 3. I am compiling with Nginx Mainline version. I am also using this guide and have followed it to a tee aside from using the official nginx mainline v.1.21.5 instead of ppa:ondrej/nginx-mainline

Logs and dumps
Output of make -j4

Danrancan@Ubuntu-Ras-Dev-Kit:/usr/local/src/ModSecurity$ make -j4
Making all in others
make[1]: Entering directory '/usr/local/src/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
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
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
/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.lo `test -f 'mbedtls/base64.c' || echo './'`mbedtls/base64.c
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_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_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 -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
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
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.lo `test -f 'mbedtls/md5.c' || echo './'`mbedtls/md5.c
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
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
/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.lo `test -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-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
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   -o libmbedtls.la  mbedtls/libmbedtls_la-base64.lo mbedtls/libmbedtls_la-md5.lo mbedtls/libmbedtls_la-sha1.lo
libtool: link: ar cr .libs/libmbedtls.a mbedtls/.libs/libmbedtls_la-base64.o mbedtls/.libs/libmbedtls_la-md5.o mbedtls/.libs/libmbedtls_la-sha1.o
libtool: link: ranlib .libs/libmbedtls.a
libtool: link: ( cd ".libs" && rm -f "libmbedtls.la" && ln -s "../libmbedtls.la" "libmbedtls.la" )
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
/bin/bash ../libtool  --tag=CC   --mode=link gcc  -g -O2   -o libinjection.la  libinjection/src/libinjection_html5.lo libinjection/src/libinjection_sqli.lo libinjection/src/libinjection_xss.lo
libtool: link: ar cr .libs/libinjection.a libinjection/src/.libs/libinjection_html5.o libinjection/src/.libs/libinjection_sqli.o libinjection/src/.libs/libinjection_xss.o
libtool: link: ranlib .libs/libinjection.a
libtool: link: ( cd ".libs" && rm -f "libinjection.la" && ln -s "../libinjection.la" "libinjection.la" )
make[1]: Leaving directory '/usr/local/src/ModSecurity/others'
Making all in src
make[1]: Entering directory '/usr/local/src/ModSecurity/src'
make  all-recursive
make[2]: Entering directory '/usr/local/src/ModSecurity/src'
make[3]: Entering directory '/usr/local/src/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_CURL_SSLVERSION_TLSv1_2 -DWITH_CURL -DWITH_GEOIP -I/usr/include/    -DWITH_YAJL -I/usr/include/yajl  -DPCRE_HAVE_JIT   -DWITH_LUA -DWITH_LUA_5_3 -I/usr/include/lua5.3 -I/usr/include/libxml2 -DWITH_LIBXML2   -g -O2 -MT libmodsecurity_la-transaction.lo -MD -MP -MF .deps/libmodsecurity_la-transaction.Tpo -c -o libmodsecurity_la-transaction.lo `test -f 'transaction.cc' || echo './'`transaction.cc
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.  -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_CURL_SSLVERSION_TLSv1_2 -DWITH_CURL -DWITH_GEOIP -I/usr/include/    -DWITH_YAJL -I/usr/include/yajl  -DPCRE_HAVE_JIT   -DWITH_LUA -DWITH_LUA_5_3 -I/usr/include/lua5.3 -I/usr/include/libxml2 -DWITH_LIBXML2   -g -O2 -MT libmodsecurity_la-anchored_set_variable.lo -MD -MP -MF .deps/libmodsecurity_la-anchored_set_variable.Tpo -c -o libmodsecurity_la-anchored_set_variable.lo `test -f 'anchored_set_variable.cc' || echo './'`anchored_set_variable.cc
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.  -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_CURL_SSLVERSION_TLSv1_2 -DWITH_CURL -DWITH_GEOIP -I/usr/include/    -DWITH_YAJL -I/usr/include/yajl  -DPCRE_HAVE_JIT   -DWITH_LUA -DWITH_LUA_5_3 -I/usr/include/lua5.3 -I/usr/include/libxml2 -DWITH_LIBXML2   -g -O2 -MT libmodsecurity_la-anchored_variable.lo -MD -MP -MF .deps/libmodsecurity_la-anchored_variable.Tpo -c -o libmodsecurity_la-anchored_variable.lo `test -f 'anchored_variable.cc' || echo './'`anchored_variable.cc
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.  -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_CURL_SSLVERSION_TLSv1_2 -DWITH_CURL -DWITH_GEOIP -I/usr/include/    -DWITH_YAJL -I/usr/include/yajl  -DPCRE_HAVE_JIT   -DWITH_LUA -DWITH_LUA_5_3 -I/usr/include/lua5.3 -I/usr/include/libxml2 -DWITH_LIBXML2   -g -O2 -MT libmodsecurity_la-modsecurity.lo -MD -MP -MF .deps/libmodsecurity_la-modsecurity.Tpo -c -o libmodsecurity_la-modsecurity.lo `test -f 'modsecurity.cc' || echo './'`modsecurity.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_CURL_SSLVERSION_TLSv1_2 -DWITH_CURL -DWITH_GEOIP -I/usr/include/ -DWITH_YAJL -I/usr/include/yajl -DPCRE_HAVE_JIT -DWITH_LUA -DWITH_LUA_5_3 -I/usr/include/lua5.3 -I/usr/include/libxml2 -DWITH_LIBXML2 -g -O2 -MT libmodsecurity_la-anchored_set_variable.lo -MD -MP -MF .deps/libmodsecurity_la-anchored_set_variable.Tpo -c anchored_set_variable.cc  -fPIC -DPIC -o .libs/libmodsecurity_la-anchored_set_variable.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_CURL_SSLVERSION_TLSv1_2 -DWITH_CURL -DWITH_GEOIP -I/usr/include/ -DWITH_YAJL -I/usr/include/yajl -DPCRE_HAVE_JIT -DWITH_LUA -DWITH_LUA_5_3 -I/usr/include/lua5.3 -I/usr/include/libxml2 -DWITH_LIBXML2 -g -O2 -MT libmodsecurity_la-transaction.lo -MD -MP -MF .deps/libmodsecurity_la-transaction.Tpo -c transaction.cc  -fPIC -DPIC -o .libs/libmodsecurity_la-transaction.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_CURL_SSLVERSION_TLSv1_2 -DWITH_CURL -DWITH_GEOIP -I/usr/include/ -DWITH_YAJL -I/usr/include/yajl -DPCRE_HAVE_JIT -DWITH_LUA -DWITH_LUA_5_3 -I/usr/include/lua5.3 -I/usr/include/libxml2 -DWITH_LIBXML2 -g -O2 -MT libmodsecurity_la-anchored_variable.lo -MD -MP -MF .deps/libmodsecurity_la-anchored_variable.Tpo -c anchored_variable.cc  -fPIC -DPIC -o .libs/libmodsecurity_la-anchored_variable.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_CURL_SSLVERSION_TLSv1_2 -DWITH_CURL -DWITH_GEOIP -I/usr/include/ -DWITH_YAJL -I/usr/include/yajl -DPCRE_HAVE_JIT -DWITH_LUA -DWITH_LUA_5_3 -I/usr/include/lua5.3 -I/usr/include/libxml2 -DWITH_LIBXML2 -g -O2 -MT libmodsecurity_la-modsecurity.lo -MD -MP -MF .deps/libmodsecurity_la-modsecurity.Tpo -c modsecurity.cc  -fPIC -DPIC -o .libs/libmodsecurity_la-modsecurity.o
g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make[3]: *** [Makefile:2093: libmodsecurity_la-transaction.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_CURL_SSLVERSION_TLSv1_2 -DWITH_CURL -DWITH_GEOIP -I/usr/include/ -DWITH_YAJL -I/usr/include/yajl -DPCRE_HAVE_JIT -DWITH_LUA -DWITH_LUA_5_3 -I/usr/include/lua5.3 -I/usr/include/libxml2 -DWITH_LIBXML2 -g -O2 -MT libmodsecurity_la-anchored_variable.lo -MD -MP -MF .deps/libmodsecurity_la-anchored_variable.Tpo -c anchored_variable.cc -o libmodsecurity_la-anchored_variable.o >/dev/null 2>&1
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_CURL_SSLVERSION_TLSv1_2 -DWITH_CURL -DWITH_GEOIP -I/usr/include/ -DWITH_YAJL -I/usr/include/yajl -DPCRE_HAVE_JIT -DWITH_LUA -DWITH_LUA_5_3 -I/usr/include/lua5.3 -I/usr/include/libxml2 -DWITH_LIBXML2 -g -O2 -MT libmodsecurity_la-modsecurity.lo -MD -MP -MF .deps/libmodsecurity_la-modsecurity.Tpo -c modsecurity.cc -o libmodsecurity_la-modsecurity.o >/dev/null 2>&1
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_CURL_SSLVERSION_TLSv1_2 -DWITH_CURL -DWITH_GEOIP -I/usr/include/ -DWITH_YAJL -I/usr/include/yajl -DPCRE_HAVE_JIT -DWITH_LUA -DWITH_LUA_5_3 -I/usr/include/lua5.3 -I/usr/include/libxml2 -DWITH_LIBXML2 -g -O2 -MT libmodsecurity_la-anchored_set_variable.lo -MD -MP -MF .deps/libmodsecurity_la-anchored_set_variable.Tpo -c anchored_set_variable.cc -o libmodsecurity_la-anchored_set_variable.o >/dev/null 2>&1
mv -f .deps/libmodsecurity_la-anchored_variable.Tpo .deps/libmodsecurity_la-anchored_variable.Plo
mv -f .deps/libmodsecurity_la-modsecurity.Tpo .deps/libmodsecurity_la-modsecurity.Plo
mv -f .deps/libmodsecurity_la-anchored_set_variable.Tpo .deps/libmodsecurity_la-anchored_set_variable.Plo
make[3]: Leaving directory '/usr/local/src/ModSecurity/src'
make[2]: *** [Makefile:3479: all-recursive] Error 1
make[2]: Leaving directory '/usr/local/src/ModSecurity/src'
make[1]: *** [Makefile:1224: all] Error 2
make[1]: Leaving directory '/usr/local/src/ModSecurity/src'
make: *** [Makefile:1035: all-recursive] Error 1

To Reproduce
Follow THIS GUIDE using the nginx Mainline repository on a Raspberry Pi 3. When you reach the instructions to enter make -j4 command in your terminal, the error will appear after a short time of compiling.

Expected behavior

I expect modsecurity to make correctly.

Server:

  • ModSecurity version: v3/master cloned + Connector= NA - Error Happens before using any connector.
  • WebServer: nginx/1.21.5
  • OS (and distro): Ubuntu Server 20.04 64bit for Raspberry Pi 3

Additional context
Please be sure to reproduce this using THIS LINUXBABE TUTORIAL and substituting nginx v1.21.5 in for the tutorial's version.

@martinhsv
Copy link
Contributor

Hello @Danrancan ,

Hmm. I'm not seeing anything terribly enlightening in your compiler output.

I don't know that this is your problem, but given the nginx version that you used (nginx/1.21.5), I might wonder if your issue is related to nginx's change to pcre2. See for example this issue in building the connector: owasp-modsecurity/ModSecurity-nginx#261

@Danrancan
Copy link
Author

Hey @martinhsv, Thank you so much for responding to this issue! I am quite new to development and only understand the very basics of debugging issues on github repos. Correct me if I am wrong, but it looks like I should be using the "--without-pcre2" flag when compiling modsecurity. However, what I don't understand, is if only fixes the compilation error, or if it also fixes the reported and discussed memory allocation problem when compiling agains Nginx v1.21.5? If I am going to have memory allocation problems after compiling this, could you please let me know, so I hold off until things are fixed? Again, I appreciate the response and any help/advice you can give! Thanks a bunch!

Dan

@Danrancan
Copy link
Author

Hello @Danrancan ,

Hmm. I'm not seeing anything terribly enlightening in your compiler output.

I don't know that this is your problem, but given the nginx version that you used (nginx/1.21.5), I might wonder if your issue is related to nginx's change to pcre2. See for example this issue in building the connector: owasp-modsecurity/ModSecurity-nginx#261

Hey @martinhsv,

I believe the issue was indeed related to your posted link issue#261. I tried compiling with the --without-pcre2 argument and low and behold, all went well. It compiled just fine. However, It's going to take some testing to be sure that nothing greater hasn't been affected by this.

@martinhsv
Copy link
Contributor

Was there anything further on this?

@Danrancan
Copy link
Author

Was there anything further on this?

Seems like my modsecurity has been working fine compiling like this. So I think you can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants