dukesoferl / re2

Erlang NIF bindings for RE2 regex library
BSD 3-Clause "New" or "Revised" License
74 stars 28 forks source link

Ubuntu 16.04 LTS gcc 5.4.0 ICE #23

Closed shanbhardwaj closed 7 years ago

shanbhardwaj commented 7 years ago

I am trying to compile from head and running into the following issue

gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) Erlang/OTP version: (19.3.6)

==> re2 (compile)
Fetching origin
HEAD is now at b2c9765... Uses straightforward SO install name on Darwin.
make[1]: Entering directory '/home/deploy/MongooseIM/_build/default/lib/re2/c_src/re2'
c++ -m64 -c -o obj/re2/filtered_re2.o  -std=c++11 -pthread -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -I.   -Wall -O3 -fPIC -pthread -std=c++11 -m64 -DNDEBUG re2/filtered_re2.cc
c++ -m64 -c -o obj/re2/compile.o  -std=c++11 -pthread -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -I.   -Wall -O3 -fPIC -pthread -std=c++11 -m64 -DNDEBUG re2/compile.cc
c++ -m64 -c -o obj/re2/mimics_pcre.o  -std=c++11 -pthread -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -I.   -Wall -O3 -fPIC -pthread -std=c++11 -m64 -DNDEBUG re2/mimics_pcre.cc
c++ -m64 -c -o obj/re2/nfa.o  -std=c++11 -pthread -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -I.   -Wall -O3 -fPIC -pthread -std=c++11 -m64 -DNDEBUG re2/nfa.cc
c++ -m64 -c -o obj/re2/onepass.o  -std=c++11 -pthread -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -I.   -Wall -O3 -fPIC -pthread -std=c++11 -m64 -DNDEBUG re2/onepass.cc
c++ -m64 -c -o obj/re2/parse.o  -std=c++11 -pthread -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -I.   -Wall -O3 -fPIC -pthread -std=c++11 -m64 -DNDEBUG re2/parse.cc
c++ -m64 -c -o obj/re2/perl_groups.o  -std=c++11 -pthread -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -I.   -Wall -O3 -fPIC -pthread -std=c++11 -m64 -DNDEBUG re2/perl_groups.cc
c++ -m64 -c -o obj/re2/prefilter.o  -std=c++11 -pthread -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -I.   -Wall -O3 -fPIC -pthread -std=c++11 -m64 -DNDEBUG re2/prefilter.cc
c++ -m64 -c -o obj/re2/prefilter_tree.o  -std=c++11 -pthread -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -I.   -Wall -O3 -fPIC -pthread -std=c++11 -m64 -DNDEBUG re2/prefilter_tree.cc
c++ -m64 -c -o obj/re2/prog.o  -std=c++11 -pthread -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -I.   -Wall -O3 -fPIC -pthread -std=c++11 -m64 -DNDEBUG re2/prog.cc
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
Makefile:178: recipe for target 'obj/re2/prefilter_tree.o' failed
make[1]: *** [obj/re2/prefilter_tree.o] Error 4
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/deploy/MongooseIM/_build/default/lib/re2/c_src/re2'
ERROR: Command [compile] failed!
Makefile:7: recipe for target 'all' failed
make: *** [all] Error 1

I have also built https://github.com/google/re2 separately from HEAD and installed it on the box but still running into the same issue. Here are the results of test install for re2

 make testinstall
(cd obj && g++ testinstall.cc -o testinstall -std=c++11 -pthread -I/usr/local/include -O3 -g -pthread -L/usr/local/lib -l:libre2.a  )
obj/testinstall
PASS
(cd obj && g++ testinstall.cc -o testinstall -std=c++11 -pthread -I/usr/local/include -O3 -g -pthread -L/usr/local/lib -lre2  )
LD_LIBRARY_PATH=/usr/local/lib obj/testinstall
PASS

Install tests passed.
ghost commented 7 years ago

Thanks for the report. I haven't seen this with gcc 4.8, gcc 6.3, gcc 7.1, or clang 4.0.

@junyer, should we track the ICE here or in google/re2#148?

It's unfortunate, but we have to deal with this until Ubuntu fixes their gcc package. Since Ubuntu 16.04 is an LTS release, perhaps RE2 should, if possible, identify and work around the gcc regression as done in another case (google/re2#102). In fact, I would suspect this to pop up when Ubuntu 16.04 packages an affected libre2 release or when Chrome debs do the same. Maybe the Chrome team or Ubuntu already incorporated a patch.

Short-term fixes or workarounds:

Either way, do you mind reporting the ICE at Ubuntu or gcc.gnu.org?

shanbhardwaj commented 7 years ago

@tuncer I just moved on and compiled with gcc-7. Thanks for the writeup and the help. You can close the issue if you'd like.

ghost commented 7 years ago

@shanbhardwaj, can you please test with the v1.7.7 release with your original environment? The only change is that RE2_REV defaults to 2017-07-01.

ghost commented 7 years ago

@junyer, thinking about it, we should be able to utilize Travis-CI or GitLab-CI to build and test with different gcc versions or even different Linux distro chroots/containers. This seems like a low effort task to ensure that no RE2 commit fails on stable and/or LTS Linux distros, and can be relied upon prior to merging things, or at least to report the state of master. Filed as https://github.com/google/re2/issues/149.

junyer commented 7 years ago

Acknowledged.

ghost commented 7 years ago

Now that google/re2#149 has been resolved (thanks @junyer!), we can close this ticket.

However, I tried reproducing the ICE on Ubuntu 16.04.4 with 2017-01-01, 2017-05-01, 2017-06-01, and it never ICE'd for me. The issue is resolved, but I'm still curious what I did wrong or why the ICE didn't surface here. Any ideas?

junyer commented 7 years ago

I'm willing to chalk this up to a glitch in the matrix. We've done our due diligence, I believe, so unless the ICE resurfaces (via build breakage or another report) or @shanbhardwaj wants to dig into it, let's just close this issue.

ghost commented 7 years ago

Agreed.