Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#30012 closed defect (fixed)

Erlang port hangs during installation on Lion DP

Reported by: conradwt (Conrad Taylor) Owned by: bfulgham@…
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: lion Cc: jpr5@…
Port: erlang

Description

The Erlang port appears to hang on the following line:

sudo port -f -v install erlang +odbc

...

erlc -W  +debug_info +inline -o../ebin hipe_rtl.erl
(no error logger present) error: "Error in process <0.1.0> with exit value: {{badfun,[<<5 bytes>>,<<142 bytes>>,<<9 bytes>>,<<3 bytes>>,<<2 bytes>>,<<5 bytes>>,<<9 bytes>>,<<2 bytes>>,<<8 bytes>>,<<8 bytes>>,<<5 bytes>>,<<7 bytes>>,<<5 bytes>>,<<11 bytes>>,<<2 bytes>>,<<11 bytes>>,<<15 bytes>>,<<4 bytes>>,<<145 bytes>>,<<5 bytes>>,<<1 byte>>,<<7 bytes>>,<<10 bytes>>,<<7 bytes>>,<<6 bytes>>,<<7 bytes>>,<<7 bytes>>,<<6 bytes>>,<<12 bytes>>]},[{erlang,apply,2}]}\n"

Change History (17)

comment:1 Changed 9 years ago by ryandesign (Ryan Schmidt)

Owner: changed from macports-tickets@… to bfulgham@…

comment:2 Changed 9 years ago by jmroot (Joshua Root)

Which version of the erlang port? What OS version, Xcode version, and build_arch?

comment:3 Changed 9 years ago by conradwt (Conrad Taylor)

Hi, here are the answers from your previous comment:

erlang version: R14B03

os version: Mac OS 10.7 (Build 11A511)

xcode version: Xcode 4.2 (Build 4D58)

build_arch: Intel x86_64

Or should I post this question within the Mac OS Developer forums or another appropriate forum?

comment:4 Changed 9 years ago by jpr5@…

I have the same problem too. OSX 10.7 as well, all the same versions.

comment:5 Changed 9 years ago by jpr5@…

Well, my Xcode is different. It's Xcode 4.1, build 4B95.

However, mine always seems to hang at the same place. Give you some debug info, if it helps -- apologies in advance for the wide output..

pstree output from port upgrade erlang:

             \-+= 59990 root /usr/bin/tclsh /opt/local/bin/port upgrade erlang
               \-+- 59994 root sh -c  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R14B03" && /usr/bin/make all 
                 \-+- 59995 root /usr/bin/make all
                   \-+- 60339 root /bin/sh -c cd lib &&   ERL_TOP=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R14B03 PATH=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R14B03/bootstrap/bin:${PATH} ^Imake opt SECONDARY_BOOTSTRAP=true
                     \-+- 60340 root make opt SECONDARY_BOOTSTRAP=true
                       \-+- 60341 root /bin/sh -c set -e ;^I^I^I^I^I^I^Iapp_pwd=`pwd` ;^I^I^I^I^I^I^Iif test -f vsn.mk; then^I^I^I^I^I^I    echo "=== Entering application" `basename $app_pwd` ;^Ifi ;^I^I^I^I^I^I^I^Icase "make" in *clearmake*) tflag="-T";; *) tflag="";; esac;^Ifor d in hipe parsetools asn1/src; do^I^I^I^I^I    if test -f $d/SKIP ; then^I^I^I^I^I^Iecho "=== Skipping subdir $d, reason:" ;^I^I^Icat $d/SKIP ;^I^I^I^I^I^I^Iecho "===" ;^I^I^I^I^I^I    else^I^I^I^I^I^I^I^Iif test ! -d $d ; then^I^I^I^I^I^I    echo "=== Skipping subdir $d, it is missing" ;^I^Ielse^I^I^I^I^I^I^I^I    xflag="" ;^I^I^I^I^I^I^I    if test -f $d/ignore_config_record.inf; then^I^I^Ixflag=$tflag ;^I^I^I^I^I^I    fi ;^I^I^I^I^I^I^I    (cd $d && make $xflag opt) || exit $? ;^I^Ifi ;^I^I^I^I^I^I^I    fi ;^I^I^I^I^I^I^Idone ;^I^I^I^I^I^I^I^Iif test -f vsn.mk; then^I^I^I^I^I^I    echo "=== Leaving application" `basename $app_pwd` ;^Ifi
                         \-+- 60343 root /bin/sh -c set -e ;^I^I^I^I^I^I^Iapp_pwd=`pwd` ;^I^I^I^I^I^I^Iif test -f vsn.mk; then^I^I^I^I^I^I    echo "=== Entering application" `basename $app_pwd` ;^Ifi ;^I^I^I^I^I^I^I^Icase "make" in *clearmake*) tflag="-T";; *) tflag="";; esac;^Ifor d in hipe parsetools asn1/src; do^I^I^I^I^I    if test -f $d/SKIP ; then^I^I^I^I^I^Iecho "=== Skipping subdir $d, reason:" ;^I^I^Icat $d/SKIP ;^I^I^I^I^I^I^Iecho "===" ;^I^I^I^I^I^I    else^I^I^I^I^I^I^I^Iif test ! -d $d ; then^I^I^I^I^I^I    echo "=== Skipping subdir $d, it is missing" ;^I^Ielse^I^I^I^I^I^I^I^I    xflag="" ;^I^I^I^I^I^I^I    if test -f $d/ignore_config_record.inf; then^I^I^Ixflag=$tflag ;^I^I^I^I^I^I    fi ;^I^I^I^I^I^I^I    (cd $d && make $xflag opt) || exit $? ;^I^Ifi ;^I^I^I^I^I^I^I    fi ;^I^I^I^I^I^I^Idone ;^I^I^I^I^I^I^I^Iif test -f vsn.mk; then^I^I^I^I^I^I    echo "=== Leaving application" `basename $app_pwd` ;^Ifi
                           \-+- 60344 root make opt
                             \-+- 60345 root /bin/sh -c set -e ;^I^I^I^I^I^I^Iapp_pwd=`pwd` ;^I^I^I^I^I^I^Iif test -f vsn.mk; then^I^I^I^I^I^I    echo "=== Entering application" `basename $app_pwd` ;^Ifi ;^I^I^I^I^I^I^I^Icase "make" in *clearmake*) tflag="-T";; *) tflag="";; esac;^Ifor d in rtl misc main cerl icode flow util doc/src regalloc sparc ppc x86 amd64 arm opt tools; do^I^I^I^I^I    if test -f $d/SKIP ; then^I^I^I^I^I^Iecho "=== Skipping subdir $d, reason:" ;^I^I^Icat $d/SKIP ;^I^I^I^I^I^I^Iecho "===" ;^I^I^I^I^I^I    else^I^I^I^I^I^I^I^Iif test ! -d $d ; then^I^I^I^I^I^I    echo "=== Skipping subdir $d, it is missing" ;^I^Ielse^I^I^I^I^I^I^I^I    xflag="" ;^I^I^I^I^I^I^I    if test -f $d/ignore_config_record.inf; then^I^I^Ixflag=$tflag ;^I^I^I^I^I^I    fi ;^I^I^I^I^I^I^I    (cd $d && make $xflag opt) || exit $? ;^I^Ifi ;^I^I^I^I^I^I^I    fi ;^I^I^I^I^I^I^Idone ;^I^I^I^I^I^I^I^Iif test -f vsn.mk; then^I^I^I^I^I^I    echo "=== Leaving application" `basename $app_pwd` ;^Ifi
                               \-+- 60349 root /bin/sh -c set -e ;^I^I^I^I^I^I^Iapp_pwd=`pwd` ;^I^I^I^I^I^I^Iif test -f vsn.mk; then^I^I^I^I^I^I    echo "=== Entering application" `basename $app_pwd` ;^Ifi ;^I^I^I^I^I^I^I^Icase "make" in *clearmake*) tflag="-T";; *) tflag="";; esac;^Ifor d in rtl misc main cerl icode flow util doc/src regalloc sparc ppc x86 amd64 arm opt tools; do^I^I^I^I^I    if test -f $d/SKIP ; then^I^I^I^I^I^Iecho "=== Skipping subdir $d, reason:" ;^I^I^Icat $d/SKIP ;^I^I^I^I^I^I^Iecho "===" ;^I^I^I^I^I^I    else^I^I^I^I^I^I^I^Iif test ! -d $d ; then^I^I^I^I^I^I    echo "=== Skipping subdir $d, it is missing" ;^I^Ielse^I^I^I^I^I^I^I^I    xflag="" ;^I^I^I^I^I^I^I    if test -f $d/ignore_config_record.inf; then^I^I^Ixflag=$tflag ;^I^I^I^I^I^I    fi ;^I^I^I^I^I^I^I    (cd $d && make $xflag opt) || exit $? ;^I^Ifi ;^I^I^I^I^I^I^I    fi ;^I^I^I^I^I^I^Idone ;^I^I^I^I^I^I^I^Iif test -f vsn.mk; then^I^I^I^I^I^I    echo "=== Leaving application" `basename $app_pwd` ;^Ifi
                                 \-+- 60350 root make opt
                                   \--- 60351 root /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R14B03/bin/i386-apple-darwin11.0.0/beam.smp -- -root /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R14B03/bootstrap -progname erl -- -home /Users/jpr5 -- -noshell -noinput -mode minimal -boot start_clean -s erl_compile compile_cmdline @cwd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R14B03/lib/hipe/rtl @warn 1 @option debug_info @option inline @outdir ../ebin @files hipe_rtl.erl

dtruss -p 60351 reveals nothing; looks like it's not doing anything.

lsof -nP -p 60351 doesn't appear to reveal anything useful either:

COMMAND    PID USER   FD   TYPE             DEVICE  SIZE/OFF    NODE NAME
beam.smp 60351 root  cwd    DIR               14,4       918 8405881 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R14B03/lib/hipe/rtl
beam.smp 60351 root  txt    REG               14,4   3947536 8420683 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/work/erlang-R14B03/bin/i386-apple-darwin11.0.0/beam.smp
beam.smp 60351 root  txt    REG               14,4     92000 7802889 /opt/local/lib/libz.1.2.5.dylib
beam.smp 60351 root  txt    REG               14,4    317292 7812583 /opt/local/lib/libncurses.5.dylib
beam.smp 60351 root  txt    REG               14,4    599232 6027396 /usr/lib/dyld
beam.smp 60351 root  txt    REG               14,4 288940032 6450707 /private/var/db/dyld/dyld_shared_cache_x86_64
beam.smp 60351 root    0r   CHR                3,2       0t0     306 /dev/null
beam.smp 60351 root    1   PIPE 0xffffff800fef92e0     16384         ->0xffffff800cb4d4d0
beam.smp 60351 root    2   PIPE 0xffffff800fef92e0     16384         ->0xffffff800cb4d4d0
beam.smp 60351 root    3   PIPE 0xffffff801b836d30     16384         ->0xffffff800cb507b0
beam.smp 60351 root    4   PIPE 0xffffff800cb507b0     16384         ->0xffffff801b836d30
beam.smp 60351 root    5r   CHR                3,2       0t0     306 /dev/null
beam.smp 60351 root    6   PIPE 0xffffff800cb4d9a0     16384         ->0xffffff800cb4da50
beam.smp 60351 root    7   PIPE 0xffffff800cb4da50     16384         ->0xffffff800cb4d9a0
beam.smp 60351 root    8   PIPE 0xffffff800fef9440     16384         ->0xffffff800cb4d630
beam.smp 60351 root    9   PIPE 0xffffff800cb4d630     16384         ->0xffffff800fef9440
beam.smp 60351 root   10   PIPE 0xffffff800fef7b80     16384         ->0xffffff800cb4d580
beam.smp 60351 root   11   PIPE 0xffffff800cb4d580     16384         ->0xffffff800fef7b80
beam.smp 60351 root   12   PIPE 0xffffff801b836390     16384         ->0xffffff801666d2e0
beam.smp 60351 root   13   PIPE 0xffffff800fef92e0     16384         ->0xffffff800cb4d4d0
beam.smp 60351 root   14   PIPE 0xffffff801666d2e0     16384         ->0xffffff801b836390

comment:6 Changed 9 years ago by jpr5@…

Cc: jpr5@… added

Cc Me!

comment:7 Changed 9 years ago by jpr5@…

Dunno if it's significant, but note the multiple --'s in the beam.smp invocation from the pstree output.

Maybe this is typical of erlang b.s., but last I checked getopt() only needed 1 -- to indicate "stop processing command line args". Maybe something is borked with whatever is generating the cmdline?

comment:8 Changed 9 years ago by jmroot (Joshua Root)

Keywords: lion added
Summary: Erlang port hangs during installationErlang port hangs during installation on Lion DP

It's ultimately up to the maintainer, but we generally don't support using MacPorts with prerelease operating systems or dev tools. The developer forums are probably a better place to try to solve this. If you come up with a fix, attach the patch to this ticket.

comment:9 Changed 9 years ago by ray@…

Here's a temporary workaround until the maintainer fixes the Portfile.

Add the following lines on line 63 right above the configure.args line in the erlang Portfile.

configure.cc    gcc-4.2
configure.cxx   g++-4.2
configure.cpp   cpp-4.2

comment:10 in reply to:  9 Changed 9 years ago by jpr5@…

Oh AWESOME. Thanks!!

Replying to ray@…:

Here's a temporary workaround until the maintainer fixes the Portfile.

comment:11 Changed 9 years ago by conradwt (Conrad Taylor)

Could someone tell me the location of the Portfile to edit?

comment:12 Changed 9 years ago by conradwt (Conrad Taylor)

OK, I believe that I found the correct file to update. I'll report back with any updates.

comment:13 Changed 9 years ago by conradwt (Conrad Taylor)

The installation was successful but the couched port fails because of the following message:

configure: error: Could not find the Erlang crypto library. Has Erlang
been compiled with OpenSSL support?

Please see issue #30089 for further information.

comment:14 Changed 9 years ago by bfulgham@…

Resolution: fixed
Status: newclosed

I just committed a build fix based on http://groups.google.com/group/erlang-programming/browse_thread/thread/b427009eca1754b0. To use the Apple stock compiler, you need to build with optimization level -O0.

The underlying problem is in LLVM (see http://llvm.org/bugs/show_bug.cgi?id=7883).

As an alternative, we could force installation of the gcc-4.2 compiler (NOT the built-in Apple gcc, which is llvm-gcc).

For now, I'm opting to use the -O0 optimization level to reduce the burden on using Erlang on a stock Macports installation.

comment:15 Changed 9 years ago by bfulgham@…

Fix was landed in r81296.

comment:16 Changed 9 years ago by andre.david@…

How is this related to #30516, which was submitted after the fix here ?

comment:17 in reply to:  16 Changed 9 years ago by easye

Replying to andre.david@…:

How is this related to #30516, which was submitted after the fix here ?

It looks like that #30516 occurs when one has Xcode 4 installed on OS X 10.6, as the configure process on my machine picks up the llvm-gcc-4.2 compiler.

Patching as follows enables the build to get past the hipe error on OS X 10.6:

Index: Portfile
===================================================================
--- Portfile	(revision 82103)
+++ Portfile	(working copy)
@@ -102,6 +102,11 @@
     # This is a workaround.
     patchfiles-append   patch-erts_emulator_sys_unix_ddll.c.diff
     configure.ldflags-append -framework CoreFoundation
+
+    configure.cflags-delete -O2
+    configure.cxxflags-delete -O2
+    configure.cflags-append -O0
+    configure.cxxflags-append -O0
 }
 
 platform darwin 11 {
Note: See TracTickets for help on using tickets.