iriscouch / build-couchdb

Batteries-included CouchDB build system
227 stars 36 forks source link

Crash on startup in OS X Lion #8

Closed florish closed 12 years ago

florish commented 13 years ago

Everything seems to be in order when running rake from build-couchdb on OS X Lion (10.7.1), but on startup, I get the following error:

$ ./build/bin/couchdb 
Apache CouchDB 1.1.0 (LogLevel=info) is starting.

=CRASH REPORT==== 3-Oct-2011::10:24:06 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.30.0>
    registered_name: []
    exception exit: {bad_return,
                        {{couch_app,start,
                             [normal,
                              ["/Users/floris/Source/build-couchdb/build/etc/couchdb/default.ini",
                               "/Users/floris/Source/build-couchdb/build/etc/couchdb/local.ini"]]},
                         {'EXIT',
                             "dlopen(/Users/floris/Source/build-couchdb/build/lib/couchdb/erlang/lib/couch-1.1.0/priv/lib/couch_icu_driver.so, 2): Symbol not found: _ucol_close_46\n  Referenced from: /Users/floris/Source/build-couchdb/build/lib/couchdb/erlang/lib/couch-1.1.0/priv/lib/couch_icu_driver.so\n  Expected in: flat namespace\n in /Users/floris/Source/build-couchdb/build/lib/couchdb/erlang/lib/couch-1.1.0/priv/lib/couch_icu_driver.so"}}}
      in function  application_master:init/4
    ancestors: [<0.29.0>]
    messages: [{'EXIT',<0.31.0>,normal}]
    links: [<0.29.0>,<0.7.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 2584
    stack_size: 24
    reductions: 254
  neighbours:

=INFO REPORT==== 3-Oct-2011::10:24:06 ===
    application: couch
    exited: {bad_return,{{couch_app,start,
                                    [normal,
                                     ["/Users/floris/Source/build-couchdb/build/etc/couchdb/default.ini",
                                      "/Users/floris/Source/build-couchdb/build/etc/couchdb/local.ini"]]},
                         {'EXIT',"dlopen(/Users/floris/Source/build-couchdb/build/lib/couchdb/erlang/lib/couch-1.1.0/priv/lib/couch_icu_driver.so, 2): Symbol not found: _ucol_close_46\n  Referenced from: /Users/floris/Source/build-couchdb/build/lib/couchdb/erlang/lib/couch-1.1.0/priv/lib/couch_icu_driver.so\n  Expected in: flat namespace\n in /Users/floris/Source/build-couchdb/build/lib/couchdb/erlang/lib/couch-1.1.0/priv/lib/couch_icu_driver.so"}}}
    type: temporary

Found this issue, which seems to be similar: https://github.com/iriscouch/build-couchdb/issues/5

But I don't think that's it, as I only just cloned the git repository from GitHub this morning, so the fix from that issue must be in the code already. Any ideas that might be causing this?

jhs commented 13 years ago

Very interesting. What happens if you source the environment script first?

. ./build/env.sh
./build/bin/couchdb

(I do not think that will solve it but it's worth a try.) If not we'll look into other things. Thanks!

florish commented 13 years ago

Doesn't seem to help, still crashing on startup. But I do have some good news: my Macbook (2010) gives errors, but my iMac (2007, also on Lion 10.7.1), builds and runs just fine, with or without sourcing the environment script.

Just a guess: my Macbook is 64-bit, my iMac isn't, could that make any difference?

jhs commented 13 years ago

Yes! There have been several bugs recently about how to really detect 64-bit on OSX. What is the output of all of these commands on the failing machine?

sysctl -n hw.machine

and also

ruby -e 'puts %x[ /usr/sbin/sysctl -n hw.optional.x86_64 2>/dev/null ].chomp.inspect; puts $?.success?.inspect'

Thanks!

florish commented 13 years ago

Results:

$ sysctl -n hw.machine
x86_64
$ ruby -e 'puts %x[ /usr/sbin/sysctl -n hw.optional.x86_64 2>/dev/null ].chomp.inspect; puts $?.success?.inspect'
"1"
true
jhs commented 12 years ago

There have been some improvements to OS and platform detection. Would you please

  1. Pull or re-clone the latest code (a few git submodules changed so wiping and re-cloning is the most straightforward thing)
  2. rake
  3. Let me know how it went?

Thanks!

florish commented 12 years ago

Just followed the above instructions, but unfortunately, now rake returns an error:

(... lots of rake output ...)
/Users/floris/Source/build-couchdb/dependencies/js_src/configure --prefix=/Users/floris/Source/build-couchdb/build --without-x
creating cache ./config.cache
checking host system type... x86_64-apple-darwin11.2.0
checking target system type... x86_64-apple-darwin11.2.0
checking build system type... x86_64-apple-darwin11.2.0
checking for mawk... no
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking for gcc... gcc-4.2
checking whether the C compiler (gcc-4.2  ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
== Output of config.log ==
cat config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

configure:719: checking host system type
configure:740: checking target system type
configure:758: checking build system type
configure:818: checking for mawk
configure:818: checking for gawk
configure:818: checking for nawk
configure:818: checking for awk
configure:1894: checking for gcc
configure:2007: checking whether the C compiler (gcc-4.2  ) works
configure:2023: gcc-4.2 -o conftest    conftest.c  1>&5
/Users/floris/Source/build-couchdb/dependencies/js_src/configure: line 2022: gcc-4.2: command not found
configure: failed program was:

#line 2018 "configure"
#include "confdefs.h"

main(){return(0);}
== End of config.log ==
git checkout HEAD configure.in
git clean -df .
Removing configure
rake aborted!
Command failed with status (1): [/Users/floris/Source/build-couchdb/depende...]

Tasks: TOP => default => couchdb:build => couchdb:couchdb => tracemonkey:build => /Users/floris/Source/build-couchdb/build/bin/js-config
(See full trace by running task with --trace)

Note: my system has changed a bit in the mean time, I did a clean install of OS X Lion (previously upgraded to Lion from Snow Leopard). I'm running 10.7.2 now, with Xcode 4.2.

jhs commented 12 years ago

Interesting. I wonder if GNU gcc is completely absent from the newer releases from Apple. It would appear so.

Would you please try the latest commit?

  1. git pull
  2. rm -rf ./build
  3. rake

You should be able to skip step 2 however if it fails, please try with step 2 (totally clean build) to rule out all possible variables.

The commit tells the Spidermonkey configurator to use the correct GCC executable. It works on my system, however that was a Snow Leopard upgrade and the previous code had also worked.

florish commented 12 years ago

Tried it without step 2 and everything works perfectly now, thanks!