Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem bootstrapping the sys0.ji file #1052

Closed
spott opened this issue Jul 13, 2012 · 30 comments
Closed

problem bootstrapping the sys0.ji file #1052

spott opened this issue Jul 13, 2012 · 30 comments
Labels
building Build system, or building Julia or its dependencies system:mac Affects only macOS

Comments

@spott
Copy link

spott commented Jul 13, 2012

I'm running into an issue with compiling julia:

https://gist.github.com/3107999

I'm compiling julia through homebrew, however it appears to be a julia problem that I'm having:

staticfloat/homebrew-julia#1

Let me know if I need to reproduce the problem somewhere else.

-Andrew

@pao
Copy link
Member

pao commented Jul 14, 2012

Mac people, assemble! cc @ViralBShah @StefanKarpinski

(Do we need a "mac" tag?)

@ViralBShah
Copy link
Member

I think a mac tag is a good idea, and might as well add linux while we are at it. We already have windows.

-viral

On 14-Jul-2012, at 6:17 AM, pao wrote:

Mac people, assemble! cc @ViralBShah @StefanKarpinski

(Do we need a "mac" tag?)


Reply to this email directly or view it on GitHub:
#1052 (comment)

@pao
Copy link
Member

pao commented Jul 14, 2012

Mac tag done (in brushed metal!)

@staticfloat
Copy link
Member

Last time I had a problem like this, it was actually @JeffBezanson who knew what was going on, presumably due to his expertise in the whole sys0.ji business. :)

@nolta
Copy link
Member

nolta commented Jul 16, 2012

@spott, can you try building julia without using homebrew, and see if you run into the same problem.

@spott
Copy link
Author

spott commented Jul 16, 2012

@nolta, I had done this before, and it worked, however, when I just did it, it failed. I'm not sure what changed in my environment since it worked before (well, a lot of things probably changed, it went from a brand new computer, to having a bunch of custom homebrew install stuff, but I don't know specifically what might have caused a problem.):

LINK usr/bin/julia-release-basic
LINK usr/bin/julia-release-readline
LINK usr/bin/julia-release-webserver
JULIA usr/lib/julia/sys0.ji
/bin/sh: line 1: 85008 Segmentation fault: 11  /Users/spott/Documents/Code/julia/usr/bin/julia-release-readline -b stage0.jl
make[1]: *** [/Users/spott/Documents/Code/julia/usr/lib/julia/sys0.ji] Error 139
make: *** [release] Error 2 

I'm not sure how to get more verbose information out of the compilation, so I can't give you any more than that.

@samueljohn
Copy link

I can build julia fine with the same homebrew version as @spott.

@nolta
Copy link
Member

nolta commented Jul 16, 2012

I'm not sure what changed in my environment since it worked before:

Is this a fresh clone + build? If not, can you try git pull && make cleanall test?

And if that doesn't fix it, what's the output of:

$ cd base
$ gdb ../julia
...
(gdb) r -b stage0.jl
...
(gdb) bt

I gather you're trying this on a new retina macbook pro?

@spott
Copy link
Author

spott commented Jul 16, 2012

This was a brand new git clone ### and make -j 7 (later replicated with just a regular make, though not completely rebuilt, should I do that?)

(gdb) r -b stage0.jl
Starting program: /Users/spott/Documents/Code/julia/julia -b stage0.jl
Reading symbols for shared libraries +++.+................................................................................................. done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x0000000100058fb8 in jl_method_table_assoc_exact ()
(gdb) bt
# 0  0x0000000100058fb8 in jl_method_table_assoc_exact ()
# 1  0x0000000100058e9c in jl_apply_generic ()
# 2  0x0000000100061096 in jl_show ()
# 3  0x00000001000014a7 in exec_program ()
# 4  0x0000000100001721 in true_main ()
# 5  0x00000001000861ad in julia_trampoline ()
# 6  0x0000000100001ded in main ()

Let me know if you need anything else.

(these are short code snippets, if I should start putting them in gists instead of pasting them here, let me know.)

[pao: avoid autolinking issues 1-6]

@nolta
Copy link
Member

nolta commented Jul 16, 2012

What's the output of git rev-parse HEAD?

And is this an ivy bridge mac?

Can you try the following:

$ make debug
$ cd base
$ gdb ../usr/bin/julia-debug-basic
...
(gdb) b jl_raise
(gdb) r -b stage0.jl
...
(gdb) bt

@samueljohn
Copy link

He has an ivy bridge mac. Retina MBP. Lucky one :-)

@spott
Copy link
Author

spott commented Jul 16, 2012

Yes, I am running an IvyBridge retina MacBook Pro. :)

git rev-parse HEAD:
3f0d689fa48689ddeaf7498e85f1035c0b0ff9ee

make debug dies with:

    LINK usr/bin/julia-debug-readline
    LINK usr/bin/julia-debug-webserver
    JULIA usr/lib/julia/sys0.ji
/bin/sh: line 1: 86201 Segmentation fault: 11  /Users/spott/Documents/Code/julia/usr/bin/julia-debug-readline -b stage0.jl
make[1]: *** [/Users/spott/Documents/Code/julia/usr/lib/julia/sys0.ji] Error 139
make: *** [debug] Error 2
(gdb) b jl_raise
Breakpoint 1 at 0x4189374b18ea2c: file task.c, line 521.
(gdb) r -b stage0.jl
Starting program: /Users/spott/Documents/Code/julia/usr/bin/julia-debug-basic -b stage0.jl
Reading symbols for shared libraries ++++................................................................................................. done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done

Breakpoint 1, jl_raise (e=0x10c5927b0) at task.c:521
521     jl_task_t *eh = jl_current_task->state.eh_task;
(gdb) bt
#0  jl_raise (e=0x10c5927b0) at task.c:521
#1  0x000000010001bb82 in jl_errorf (fmt=0x1008d0467 "could not load module %s: %s") at builtins.c:48
#2  0x000000010007a2b6 in jl_load_dynamic_library (modname=0x10c5ad9b8 "libm") at dlload.c:105
#3  0x0000000103111246 in ?? ()
#4  0x0000000100014624 in jl_apply (f=0x102d331a0, args=0x7fff5fbfdaa8, nargs=1) at julia.h:846
#5  0x0000000100017460 in jl_apply_generic (F=0x10294b9a0, args=0x7fff5fbfdaa8, nargs=1) at gf.c:1241
#6  0x0000000100074974 in jl_apply (f=0x10294b9a0, args=0x7fff5fbfdaa8, nargs=1) at julia.h:846
#7  0x00000001000748e4 in do_call (f=0x10294b9a0, args=0x10c59dc38, nargs=1, locals=0x0, nl=0) at interpreter.c:53
#8  0x0000000100074d7e in eval (e=0x10c5a7c40, locals=0x0, nl=0) at interpreter.c:114
#9  0x0000000100074eaa in eval (e=0x10c5a7c20, locals=0x0, nl=0) at interpreter.c:125
#10 0x0000000100074458 in jl_interpret_toplevel_expr (e=0x10c5a7c20) at interpreter.c:16
#11 0x0000000100087e0a in jl_toplevel_eval_flex (e=0x10c5a7be0, fast=1, plineno=0x7fff5fbfe444) at toplevel.c:240
#12 0x000000010008812f in jl_parse_eval_all (fname=0x10c59daf0 "math_libm.jl") at toplevel.c:286
#13 0x0000000100088394 in jl_load (fname=0x10c59daf0 "math_libm.jl") at toplevel.c:325
#14 0x00000001000883e0 in jl_load_ (str=0x10c592770) at toplevel.c:332
#15 0x00000001031014ac in ?? ()
#16 0x0000000100014624 in jl_apply (f=0x102905e60, args=0x7fff5fbfe5d8, nargs=1) at julia.h:846
#17 0x0000000100017460 in jl_apply_generic (F=0x1028cfe00, args=0x7fff5fbfe5d8, nargs=1) at gf.c:1241
#18 0x0000000100074974 in jl_apply (f=0x1028cfe00, args=0x7fff5fbfe5d8, nargs=1) at julia.h:846
#19 0x00000001000748e4 in do_call (f=0x1028cfe00, args=0x10c59db38, nargs=1, locals=0x0, nl=0) at interpreter.c:53
#20 0x0000000100074d7e in eval (e=0x10c5a7bc0, locals=0x0, nl=0) at interpreter.c:114
#21 0x0000000100074458 in jl_interpret_toplevel_expr (e=0x10c5a7bc0) at interpreter.c:16
#22 0x0000000100087e0a in jl_toplevel_eval_flex (e=0x10c5a7ba0, fast=1, plineno=0x7fff5fbfec24) at toplevel.c:240
#23 0x000000010008812f in jl_parse_eval_all (fname=0x10282ad70 "sysimg.jl") at toplevel.c:286
---Type <return> to continue, or q <return> to quit---
#24 0x0000000100088394 in jl_load (fname=0x10282ad70 "sysimg.jl") at toplevel.c:325
#25 0x00000001000883e0 in jl_load_ (str=0x1028fba60) at toplevel.c:332
#26 0x00000001031014ac in ?? ()
#27 0x000000010001cd04 in jl_apply (f=0x102905e60, args=0x7fff5fbfee68, nargs=1) at julia.h:846
#28 0x000000010001ebd3 in jl_trampoline (F=0x102905e60, args=0x7fff5fbfee68, nargs=1) at builtins.c:659
#29 0x0000000100014624 in jl_apply (f=0x102905e60, args=0x7fff5fbfee68, nargs=1) at julia.h:846
#30 0x0000000100017460 in jl_apply_generic (F=0x1028cfe00, args=0x7fff5fbfee68, nargs=1) at gf.c:1241
#31 0x0000000100074974 in jl_apply (f=0x1028cfe00, args=0x7fff5fbfee68, nargs=1) at julia.h:846
#32 0x00000001000748e4 in do_call (f=0x1028cfe00, args=0x10290df78, nargs=1, locals=0x0, nl=0) at interpreter.c:53
#33 0x0000000100074d7e in eval (e=0x102905e40, locals=0x0, nl=0) at interpreter.c:114
#34 0x0000000100074458 in jl_interpret_toplevel_expr (e=0x102905e40) at interpreter.c:16
#35 0x0000000100087e0a in jl_toplevel_eval_flex (e=0x1029044c0, fast=1, plineno=0x7fff5fbff704) at toplevel.c:240
#36 0x0000000100086fbf in jl_eval_module_expr (ex=0x1028d0040, plineno=0x7fff5fbff704) at toplevel.c:64
#37 0x00000001000879a6 in jl_toplevel_eval_flex (e=0x1028d0040, fast=1, plineno=0x7fff5fbff704) at toplevel.c:182
#38 0x000000010008812f in jl_parse_eval_all (fname=0x7fff5fbffbaf "stage0.jl") at toplevel.c:286
#39 0x0000000100088394 in jl_load (fname=0x7fff5fbffbaf "stage0.jl") at toplevel.c:325
#40 0x0000000100001ccf in exec_program () at repl.c:137
#41 0x00000001000020c2 in true_main (argc=1, argv=0x7fff5fbffa20) at repl.c:195
#42 0x000000010007c77a in julia_trampoline (argc=1, argv=0x7fff5fbffa20, pmain=0x100001f90 <true_main>) at init.c:231
#43 0x00000001000023bf in main (argc=1, argv=0x7fff5fbffa20) at repl.c:248

@nolta
Copy link
Member

nolta commented Jul 16, 2012

On your laptop:

CLT: 4.3.0.0.1.1249367152
GCC-4.0: N/A
GCC-4.2: N/A

but on my laptop:

CLT: 1.0.0.9000000000.1.1249367152
GCC-4.0: N/A
GCC-4.2: build 5666

What's the output of gcc --version and gcc-4.2 --version?

@spott
Copy link
Author

spott commented Jul 16, 2012

$gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I don't have a gcc-4.2 I wonder why... I also wonder why I have an older version of gcc...

@nolta
Copy link
Member

nolta commented Jul 16, 2012

And just to be sure, what's the output of file /usr/lib/libm.dylib?

@spott
Copy link
Author

spott commented Jul 16, 2012

$file /usr/lib/libm.dylib
/usr/lib/libm.dylib: Mach-O universal binary with 2 architectures
/usr/lib/libm.dylib (for architecture x86_64):  Mach-O 64-bit dynamically linked shared library x86_64
/usr/lib/libm.dylib (for architecture i386):    Mach-O dynamically linked shared library i386

@samueljohn
Copy link

I have the same gcc --version as @spott and I can compile julia. This is the llvm-gcc which is symlinked as gcc.

i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
Copyright (C) 2007 Free Software Foundation, Inc.

This one comes with Xcode.

@spott
Copy link
Author

spott commented Jul 16, 2012

@samueljohn: do you also not have a separate gcc-4.2?

Also, does your brew --config have a "N/A" after gcc-4.2?

@samueljohn
Copy link

Lion and current Xcode do not ship gcc. Only the llvm-gcc symlink.
Apple does not like the new GPL.

I can try the build (tomorrow) on a core 2 duo Mac with only the
command line tools (there I have no Xcode).

@samueljohn
Copy link

My (working) brew --config output. Julia compiles just fine with this.

HOMEBREW_VERSION: 0.9.2
HEAD: 03744647cc9271abc8c2cb368702fc328ee9a0ec
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit sandybridge
OS X: 10.7.4-x86_64
Xcode: 4.3.3
CLT: N/A
GCC-4.0: N/A
GCC-4.2: N/A
LLVM: build 2336
Clang: 3.1 build 318
MacPorts or Fink? false
X11: 2.7.2 @ /opt/X11
System Ruby: 1.8.7-357
Which Perl:   /usr/bin/perl
Which Python: /usr/bin/python
Which Ruby:   /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

@staticfloat
Copy link
Member

My (working) brew --config is very similar to @samueljohn's:

HOMEBREW_VERSION: 0.9.2
HEAD: 8f4469c781b41fb016e5f186d68661a66ffc0b3a
HOMEBREW_PREFIX: /Users/sabae/.homebrew
HOMEBREW_CELLAR: /Users/sabae/.homebrew/Cellar
CPU: dual-core 64-bit penryn
OS X: 10.7.4-x86_64
Xcode: 4.3.1
CLT: 1.0.0.9000000000.1.1249367152
GCC-4.0: N/A
GCC-4.2: build 5666
LLVM: build 2336
Clang: 3.1 build 318
MacPorts or Fink? false
X11: 2.6.4 @ /usr/X11
System Ruby: 1.8.7-357
Which Perl:   /usr/bin/perl
Which Python: /Users/sabae/.homebrew/bin/python => /Users/sabae/.homebrew/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Which Ruby:   /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

@samueljohn
Copy link

Right now my only suspect is ivybridge.

@spott
Copy link
Author

spott commented Jul 18, 2012

Aren't the different platforms supposed to be backward compatible?

On Jul 17, 2012, at 11:56 PM, Samuel John wrote:

Right now my only suspect is ivybridge.


Reply to this email directly or view it on GitHub:
#1052 (comment)

@samueljohn
Copy link

They should be. But on the other hand it would not be the first time for such an error to be cpu dependent.
@spott have you run brew doctor? Can you think of anything non-standard on your system's software?

@samueljohn
Copy link

@spott brew update and brew outdated just to assure that none of the dependencies is kinda too old?

@spott
Copy link
Author

spott commented Jul 18, 2012

@samueljohn brew doctor only has one error, an unlinked keg that I manually installed (and doesn't need to be linked), brew update and brew outdated don't do anything, everything is up to date.

I unlinked all homebrew software not in the dependencies for julia, and I still get this error.

@spott
Copy link
Author

spott commented Jul 18, 2012

SOLVED!!:

I had an old bashrc thing that appended to DYLD_FALLBACK_LIBRARY_PATH, and that was causing the problems.

@samueljohn
Copy link

Wow, cool!
I guess I'll report to he homebrew team to let the doctor check, if that variable is set!

@spott
Copy link
Author

spott commented Jul 18, 2012

That seems like a decent idea, though no-one in their right mind should have it set... It was a weird case with an old library I was attempting to use. I never actually got it working, but forgot it was in my bashrc.

@samueljohn
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies system:mac Affects only macOS
Projects
None yet
Development

No branches or pull requests

6 participants