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

Can't build Julia on FreeBSD 12 with BinaryBuilder libuv #34627

Closed
ararslan opened this issue Feb 2, 2020 · 16 comments
Closed

Can't build Julia on FreeBSD 12 with BinaryBuilder libuv #34627

ararslan opened this issue Feb 2, 2020 · 16 comments
Labels
bug Indicates an unexpected problem or unintended behavior building Build system, or building Julia or its dependencies system:freebsd Affects only FreeBSD

Comments

@ararslan
Copy link
Member

ararslan commented Feb 2, 2020

I updated my FreeBSD system from 12.0 to 12.1, cleaned out my Julia clone (git clean -fdx) and rebuilt from scratch with the default options and no ccache. It seems there was a segfault while building the sysimage:

    LINK usr/lib/libjulia.so.1.5
ld: warning: found local symbol '__bss_start' in global part of symbol table in file /usr/home/alex/Projects/julia/usr/lib/libLLVM.so
ld: warning: found local symbol '_end' in global part of symbol table in file /usr/home/alex/Projects/julia/usr/lib/libLLVM.so
ld: warning: found local symbol '_edata' in global part of symbol table in file /usr/home/alex/Projects/julia/usr/lib/libLLVM.so
    CC ui/repl.o
    LINK usr/bin/julia
    JULIA usr/lib/julia/corecompiler.ji
gmake[1]: *** [sysimage.mk:61: /usr/home/alex/Projects/julia/usr/lib/julia/corecompiler.ji] Segmentation fault (core dumped)
gmake: *** [Makefile:81: julia-sysimg-ji] Error 2

The full build output can be found here. The system compiler is Clang 8.0.1 and the local GCC version is 9.2.0.

EDIT: Also note the LLVM deprecation messages during the build; I don't recall getting those on Linux or macOS.

@ararslan ararslan added bug Indicates an unexpected problem or unintended behavior building Build system, or building Julia or its dependencies system:freebsd Affects only FreeBSD labels Feb 2, 2020
@ararslan
Copy link
Member Author

ararslan commented Feb 2, 2020

Seems to build and work just fine if I rebuild with USE_BINARYBUILDER=0. A problem with the cross-compiled LLVM, maybe? @staticfloat?

@ararslan
Copy link
Member Author

ararslan commented Feb 2, 2020

Also, the nightly binaries as of fbc2c0a, version 1.5.0-DEV.221, seem to be operable AFAICT...

@giordano
Copy link
Contributor

giordano commented Feb 2, 2020

Any chance to find out which is the offending binary, maybe by using binary search? 😁

@ararslan
Copy link
Member Author

ararslan commented Feb 3, 2020

which is the offending binary

Not sure what you mean. Like which dependency is the problem?

@giordano
Copy link
Contributor

giordano commented Feb 3, 2020

Yes

@staticfloat
Copy link
Member

Also, the nightly binaries as of fbc2c0a, version 1.5.0-DEV.221, seem to be operable AFAICT...

So you're saying the nightly binaries work, but you can't compile from source using BB deps?

@ararslan
Copy link
Member Author

ararslan commented Feb 3, 2020

Yes, exactly.

@staticfloat
Copy link
Member

Can you run the bootstrap command in gdb or lldb to see where the segfault is coming from?

@ararslan
Copy link
Member Author

ararslan commented Feb 3, 2020

I'm not sure how exactly to do that. Any tips?

@JeffBezanson
Copy link
Member

This should work:

cd base
gdb ../julia
(gdb) r --output-ji x compiler/compiler.jl

@ararslan
Copy link
Member Author

$ gdb ../julia
GNU gdb (GDB) 9.1 [GDB v9.1 for FreeBSD]
<...>
Reading symbols from ../julia...
(gdb) r --output-ji x compiler/compiler.jl
Starting program: /usr/home/alex/Projects/julia/julia --output-ji x compiler/compiler.jl
[New LWP 100768 of process 10478]

Thread 1 received signal SIGSEGV, Segmentation fault.
0x000000080048c0c8 in uv__to_stat (src=0x7fffffffde10, dst=0x19) at src/unix/fs.c:1104
1104	src/unix/fs.c: No such file or directory.
(gdb) bt
#0  0x000000080048c0c8 in uv__to_stat (src=0x7fffffffde10, dst=0x19) at src/unix/fs.c:1104
#1  0x000000080048bdbf in uv__fs_stat (path=0x80000006400 <error: Cannot access memory at address 0x80000006400>, buf=0x19)
    at src/unix/fs.c:1260
#2  0x0000000000000000 in ?? ()

@ararslan
Copy link
Member Author

Looks like it could be an issue with the libuv provided by BinaryBuilder. Any suggestions for how to confirm?

@ararslan
Copy link
Member Author

Quoting Elliot from a discussion elsewhere,

I think this is something having to do with attempting to link a static library that was built on 11 against system libraries from 12

One potential fix here may be to dynamically link libuv.

@ararslan
Copy link
Member Author

Something has changed, and now it's a sigabort rather than a segfault

$ gdb ../julia
GNU gdb (GDB) 9.1 [GDB v9.1 for FreeBSD]
<...>
Reading symbols from ../julia...
(gdb) r --output-ji x compiler/compiler.jl
Starting program: /usr/home/alex/Projects/julia/julia --output-ji x compiler/compiler.jl
[New LWP 100873 of process 31424]

Thread 1 received signal SIGABRT, Aborted.
0x0000000800d7a1ba in thr_kill () from /lib/libc.so.7
(gdb) bt
#0  0x0000000800d7a1ba in thr_kill () from /lib/libc.so.7
#1  0x0000000800d785e4 in raise () from /lib/libc.so.7
#2  0x0000000800cec7e9 in abort () from /lib/libc.so.7
#3  0x000000080049fbb0 in uv__io_poll (loop=0x800810380 <default_loop_struct>, timeout=0) at src/unix/kqueue.c:239
#4  0x000000080048802d in uv_run (loop=0x800810380 <default_loop_struct>, mode=UV_RUN_DEFAULT) at src/unix/core.c:359
#5  0x00000008003b63fa in jl_atexit_hook (exitcode=<optimized out>) at init.c:284
#6  0x0000000000202395 in main (argc=<optimized out>, argv=<optimized out>) at repl.c:228

Could be the same underlying issue though

@vtjnash
Copy link
Member

vtjnash commented Mar 15, 2021

Is this still an issue?

@ararslan ararslan changed the title Segfault on clean build, FreeBSD 12.1 Can't build Julia on FreeBSD 12 with BinaryBuilder libuv Mar 15, 2021
@ararslan
Copy link
Member Author

Yeah, unfortunately. The easiest fix is to dynamically link libuv.

vtjnash pushed a commit that referenced this issue Aug 18, 2021
The FreeBSD binaries for this build are built with FreeBSD 12 rather
than FreeBSD 11, which will work around issue #34627.
@vtjnash vtjnash closed this as completed Aug 18, 2021
KristofferC pushed a commit that referenced this issue Nov 7, 2021
The FreeBSD binaries for this build are built with FreeBSD 12 rather
than FreeBSD 11, which will work around issue #34627.

(cherry picked from commit 5e1670e)
KristofferC pushed a commit that referenced this issue Nov 10, 2021
The FreeBSD binaries for this build are built with FreeBSD 12 rather
than FreeBSD 11, which will work around issue #34627.

(cherry picked from commit 5e1670e)
KristofferC pushed a commit that referenced this issue Nov 10, 2021
The FreeBSD binaries for this build are built with FreeBSD 12 rather
than FreeBSD 11, which will work around issue #34627.

(cherry picked from commit 5e1670e)
KristofferC pushed a commit that referenced this issue Nov 11, 2021
The FreeBSD binaries for this build are built with FreeBSD 12 rather
than FreeBSD 11, which will work around issue #34627.

(cherry picked from commit 5e1670e)
KristofferC pushed a commit that referenced this issue Nov 12, 2021
The FreeBSD binaries for this build are built with FreeBSD 12 rather
than FreeBSD 11, which will work around issue #34627.

(cherry picked from commit 5e1670e)
LilithHafner pushed a commit to LilithHafner/julia that referenced this issue Feb 22, 2022
The FreeBSD binaries for this build are built with FreeBSD 12 rather
than FreeBSD 11, which will work around issue JuliaLang#34627.
LilithHafner pushed a commit to LilithHafner/julia that referenced this issue Mar 8, 2022
The FreeBSD binaries for this build are built with FreeBSD 12 rather
than FreeBSD 11, which will work around issue JuliaLang#34627.
staticfloat pushed a commit that referenced this issue Dec 23, 2022
The FreeBSD binaries for this build are built with FreeBSD 12 rather
than FreeBSD 11, which will work around issue #34627.

(cherry picked from commit 5e1670e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior building Build system, or building Julia or its dependencies system:freebsd Affects only FreeBSD
Projects
None yet
Development

No branches or pull requests

5 participants