Skip to content

mold 2.39 segfault on darwin #407674

@simonzkl

Description

@simonzkl

Nixpkgs version

  • Unstable (25.05)

Steps to reproduce

Mold on darwin builds, but is not able to link linux objects. Mold is not supported for linking darwin objects, but it used to work fine for linking linux objects (when cross-compiling).

Previously discussed in:

Seems to be unique to nixpkgs as it reportedly works fine on homebrew.

Output from a lldb session:

(lldb) target create "/nix/store/zjn752vm9nf0dl4n7j8miqvsvg6mpsjj-mold-2.39.0/bin/mold"
Current executable set to '/nix/store/zjn752vm9nf0dl4n7j8miqvsvg6mpsjj-mold-2.39.0/bin/mold' (arm64).
(lldb) run --version
Process 50947 launched: '/nix/store/zjn752vm9nf0dl4n7j8miqvsvg6mpsjj-mold-2.39.0/bin/mold' (arm64)
mold 2.39.0 (compatible with GNU ld)
Process 50947 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x102fa04e4)
    frame #0: 0x0000000102fa04e4
error: memory read failed for 0x102fa0400
Target 0: (mold) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x102fa04e4)
  * frame #0: 0x0000000102fa04e4
    frame #1: 0x0000000102ed5330 libtbb.12.dylib`tbb::detail::r1::global_control_release() at global_control.cpp:157:9 [opt]
    frame #2: 0x0000000102ed6544 libtbb.12.dylib`tbb::detail::r1::__TBB_InitOnce::~__TBB_InitOnce() [inlined] tbb::detail::r1::__TBB_InitOnce::remove_ref() at main.cpp:90:9 [opt]
    frame #3: 0x0000000102ed6528 libtbb.12.dylib`tbb::detail::r1::__TBB_InitOnce::~__TBB_InitOnce() [inlined] tbb::detail::r1::__TBB_InitOnce::~__TBB_InitOnce(this=0x0000000102f08860) at main.h:79:9 [opt]
    frame #4: 0x0000000102ed6518 libtbb.12.dylib`tbb::detail::r1::__TBB_InitOnce::~__TBB_InitOnce(this=0x0000000102f08860) at main.h:77:23 [opt]
    frame #5: 0x00000001951042e8 libsystem_c.dylib`__cxa_finalize_ranges + 476
    frame #6: 0x0000000195104070 libsystem_c.dylib`exit + 44
    frame #7: 0x0000000100046cec mold`std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> mold::parse_nonpositional_args<mold::X86_64>(ctx=0x000000016fdfdc00) at cmdline.cc:0 [opt]
    frame #8: 0x00000001004f2d08 mold`int mold::mold_main<mold::X86_64>(argc=2, argv=0x000000016fdff220) at main.cc:283:40 [opt]
    frame #9: 0x0000000194ebe0e0 dyld`start + 2360
(lldb)

Can Hydra reproduce this build failure?

No, Hydra cannot reproduce this build failure.

Link to Hydra build job

No response

Relevant log output

N/A

Additional context

Package was disabled on darwin so Hydra currently cannot reproduce this.

System metadata

  • system: "aarch64-darwin"
  • host os: Darwin 24.4.0, macOS 15.4.1
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 2.28.3
  • nixpkgs: /nix/store/9axrw7zwqjmx17sghgndrbr8q00xi61z-source

Notify maintainers


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: cross-compilationBuilding packages on a different platform than they will be used on6.topic: darwinRunning or building packages on Darwin

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions