libblake3: use older tbb version on macOS#393048
Conversation
|
I'm okay with this change if it's necessary although if so maybe it would be better to just use the older version universally. However, I'd like to understand why We tested with this version upstream on macOS in the BLAKE3 repo on CI (since homebrew uses 2022) and it seemed to work fine there. |
|
@Mic92 Can you tell me how to reproduce this? What commands are you running?
EDIT: The issue I mentioned was unrelated; now resolved. |
|
@Mic92 I can't seem to reproduce this on my system, running on macOS What I tried is adding tbb_2022_0 = pkgs.tbb_2021_11.overrideAttrs (attrs: rec {
version = "2022.0.0";
src = pkgs.fetchFromGitHub {
owner = "oneapi-src";
repo = "oneTBB";
tag = "v${version}";
hash = "sha256-XOlC1+rf65oEGKDba9N561NuFo1YJhn3Q1CTGtvkn7A=";
};
});Then compiling This doesn't give me any errors or crashes. So I'm not sure what is causing the problem you are seeing. |
|
It is very reproducible when switching nixpkgs in the nix flake. It breaks the test suite: $ uname
Darwin evo 24.1.0 Darwin Kernel Version 24.1.0: Thu Oct 10 21:02:26 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T8122 arm64 arm Darwin
$ commit 866e193fbcd284a2385352a03dc57b040c762fb0
Author: Jörg Thalheim <[email protected]>
Date: Wed Mar 26 08:25:39 2025 +0100
switch to nixpkgs master
diff --git flake.lock flake.lock
index ce484a67a..377d7e88b 100644
--- flake.lock
+++ flake.lock
@@ -63,16 +63,16 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1734359947,
- "narHash": "sha256-1Noao/H+N8nFB4Beoy8fgwrcOQLVm9o4zKW1ODaqK9E=",
+ "lastModified": 1742972947,
+ "narHash": "sha256-o4PBZUmfxqxc1OzyWY/N4ftJgD5WhHPbKlBNwtP3P6g=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "48d12d5e70ee91fe8481378e540433a7303dbf6a",
+ "rev": "c019b5d0a53e2f1bcefdb4a631b997ca2adb8200",
"type": "github"
},
"original": {
"owner": "NixOS",
- "ref": "release-24.11",
+ "ref": "master",
"repo": "nixpkgs",
"type": "github"
}
diff --git flake.nix flake.nix
index 094df9776..d8bf23936 100644
--- flake.nix
+++ flake.nix
@@ -1,7 +1,7 @@
{
description = "The purely functional package manager";
- inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-24.11";
+ inputs.nixpkgs.url = "github:NixOS/nixpkgs/master";
inputs.nixpkgs-regression.url = "github:NixOS/nixpkgs/215d4d0fd80ca5163643b03a33fde804a29cc1e2";
inputs.nixpkgs-23-11.url = "github:NixOS/nixpkgs/a62e6edd6d5e1fa0329b8653c801147986f8d446";
$ nix build github:Mic92/nix-1/test-unstable
error: builder for '/nix/store/5jzhlzvcz53ivyckg4zi1a3r8g4y74z7-nix-util-tests-run.drv' failed with exit code 139;
last 25 log lines:
>
> [----------] 7 tests from LevenshteinDistance/LevenshteinDistanceTest
> [ RUN ] LevenshteinDistance/LevenshteinDistanceTest.CorrectlyComputed/0
> [ OK ] LevenshteinDistance/LevenshteinDistanceTest.CorrectlyComputed/0 (0 ms)
> [ RUN ] LevenshteinDistance/LevenshteinDistanceTest.CorrectlyComputed/1
> [ OK ] LevenshteinDistance/LevenshteinDistanceTest.CorrectlyComputed/1 (0 ms)
> [ RUN ] LevenshteinDistance/LevenshteinDistanceTest.CorrectlyComputed/2
> [ OK ] LevenshteinDistance/LevenshteinDistanceTest.CorrectlyComputed/2 (0 ms)
> [ RUN ] LevenshteinDistance/LevenshteinDistanceTest.CorrectlyComputed/3
> [ OK ] LevenshteinDistance/LevenshteinDistanceTest.CorrectlyComputed/3 (0 ms)
> [ RUN ] LevenshteinDistance/LevenshteinDistanceTest.CorrectlyComputed/4
> [ OK ] LevenshteinDistance/LevenshteinDistanceTest.CorrectlyComputed/4 (0 ms)
> [ RUN ] LevenshteinDistance/LevenshteinDistanceTest.CorrectlyComputed/5
> [ OK ] LevenshteinDistance/LevenshteinDistanceTest.CorrectlyComputed/5 (0 ms)
> [ RUN ] LevenshteinDistance/LevenshteinDistanceTest.CorrectlyComputed/6
> [ OK ] LevenshteinDistance/LevenshteinDistanceTest.CorrectlyComputed/6 (0 ms)
> [----------] 7 tests from LevenshteinDistance/LevenshteinDistanceTest (0 ms total)
>
> [----------] Global test environment tear-down
> [==========] 351 tests from 76 test suites ran. (61 ms total)
> [ PASSED ] 351 tests.
>
> YOU HAVE 1 DISABLED TEST
>
> /private/tmp/nix-build-nix-util-tests-run.drv-0/.attr-0l2nkwhif96f51f4amnlf414lhl4rv9vh8iffyp431v6s28gsr90: line 2: 45373 Segmentation fault: 11 /nix/store/a49zhkfkvmy6wqdxnchr8wnc1hqnw2sd-exec/bin/exec /nix/store/382danbkwfh584vy6000ym88w8pnjsii-nix-util-tests-2.28.0pre/bin/nix-util-tests
For full logs, run:
nix log /nix/store/5jzhlzvcz53ivyckg4zi1a3r8g4y74z7-nix-util-tests-run.drv
error: 1 dependencies of derivation '/nix/store/55bpiab3q86ns78w1imr9djnszr8ibnb-nix-2.28.0pre20250326_866e193.drv' failed to build
|
Thanks for the additional info. I will try to reproduce this locally. Can you confirm that if you only create the override for I suspect what is happening is not due to an issue with In this comment you mention this detail:
Can you elaborate on the part about there being two versions of tbb? If in fact there are multiple versions of tbb (or even maybe multiple separate copies of the same version) being linked somewhere along the way for That could lead to multiple separate tbb schedulers involved during execution with unexpected results. The solution may be to statically link tbb: uxlfoundation/oneTBB#297 I believe this should be possible by setting Can you give that a try and see if makes a difference? The downside to statically linking |
Do you mean on top of your open pull request (NixOS/nix#12676)? if I applied to my unstable-nixpkgs branch, it has no effect. I also tried your pull request with the same result.
Yes. If I apply this commit here, even is fixed again.
I am not so sure, but I saw the old tbb version at some point in the stack trace. Haven't checked yet where it's injected.
|
Oops, you are right. I forgot to add the override to the I made that change and now you can test with Once I do that, I get segfaults like you reported. So it a problem with the I investigated further and went back and compiled the examples from the BLAKE3 repo with this configuration: cmake --fresh -S c -B c/build -DBLAKE3_USE_TBB=1 -DBLAKE3_EXAMPLES=1 -DCMAKE_INSTALL_PREFIX=c/build/install -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_VERBOSE_MAKEFILE=1I found that if I had my environment set up to use If I installed That indicates there is something wrong with the nixpkgs It may have something to do with the custom patches being applied but I haven't had a chance to test further. I don't know how easy it will be to figure out what is wrong there so I'm fine with seeing this merged until a proper solution can be found. But I think it might be better to switch to |
This crashes on macOS.
For consistency, use the same version on all platforms.
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: nix [69105]
Path: /Users/USER/*/nix
Identifier: nix
Version: ???
Code Type: ARM-64 (Native)
Parent Process: Exited process [69036]
Responsible: ghostty [609]
User ID: 501
Date/Time: 2025-03-24 10:28:36.3531 +0100
OS Version: macOS 15.1.1 (24B91)
Report Version: 12
Anonymous UUID: 43196E0E-30B7-6E8A-68F3-0C573FEA61E3
Sleep/Wake UUID: C4FFF3A0-095A-4AE0-935B-60B5E7DE7522
Time Awake Since Boot: 130000 seconds
Time Since Wake: 78381 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000000010d7d3ff4
Exception Codes: 0x0000000000000001, 0x000000010d7d3ff4
Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [69105]
VM Region Info: 0x10d7d3ff4 is not in any region. Bytes after previous region: 49141 Bytes before following region: 196620
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
__LINKEDIT 10d7c0000-10d7c8000 [ 32K] r--/rwx SM=COW /Volumes/VOLUME/*/liblowdown.1.dylib
---> GAP OF 0x3c000 BYTES
VM_ALLOCATE 10d804000-10d854000 [ 320K] rw-/rwx SM=PRV
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 ??? 0x10d7d3ff4 ???
1 libtbb.12.14.dylib 0x106abd4f8 tbb::detail::r1::__TBB_InitOnce::~__TBB_InitOnce() + 60
2 libsystem_c.dylib 0x1939f2998 __cxa_finalize_ranges + 476
3 libsystem_c.dylib 0x1939f275c exit + 44
4 libdyld.dylib 0x193b5a94c dyld4::LibSystemHelpers::exit(int) const + 20
5 dyld 0x1937b42c8 start + 2924
Thread 1:
0 libsystem_pthread.dylib 0x193b320e8 start_wqthread + 0
Thread 2:
0 libsystem_pthread.dylib 0x193b320e8 start_wqthread + 0
Thread 3:
0 libsystem_kernel.dylib 0x193b01840 __sigwait + 8
1 libsystem_pthread.dylib 0x193b37a9c sigwait + 40
2 libnixutil.dylib 0x106fae034 nix::signalHandlerThread(unsigned int) + 36 (signals.cc:62)
3 libnixutil.dylib 0x106fb0730 decltype(std::declval<void (*)(unsigned int)>()(std::declval<unsigned int>())) std::__1::__invoke[abi:fe190107]<void (*)(unsigned int), unsigned int>(void (*&&)(unsigned int), unsigned int&&) + 40 (invoke.h:149)
4 libnixutil.dylib 0x106fb06f4 void std::__1::__thread_execute[abi:fe190107]<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(unsigned int), unsigned int, 2ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(unsigned int), unsigned int>&, std::__1::__tuple_indices<2ul>) + 48 (thread.h:192)
5 libnixutil.dylib 0x106fb0340 void* std::__1::__thread_proxy[abi:fe190107]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, void (*)(unsigned int), unsigned int>>(void*) + 100 (thread.h:201)
6 libsystem_pthread.dylib 0x193b372e4 _pthread_start + 136
7 libsystem_pthread.dylib 0x193b320fc thread_start + 8
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x000000010dc8bf80 x1: 0x000000010d7d3ff4 x2: 0x0000000000000103 x3: 0x00000001f9b12978
x4: 0x0000000000000000 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x0000000000000000
x8: 0x0000000000000000 x9: 0x0000000000000000 x10: 0x000000016b68dc40 x11: 0x000000016b68ded0
x12: 0x0000000000000000 x13: 0x0000000000018000 x14: 0x0000000000004af0 x15: 0x00000001111477df
x16: 0x0000000193b693b4 x17: 0x0000000200eaa590 x18: 0x0000000000000000 x19: 0x0000000106af0838
x20: 0x0000000106af0388 x21: 0x0000000000000002 x22: 0x0000000106158030 x23: 0x0000000000000000
x24: 0x0000000000000008 x25: 0x00000001f8c54000 x26: 0x0000000000000004 x27: 0x0000000000000003
x28: 0x0000000000000003 fp: 0x000000016b68f7a0 lr: 0x0000000106abc110
sp: 0x000000016b68f790 pc: 0x000000010d7d3ff4 cpsr: 0x60001000
far: 0x000000010d7d3ff4 esr: 0x82000007 (Instruction Abort) Translation fault
|
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release-24.11
git worktree add -d .worktree/backport-393048-to-release-24.11 origin/release-24.11
cd .worktree/backport-393048-to-release-24.11
git switch --create backport-393048-to-release-24.11
git cherry-pick -x ee0fc3559eef448209dc7de4ec7344f7524bf98e |
|
Backport: #393691 |
Translated Report (Full Report Below)
Process: nix [69105]
Path: /Users/USER/*/nix
Identifier: nix
Version: ???
Code Type: ARM-64 (Native)
Parent Process: Exited process [69036]
Responsible: ghostty [609]
User ID: 501
Date/Time: 2025-03-24 10:28:36.3531 +0100
OS Version: macOS 15.1.1 (24B91)
Report Version: 12
Anonymous UUID: 43196E0E-30B7-6E8A-68F3-0C573FEA61E3
Sleep/Wake UUID: C4FFF3A0-095A-4AE0-935B-60B5E7DE7522
Time Awake Since Boot: 130000 seconds
Time Since Wake: 78381 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000000010d7d3ff4
Exception Codes: 0x0000000000000001, 0x000000010d7d3ff4
Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process: exc handler [69105]
VM Region Info: 0x10d7d3ff4 is not in any region. Bytes after previous region: 49141 Bytes before following region: 196620
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
__LINKEDIT 10d7c0000-10d7c8000 [ 32K] r--/rwx SM=COW /Volumes/VOLUME/*/liblowdown.1.dylib
---> GAP OF 0x3c000 BYTES
VM_ALLOCATE 10d804000-10d854000 [ 320K] rw-/rwx SM=PRV
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 ??? 0x10d7d3ff4 ???
1 libtbb.12.14.dylib 0x106abd4f8 tbb::detail::r1::__TBB_InitOnce::~__TBB_InitOnce() + 60
2 libsystem_c.dylib 0x1939f2998 __cxa_finalize_ranges + 476
3 libsystem_c.dylib 0x1939f275c exit + 44
4 libdyld.dylib 0x193b5a94c dyld4::LibSystemHelpers::exit(int) const + 20
5 dyld 0x1937b42c8 start + 2924
Thread 1:
0 libsystem_pthread.dylib 0x193b320e8 start_wqthread + 0
Thread 2:
0 libsystem_pthread.dylib 0x193b320e8 start_wqthread + 0
Thread 3:
0 libsystem_kernel.dylib 0x193b01840 __sigwait + 8
1 libsystem_pthread.dylib 0x193b37a9c sigwait + 40
2 libnixutil.dylib 0x106fae034 nix::signalHandlerThread(unsigned int) + 36 (signals.cc:62)
3 libnixutil.dylib 0x106fb0730 decltype(std::declval<void ()(unsigned int)>()(std::declval())) std::__1::__invoke[abi:fe190107]<void ()(unsigned int), unsigned int>(void (&&)(unsigned int), unsigned int&&) + 40 (invoke.h:149)
4 libnixutil.dylib 0x106fb06f4 void std::__1::__thread_execute[abi:fe190107]<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct>, void ()(unsigned int), unsigned int, 2ul>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct>, void ()(unsigned int), unsigned int>&, std::__1::__tuple_indices<2ul>) + 48 (thread.h:192)
5 libnixutil.dylib 0x106fb0340 void std::__1::__thread_proxy[abi:fe190107]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct>, void ()(unsigned int), unsigned int>>(void) + 100 (thread.h:201)
6 libsystem_pthread.dylib 0x193b372e4 _pthread_start + 136
7 libsystem_pthread.dylib 0x193b320fc thread_start + 8
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x000000010dc8bf80 x1: 0x000000010d7d3ff4 x2: 0x0000000000000103 x3: 0x00000001f9b12978
x4: 0x0000000000000000 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x0000000000000000
x8: 0x0000000000000000 x9: 0x0000000000000000 x10: 0x000000016b68dc40 x11: 0x000000016b68ded0
x12: 0x0000000000000000 x13: 0x0000000000018000 x14: 0x0000000000004af0 x15: 0x00000001111477df
x16: 0x0000000193b693b4 x17: 0x0000000200eaa590 x18: 0x0000000000000000 x19: 0x0000000106af0838
x20: 0x0000000106af0388 x21: 0x0000000000000002 x22: 0x0000000106158030 x23: 0x0000000000000000
x24: 0x0000000000000008 x25: 0x00000001f8c54000 x26: 0x0000000000000004 x27: 0x0000000000000003
x28: 0x0000000000000003 fp: 0x000000016b68f7a0 lr: 0x0000000106abc110
sp: 0x000000016b68f790 pc: 0x000000010d7d3ff4 cpsr: 0x60001000
far: 0x000000010d7d3ff4 esr: 0x82000007 (Instruction Abort) Translation fault
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.