Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

0.8.0 compilation fails in CentOS 6.2 #3544

Closed
fgalan opened this issue Jun 26, 2012 · 16 comments
Closed

0.8.0 compilation fails in CentOS 6.2 #3544

fgalan opened this issue Jun 26, 2012 · 16 comments
Labels

Comments

@fgalan
Copy link

fgalan commented Jun 26, 2012

Hi,

I've tryed to compile Node 0.8.0 in CentOS 6.2, but I get the following error in the 'make' step:

[root@centollo node-v0.8.0]# make
make -C out BUILDTYPE=Release
make[1]: se ingresa al directorio `/usr/local/src/node-v0.8.0/out'
  ACTION v8_snapshot_run_mksnapshot /usr/local/src/node-v0.8.0/out/Release/obj.target/v8_snapshot/geni/snapshot.cc
pure virtual method called
terminate called without an active exception
/bin/sh: línea 1:  4076 Abortado                (`core' generado) "/usr/local/src/node-v0.8.0/out/Release/mksnapshot" --log-snapshot-positions --logfile "/usr/local/src/node-v0.8.0/out/Release/obj.target/v8_snapshot/geni/snapshot.log" "/usr/local/src/node-v0.8.0/out/Release/obj.target/v8_snapshot/geni/snapshot.cc"
make[1]: *** [/usr/local/src/node-v0.8.0/out/Release/obj.target/v8_snapshot/geni/snapshot.cc] Error 134
make[1]: se sale del directorio `/usr/local/src/node-v0.8.0/out'
make: *** [node] Error 2

I'm using ./configure without any option. This is the otuput of ./configure:

[root@centollo node-v0.8.0]# ./configure 
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'host_arch': 'x64',
                 'node_install_npm': 'true',
                 'node_install_waf': 'true',
                 'node_prefix': '',
                 'node_shared_openssl': 'false',
                 'node_shared_v8': 'false',
                 'node_shared_zlib': 'false',
                 'node_use_dtrace': 'false',
                 'node_use_etw': 'false',
                 'node_use_openssl': 'true',
                 'strict_aliasing': 'false',
                 'target_arch': 'x64',
                 'v8_use_snapshot': 'true',
                 'visibility': ''}}

This problem seems to be similar to #3538, but, given that CentOS version is different, I've filled a different bug report.

Any help to solve it is really welcome!

Thanks!

Best regards,


Fermín

@bnoordhuis
Copy link
Member

With what version of g++ (g++ -v) are you compiling it? I'll bet it's 4.5.x.

If you're compiling from the tarball, set v8_no_strict_aliasing% to 1 in deps/v8/build/common.gypi.

This bug has been fixed (well, worked around - it's a compiler bug) in the v0.8 and master git branches.

@lpinca
Copy link
Member

lpinca commented Jun 26, 2012

Had same issue on fedora 14.
above solution worked for me.
Thank you bnoordhuis.

@fgalan
Copy link
Author

fgalan commented Jun 26, 2012

Hi,

The g++ version that comes with CentOS 6.2 is 4.4.6:

[root@centollo node-v0.8.0]# g++ -v
Usando especificaciones internas.
Objetivo: x86_64-redhat-linux
Configurado con: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Modelo de hilos: posix
gcc versión 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC) 

Anyway, I have tested the setting v8_no_strict_aliasing% as you said and it doesn't work for me... Any other hint, please?

Thanks!

Best regards,


Fermín

@bnoordhuis
Copy link
Member

@fgalan What does the backtrace in gdb look like?

@fgalan
Copy link
Author

fgalan commented Jun 26, 2012

@bnoordhuis Not sure what you mean... I'm getting the error at compilation time, so I don't understand how a runtime debugger (as gdb is) could help in this case. Maybe I'm missing something :)

@bnoordhuis
Copy link
Member

@fgalan You get it when V8 is trying to build a VM snapshot. You can debug that but try this:

$ ./configure --without-snapshot
$ make -j <cores>
$ echo 'console.log("test")' > test.js
$ gdb --args out/Release/node test.js
> run
# wait for the crash
> backtrace full

@guapigege
Copy link

Had same issue on Centos 6.2 .

The backtrace in gdb

----------------------------------------------------------------------------------------------------------
[Thread debugging using libthread_db enabled]
pure virtual method called
terminate called without an active exception

Program received signal SIGABRT, Aborted.
0x0000003a03432885 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.47.el6_2.12.x86_64 libgcc-4.4.6-3.el6.x86_64 libstdc++-4.4.6-3.el6.x86_64
(gdb) backtrace full
#0  0x0000003a03432885 in raise () from /lib64/libc.so.6
No symbol table info available.
#1  0x0000003a03434065 in abort () from /lib64/libc.so.6
No symbol table info available.
#2  0x0000003a104bea7d in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib64/libstdc++.so.6
No symbol table info available.
#3  0x0000003a104bcc06 in ?? () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#4  0x0000003a104bcc33 in std::terminate() () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#5  0x0000003a104bd55f in __cxa_pure_virtual () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#6  0x0000000000998f37 in v8::internal::CodeStub::FindCodeInCache(v8::internal::Code**) ()
No symbol table info available.
#7  0x0000000000999430 in v8::internal::CodeStub::GetCode() ()
No symbol table info available.
#8  0x0000000000908861 in v8::internal::CodeStub::GenerateStubsAheadOfTime() ()
No symbol table info available.
#9  0x0000000000759e53 in v8::internal::Heap::CreateFixedStubs() ()
No symbol table info available.
#10 0x0000000000764074 in v8::internal::Heap::CreateInitialObjects() ()
---Type <return> to continue, or q <return> to quit---
No symbol table info available.
#11 0x000000000076fee5 in v8::internal::Heap::SetUp(bool) ()
No symbol table info available.
#12 0x00000000007d3b1a in v8::internal::Isolate::Init(v8::internal::Deserializer*) ()
No symbol table info available.
#13 0x000000000058a010 in node::Start(int, char**) ()
No symbol table info available.
#14 0x0000003a0341ecdd in __libc_start_main () from /lib64/libc.so.6
No symbol table info available.
#15 0x000000000058071d in _start ()
No symbol table info available.

@fgalan
Copy link
Author

fgalan commented Jun 26, 2012

@bnoordhuis Thank you for the clarification. I guess that referst to the number of cores in my system (in particular 4 cores). This is the trace you mention (I've also included the output of the run statement, just in case it can be useful):

(gdb) run
Starting program: /usr/local/src/node-v0.8.0/out/Release/node test.js
[Thread debugging using libthread_db enabled]
pure virtual method called
terminate called without an active exception

Program received signal SIGABRT, Aborted.
0x00000037bf432885 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.47.el6_2.12.x86_64 libgcc-4.4.6-3.el6.x86_64 libstdc++-4.4.6-3.el6.x86_64
(gdb) backtrace full
#0  0x00000037bf432885 in raise () from /lib64/libc.so.6
No symbol table info available.
#1  0x00000037bf434065 in abort () from /lib64/libc.so.6
No symbol table info available.
#2  0x00000037cd8bea7d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#3  0x00000037cd8bcc06 in ?? () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#4  0x00000037cd8bcc33 in std::terminate() () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#5  0x00000037cd8bd55f in __cxa_pure_virtual () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#6  0x0000000000998f37 in v8::internal::CodeStub::FindCodeInCache(v8::internal::Code**) ()
No symbol table info available.
#7  0x0000000000999430 in v8::internal::CodeStub::GetCode() ()
No symbol table info available.
#8  0x0000000000908861 in v8::internal::CodeStub::GenerateStubsAheadOfTime() ()
No symbol table info available.
#9  0x0000000000759e53 in v8::internal::Heap::CreateFixedStubs() ()
No symbol table info available.
#10 0x0000000000764074 in v8::internal::Heap::CreateInitialObjects() ()
No symbol table info available.
#11 0x000000000076fee5 in v8::internal::Heap::SetUp(bool) ()
No symbol table info available.
#12 0x00000000007d3b1a in v8::internal::Isolate::Init(v8::internal::Deserializer*) ()
No symbol table info available.
#13 0x000000000058a010 in node::Start(int, char**) ()
No symbol table info available.
#14 0x00000037bf41ecdd in __libc_start_main () from /lib64/libc.so.6
No symbol table info available.
#15 0x000000000058071d in _start ()
No symbol table info available.

Thank you again!

@bnoordhuis
Copy link
Member

Thanks for the backtraces, guys.

I'm not sure why the v8_no_strict_aliasing hack isn't working for you but the stack traces are exactly what you get when -fstrict-aliasing is in effect with the affected versions of gcc.

Can you try either a clean build or the current HEAD of the v0.8 git branch?

@fgalan
Copy link
Author

fgalan commented Jun 26, 2012

@bnoordhuis apparently, the same problem:

git clone git://github.com/joyent/node.git
git checkout -t -b v0.8 remotes/origin/v0.8
./configure
make
(same error trace in previous comments)

I've also tried to change the v8_no_strict_aliasing% this time and the result is the same.

Finally, this is the gbd trace using the ./configure --without-snapshots, etc.:

(gdb) run
Starting program: /tmp/node/out/Release/node test.js
[Thread debugging using libthread_db enabled]
pure virtual method called
terminate called without an active exception

Program received signal SIGABRT, Aborted.
0x00000037bf432885 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.47.el6_2.12.x86_64 libgcc-4.4.6-3.el6.x86_64 libstdc++-4.4.6-3.el6.x86_64
(gdb) backtrace full
#0  0x00000037bf432885 in raise () from /lib64/libc.so.6
No symbol table info available.
#1  0x00000037bf434065 in abort () from /lib64/libc.so.6
No symbol table info available.
#2  0x00000037cd8bea7d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#3  0x00000037cd8bcc06 in ?? () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#4  0x00000037cd8bcc33 in std::terminate() () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#5  0x00000037cd8bd55f in __cxa_pure_virtual () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#6  0x0000000000998fe7 in v8::internal::CodeStub::FindCodeInCache(v8::internal::Code**) ()
No symbol table info available.
#7  0x00000000009994e0 in v8::internal::CodeStub::GetCode() ()
No symbol table info available.
#8  0x0000000000908861 in v8::internal::CodeStub::GenerateStubsAheadOfTime() ()
No symbol table info available.
#9  0x0000000000759e53 in v8::internal::Heap::CreateFixedStubs() ()
No symbol table info available.
#10 0x0000000000764074 in v8::internal::Heap::CreateInitialObjects() ()
No symbol table info available.
#11 0x000000000076fee5 in v8::internal::Heap::SetUp(bool) ()
No symbol table info available.
#12 0x00000000007d3b1a in v8::internal::Isolate::Init(v8::internal::Deserializer*) ()
No symbol table info available.
#13 0x000000000058a010 in node::Start(int, char**) ()
No symbol table info available.
#14 0x00000037bf41ecdd in __libc_start_main () from /lib64/libc.so.6
No symbol table info available.
#15 0x000000000058071d in _start ()
No symbol table info available.

Annex: git double check that I've compiled the right branch:

[fermin@centollo node]$ git branch
  master
* v0.8
[fermin@centollo node]$ git show-branch
! [master] Now working on 0.9.0
 * [v0.8] Added % difference for perf benchmarks in 0.8 post
--
 * [v0.8] Added % difference for perf benchmarks in 0.8 post
 * [v0.8^] configure: don't fail if compiler_version() doesn't work
 * [v0.8~2] doc: `detached` is a boolean
 * [v0.8~3] build: expand ~ in `./configure --prefix=~/a/b/c`
+  [master] Now working on 0.9.0
+  [master^] Fix #3521 Use an object as the process.env proto
+  [master~2] build: enable strict aliasing if gcc < 4.5.0
+* [v0.8~4] build: disable strict aliasing in v8 with gcc 4.5.x

@guapigege could you check if it the same in your system, please?

@bnoordhuis
Copy link
Member

@fgalan Sanity check, does it work when you apply this patch?

diff --git a/common.gypi b/common.gypi
index ca0cf9f..6b3433b 100644
--- a/common.gypi
+++ b/common.gypi
@@ -42,7 +42,7 @@
         },
       },
       'Release': {
-        'cflags': [ '-O3', '-fdata-sections', '-ffunction-sections' ],
+        'cflags': [ '-O3', '-fno-strict-aliasing', '-fdata-sections', '-ffunction-sections' ],
         'conditions': [
           ['target_arch=="x64"', {
             'msvs_configuration_platform': 'x64',

Also, does a debug build work? make -C out BUILDTYPE=Debug builds one, you'll find it in out/Release/node.

@fgalan
Copy link
Author

fgalan commented Jun 27, 2012

@bnoordhuis I have included the -fno-strict-aliasing in the cflags array as shown in the patch and it seems to work now.

[fermin@centollo node]$ out/Release/node --version
v0.8.1-pre

Anyway, this fix seems to work in the git HEAD for v0.8, but not in the .tgz of the 0.8.0 release. What should we do to apply the fix in the 0.8.0 .tgz, please?

@fgalan
Copy link
Author

fgalan commented Jun 27, 2012

Update to my previous report:

Alhtough 'make' works after the common.gypi patch, when I try to install, a problem happens. It seem that although the node binary has been generated, it is unable to run .js files without crashing:

[root@centollo node]# make install
make -C out BUILDTYPE=Release
make[1]: se ingresa al directorio `/tmp/node/out'
make[1]: No se hace nada para `all'.
make[1]: se sale del directorio `/tmp/node/out'
ln -fs out/Release/node node
out/Release/node tools/installer.js install 
pure virtual method called
terminate called without an active exception
make: *** [install] Abortado (core dumped) [Núcleo vaciado a un archivo]

This is the new gdb trace:

[root@centollo node]# gdb --args out/Release/node tools/installer.js install
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-50.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/node/out/Release/node...done.
(gdb) run
Starting program: /tmp/node/out/Release/node tools/installer.js install
[Thread debugging using libthread_db enabled]
pure virtual method called
terminate called without an active exception

Program received signal SIGABRT, Aborted.
0x00000037bf432885 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.47.el6_2.12.x86_64 libgcc-4.4.6-3.el6.x86_64 libstdc++-4.4.6-3.el6.x86_64
(gdb) backtrace full
#0  0x00000037bf432885 in raise () from /lib64/libc.so.6
No symbol table info available.
#1  0x00000037bf434065 in abort () from /lib64/libc.so.6
No symbol table info available.
#2  0x00000037cd8bea7d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#3  0x00000037cd8bcc06 in ?? () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#4  0x00000037cd8bcc33 in std::terminate() () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#5  0x00000037cd8bd55f in __cxa_pure_virtual () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#6  0x0000000000998fe7 in v8::internal::CodeStub::FindCodeInCache(v8::internal::Code**) ()
No symbol table info available.
#7  0x00000000009994e0 in v8::internal::CodeStub::GetCode() ()
No symbol table info available.
#8  0x0000000000908861 in v8::internal::CodeStub::GenerateStubsAheadOfTime() ()
No symbol table info available.
#9  0x0000000000759e53 in v8::internal::Heap::CreateFixedStubs() ()
No symbol table info available.
#10 0x0000000000764074 in v8::internal::Heap::CreateInitialObjects() ()
No symbol table info available.
#11 0x000000000076fee5 in v8::internal::Heap::SetUp(bool) ()
No symbol table info available.
#12 0x00000000007d3b1a in v8::internal::Isolate::Init(v8::internal::Deserializer*) ()
No symbol table info available.
#13 0x000000000058a010 in node::Start(int, char**) ()
No symbol table info available.
#14 0x00000037bf41ecdd in __libc_start_main () from /lib64/libc.so.6
No symbol table info available.
#15 0x000000000058071d in _start ()
No symbol table info available.

It seems the same trace than in previous tests.

Now I will try the BUILDTYPE=Debug option and report the result in a separate comment.

@fgalan
Copy link
Author

fgalan commented Jun 27, 2012

Same problem with debug relasea:

[root@centollo node]# make -C out BUILDTYPE=Debug
[...]
[root@centollo node]# out/Release/node test.js 
pure virtual method called
terminate called without an active exception
Abortado (`core' generado)
[root@centollo node]# gdb --arg out/Release/node test.js 
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-50.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/node/out/Release/node...done.
(gdb) run
Starting program: /tmp/node/out/Release/node test.js
[Thread debugging using libthread_db enabled]
pure virtual method called
terminate called without an active exception

Program received signal SIGABRT, Aborted.
0x00000037bf432885 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.47.el6_2.12.x86_64 libgcc-4.4.6-3.el6.x86_64 libstdc++-4.4.6-3.el6.x86_64
(gdb) backtrace full
#0  0x00000037bf432885 in raise () from /lib64/libc.so.6
No symbol table info available.
#1  0x00000037bf434065 in abort () from /lib64/libc.so.6
No symbol table info available.
#2  0x00000037cd8bea7d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#3  0x00000037cd8bcc06 in ?? () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#4  0x00000037cd8bcc33 in std::terminate() () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#5  0x00000037cd8bd55f in __cxa_pure_virtual () from /usr/lib64/libstdc++.so.6
No symbol table info available.
#6  0x0000000000998fe7 in v8::internal::CodeStub::FindCodeInCache(v8::internal::Code**) ()
No symbol table info available.
#7  0x00000000009994e0 in v8::internal::CodeStub::GetCode() ()
No symbol table info available.
#8  0x0000000000908861 in v8::internal::CodeStub::GenerateStubsAheadOfTime() ()
No symbol table info available.
#9  0x0000000000759e53 in v8::internal::Heap::CreateFixedStubs() ()
No symbol table info available.
#10 0x0000000000764074 in v8::internal::Heap::CreateInitialObjects() ()
No symbol table info available.
#11 0x000000000076fee5 in v8::internal::Heap::SetUp(bool) ()
No symbol table info available.
#12 0x00000000007d3b1a in v8::internal::Isolate::Init(v8::internal::Deserializer*) ()
No symbol table info available.
#13 0x000000000058a010 in node::Start(int, char**) ()
No symbol table info available.
#14 0x00000037bf41ecdd in __libc_start_main () from /lib64/libc.so.6
No symbol table info available.
#15 0x000000000058071d in _start ()
No symbol table info available.

@bnoordhuis
Copy link
Member

Same problem with debug relasea:

I would try and run the actual debug build if I were you. :-)

@bnoordhuis
Copy link
Member

By the way, let's continue in #3538 - it's the same issue.

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

No branches or pull requests

4 participants