Seen on macOS 13, with the Xcode 15 linker
==============================
Test 'runnable/test17338.d' failed. The logged output:
/Users/runner/work/dmd/dmd/generated/osx/release/64/dmd -conf= -m64 -Irunnable -fPIC -od/Users/runner/work/dmd/dmd/compiler/test/test_results/runnable -of/Users/runner/work/dmd/dmd/compiler/test/test_results/runnable/test17338_0 runnable/test17338.d
0 0x108b95f43 __assert_rtn + 64
1 0x108b61e75 ld::AtomFileConsolidator::addAtomFile(ld::AtomFile const*, ld::AtomFile const*, bool) + 8997
2 0x108b6fa78 ld::AtomFileConsolidator::addAtomFile(ld::AtomFile const*) + 136
3 0x108b94287 ld::pass::stubs(ld::Options const&, ld::AtomFileConsolidator&) + 2039
4 0x108b79184 ld::AtomFileConsolidator::resolve() + 18564
5 0x108ae4db8 main + 12344
ld: Assertion failed: (slot < _sideTableBuffer.size()), function addAtom, file AtomFileConsolidator.cpp, line 2158.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: linker exited with status 1
==============================
This test involves instantiating 32767 templates.
```
size_t foo(size_t i, size_t mask)()
{
static if (i == 14)
return mask;
else
return foo!(i + 1, mask) + foo!(i + 1, mask | (1UL << i));
}
void main()
{
assert(foo!(0, 0) != 0);
}
```
Comment #1 by ibuclaw — 2024-02-24T01:16:26Z
(In reply to Iain Buclaw from comment #0)
> Seen on macOS 13, with the Xcode 15 linker
Specifically: Xcode 15.0.1
There has been a number of similar crashes with GCC too.
https://github.com/actions/runner-images/issues/9273https://forums.developer.apple.com/forums/thread/737707
Current status of that is Xcode fixed their linker in 15.1.
There is reasonable doubt that using the latest version of Xcode will fix this issue too, as the backtraces are subtly different.
Comment #2 by ibuclaw — 2024-02-24T01:51:34Z
Test passes on Xcode 15.1!
I don't see it being worth it looking any further into what and why 15.0 ICE's, as everything points to a genuine bug in that macOS linker.
Comment #3 by dlang-bot — 2024-02-24T01:54:51Z
@ibuclaw updated dlang/dmd pull request #16240 "[stable] GHA: Bump Xcode version to 15.1 for macOS-13 jobs" fixing this issue:
- Fix Bugzilla 24407 - OSX: ld: Assertion failed: (slot < _sideTableBuffer.size()), function addAtom
https://github.com/dlang/dmd/pull/16240
Comment #4 by dlang-bot — 2024-02-24T08:24:56Z
dlang/dmd pull request #16240 "[stable] GHA: Bump Xcode version to 15.1 for macOS-13 jobs" was merged into stable:
- 927f931df1b3cc16495f81cba1358e5e6c602586 by Iain Buclaw:
Fix Bugzilla 24407 - OSX: ld: Assertion failed: (slot < _sideTableBuffer.size()), function addAtom
https://github.com/dlang/dmd/pull/16240
Comment #5 by dlang-bot — 2024-03-01T23:57:03Z
dlang/dmd pull request #16276 "merge stable" was merged into master:
- 65db10cf920c3519553a2a499230c994d6db2f5c by Iain Buclaw:
Fix Bugzilla 24407 - OSX: ld: Assertion failed: (slot < _sideTableBuffer.size()), function addAtom
https://github.com/dlang/dmd/pull/16276