JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.54k stars 5.47k forks source link

libunwind ld warning during build #53816

Open IanButterworth opened 6 months ago

IanButterworth commented 6 months ago

After a full clean build I see this ld warning.

Outputting sysimage file...
Output ──────  29.358161 seconds
    LINK usr/lib/julia/sys.dylib
ld: warning: reexported library with install name '@rpath/libunwind.1.dylib' found at '/Users/ian/Documents/GitHub/julia/usr/lib/libunwind.1.0.dylib' couldn't be matched with any parent library and will be linked directly
    JULIA stdlib/release.image

Update: Line numbers fixed by https://github.com/JuliaLang/julia/pull/54032

Then, I assume related, the 2nd & 3rd line numbers are off (possibly others, unchecked) https://github.com/JuliaLang/julia/blob/6c22dfd3180b82566cc3fce2cea5782623d6e1e9/base/precompilation.jl#L372 https://github.com/JuliaLang/julia/blob/6c22dfd3180b82566cc3fce2cea5782623d6e1e9/base/loading.jl#L2291

Failed to precompile RFFT [3bd9afcd-55df-531a-9b34-dc642dce7b95] to "/Users/ian/.julia/compiled/v1.12/RFFT/jl_Ye0qCB".
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] precompilepkgs(pkgs::Vector{…}; internal_call::Bool, strict::Bool, warn_loaded::Bool, timing::Bool, _from_loading::Bool, configs::Pair{…}, io::Base.TTY, fancyprint::Bool)
    @ Base.Precompilation ./precompilation.jl:372
  [3] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:2291
  [4] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2175
  [5] #invoke_in_world#3
    @ ./essentials.jl:1064 [inlined]
  [6] invoke_in_world
    @ ./essentials.jl:1061 [inlined]
  [7] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2166
  [8] macro expansion
    @ ./loading.jl:58 [inlined]
  [9] macro expansion
    @ ./lock.jl:17 [inlined]
 [10] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2063
 [11] #invoke_in_world#3
    @ ./essentials.jl:1064 [inlined]
 [12] invoke_in_world
    @ ./essentials.jl:1061 [inlined]
 [13] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2056
Some type information was truncated. Use `show(err)` to see complete types.
julia> versioninfo()
Julia Version 1.12.0-DEV.227
Commit 6c22dfd318 (2024-03-22 01:04 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin23.2.0)
  CPU: 10 × Apple M2 Pro
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, apple-m2)
Threads: 1 default, 0 interactive, 1 GC (on 6 virtual cores)
IanButterworth commented 6 months ago

I see the ld: warning: reexported library with install name '@rpath/libunwind.1.dylib' error on release-1.11 but not the line number issue

vtjnash commented 6 months ago

Usually something like that happens if the unwind info (dSYM) package is not generated correctly from the right source files (even though it should be verified by build id and hashes before getting used, we might be forcing it to use info even if that doesn't precisely match. The debug info is found by a spotlight search on the system)

IanButterworth commented 6 months ago

I don't quite follow what should be done about this, but in case it's a useful datapoint I did a fully clean build and the issue remains.

MacOS 14.4.1

IanButterworth commented 5 months ago

The incorrect line numbers seems to have been fixed by https://github.com/JuliaLang/julia/pull/54032

shaul-pollak commented 4 months ago

still happening with v1.11 branch on M2 pro MacOS 14.5

mgiugliano commented 3 months ago

While it might be only partly related, I get the same warning on a M3 pro macOs 14.5 when using PackageCompiler.jl to create a simple sys image. However the generated image is only 16 KB and it fails consistency check.

IanButterworth commented 2 months ago

I've been seeing messages about the profiler accessing something illegal (don't have the error at hand, sorry) and wondered if this is related.

@vtjnash I think you may be most knowledgeable about how to fix this, if you can give more detailed instructions to debug/fix. Thanks.

IanButterworth commented 1 month ago

Could this be causing dropped profile frames like this (window on the right is ProfileView.view(C=true)) Screenshot 2024-08-12 at 2 03 55 PM

or do we need to reopen https://github.com/JuliaLang/julia/issues/38350

@gbaraldi I think you had looked into this issue?


Adding that on 1.10.4 Linux aarch64 via VM on macOS shows the same large base for @profile sqrt(rand(10, 10)) Screenshot 2024-08-12 at 2 49 30 PM