Skip to content
This repository has been archived by the owner. It is now read-only.

Fix issues building node 0.6.15 on OS X 10.5 #3114

Closed
jdduncan opened this issue Apr 15, 2012 · 5 comments

Comments

@jdduncan
Copy link

@jdduncan jdduncan commented Apr 15, 2012

There are three basic problems building node on Mac OS X 10.5 (Leopard)

1: the system standard openssl is too old
2: we need to define _DARWIN_C_SOURCE to enable Unix 2003 behavior, specifically so that unsetenv() conforms to the standard.
3: platform_darwin.cc and platform_darwin_proctitle.cc need to be split into two compilation units, because they require some headers that are incompatible. In particular, platform_darwin uses BSD networking <arpa/inet.h> while platform_darwin_proctitle uses the CoreFoundation framework.

Issue 1 can be addressed by the end user simply by installing a newer openssl somewhere. I will submit a pull request with fixes for issues 2 and 3.

@TooTallNate

This comment has been minimized.

Copy link

@TooTallNate TooTallNate commented Apr 15, 2012

You're talking about the v0.6 branch, correct? I believe we fixed master just recently for Leopard (but that could no longer be the case due to some patches that had to be reverted).

@jdduncan

This comment has been minimized.

Copy link
Author

@jdduncan jdduncan commented Apr 15, 2012

Yes, talking about v0.6. That fix is submitted in #3115.

I also have a problem with master. It seems that "mksnapshot" is run as part of the build process, but it segfaults. (Just let me know if this should go in a separate issue)..

sam:node-7 jdd$ make 
make -C out BUILDTYPE=Release
  ACTION v8_snapshot_run_mksnapshot /Users/jdd/git-repo/github/node-7/out/Release/obj.target/v8_snapshot/geni/snapshot.cc
/bin/sh: line 1: 21809 Bus error               "/Users/jdd/git-repo/github/node-7/out/Release/mksnapshot" --log-snapshot-positions --logfile "/Users/jdd/git-repo/github/node-7/out/Release/obj.target/v8_snapshot/geni/snapshot.log" "/Users/jdd/git-repo/github/node-7/out/Release/obj.target/v8_snapshot/geni/snapshot.cc"
make[1]: *** [/Users/jdd/git-repo/github/node-7/out/Release/obj.target/v8_snapshot/geni/snapshot.cc] Error 138
make: *** [node] Error 2
sam:node-7 jdd$ gdb out/Release/mksnapshot 
GNU gdb 6.3.50-20050815 (Apple version gdb-967) (Tue Jul 14 02:11:58 UTC 2009)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin"...Reading symbols for shared libraries .... done

(gdb) set args --log-snapshot-positions --logfile "/Users/jdd/git-repo/github/node-7/out/Release/obj.target/v8_snapshot/geni/snapshot.log" "/Users/jdd/git-repo/github/node-7/out/Release/obj.target/v8_snapshot/geni/snapshot.cc"
(gdb) run
Starting program: /Users/jdd/git-repo/github/node-7/out/Release/mksnapshot --log-snapshot-positions --logfile "/Users/jdd/git-repo/github/node-7/out/Release/obj.target/v8_snapshot/geni/snapshot.log" "/Users/jdd/git-repo/github/node-7/out/Release/obj.target/v8_snapshot/geni/snapshot.cc"
Reading symbols for shared libraries +++. done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000001
0x000be576 in MemsetPointer<v8::internal::Object, v8::internal::Object> [inlined] () at v8utils.h:4556
4556      MemsetPointer(array->data_start(), filler, length);
(gdb) bt
#0  0x000be576 in MemsetPointer<v8::internal::Object, v8::internal::Object> [inlined] () at v8utils.h:4556
#1  0x000be576 in MemsetPointer<v8::internal::Object, v8::internal::Object> [inlined] () at v8utils.h:4556
#2  0x000be576 in AllocateFixedArrayWithFiller (heap=0x622054, length=4099, pretenure=<value temporarily unavailable, due to optimizations>, filler=0x4fa08091) at ../deps/v8/src/heap.cc:4556
#3  0x000c0cf0 in MemsetPointer<v8::internal::Object, v8::internal::Object> [inlined] () at v8utils.h:4565
#4  0x000c0cf0 in v8::internal::Heap::AllocateHashTable (this=0x622054, length=946897053, pretenure=6430804) at ../deps/v8/src/heap.cc:4556
#5  0x0017c2f2 in v8::internal::HashTable<v8::internal::SymbolTableShape, v8::internal::HashTableKey*>::Allocate (at_least_space_for=1335918737, pretenure=v8::internal::NOT_TENURED) at ../deps/v8/src/heap.cc:4556
#6  0x000c7bce in v8::internal::Heap::CreateInitialObjects (this=0x1000) at ../deps/v8/src/heap.cc:4556
#7  0x000c8c1e in v8::internal::Heap::SetUp (this=0x622054, create_heap_objects=true) at ../deps/v8/src/heap.cc:4556
#8  0x00148a56 in v8::internal::Isolate::Init (this=0x622000, des=0x0) at ../deps/v8/src/heap.cc:4556
#9  0x0027eb0c in v8::internal::V8::Initialize (des=0x0) at ../deps/v8/src/heap.cc:4556
#10 0x00026e49 in MemsetPointer<v8::internal::Object, v8::internal::Object> [inlined] () at v8utils.h:295
#11 0x00026e49 in v8::Context::New (extensions=0x0, global_template={val_ = 0x0}, global_object={val_ = 0x0}) at ../deps/v8/src/heap.cc:4556
#12 0x00002418 in main (argc=2, argv=0xbffff618) at ../deps/v8/src/heap.cc:4556
(gdb) quit
The program is running.  Exit anyway? (y or n) y
sam:node-7 jdd$ 
@bnoordhuis

This comment has been minimized.

Copy link
Member

@bnoordhuis bnoordhuis commented Apr 16, 2012

@jdduncan: Does the segfault go away in debug builds (make -C out BUILDTYPE=Debug)? You may be running into a compiler bug that only kicks in at -O1 and higher.

@jdduncan

This comment has been minimized.

Copy link
Author

@jdduncan jdduncan commented Apr 16, 2012

bnoordhuis: I just tried a debug build and got the same error.

@TooTallNate

This comment has been minimized.

Copy link

@TooTallNate TooTallNate commented Apr 16, 2012

@jdduncan I remember seeing that happen on 10.5, and the problem went away when using gcc 4.2 instead of the default 4.0:

CC=gcc-4.2 CXX=g++-4.2 ./configure && make
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.