I try to build something that requires a file in the binary cache. It crashes bad, in a way that the program returns 0 so it's undetected by scripts.
In gdb the backtrace at crash point is useless (with set cygwin-exceptions on).
#0 _sigfe () at sigfe.s:31
#1 0x00000001800d9a10 in lfind () from /usr/bin/cygwin1.dll
Backtrace stopped: Cannot access memory at address 0x0
(gdb) info symbol 0x00000001800d9a10
malloc in section .text of /usr/bin/cygwin1.dll
The crash seems realiably to happen in a lstat() call in the thread lambda https://github.com/NixOS/nix/blob/2.3.9/src/libstore/build.cc#L4093
It's "deletePath()" that calls lstat(). It's the first lstat() outside the the main thread - in case it's a cygwin problem. But I tried to reproduce that in a program apart (call lstat from another thread) and all worked fine.
It could be that the code is simply racy and the race goes bad under cygwin. I checked that the 'this' SubstitutionGoal is not destructed before the crash; that part should be fine. SubstitutionGoal::finished() is not called either.
#0 lstat64 (
name=0x800e2e9e8 "/nix/store/k44n5wvjwvnpam0yv5zshqiqxjzdz0il-boost_1_66_0.tar.bz2",
buf=0xff7fbf00)
at /ext/build/mknetrel/src/cygwin-snapshot-20201207-1/winsup/cygwin/syscalls.cc:2121
#1 0x00000001801305bb in _sigfe () at sigfe.s:35
#2 0x00000005eb843112 in nix::_deletePath (path=...,
bytesFreed=@0xff7fc4f8: 0) at src/libutil/util.cc:394
#3 0x00000005eb843607 in nix::deletePath (path=..., bytesFreed=@0xff7fc4f8: 0)
at src/libutil/util.cc:432
#4 0x00000005eb8435d5 in nix::deletePath (path=...) at src/libutil/util.cc:424
#5 0x000000051522beab in nix::LocalStore::addToStore (this=0x80008b7e0,
info=..., source=..., repair=nix::NoRepair, checkSigs=nix::CheckSigs,
accessor=...) at src/libstore/local-store.cc:1008
#6 0x00000005152577a7 in nix::copyStorePath (srcStore=..., dstStore=...,
storePath=..., repair=nix::NoRepair, checkSigs=nix::CheckSigs)
at src/libstore/store-api.cc:645
#7 0x00000005151f0e85 in operator() (__closure=0x800e22358)
at src/libstore/build.cc:4093
nix 2.0.4 works fine.
I try to build something that requires a file in the binary cache. It crashes bad, in a way that the program returns 0 so it's undetected by scripts.
In gdb the backtrace at crash point is useless (with set cygwin-exceptions on).
The crash seems realiably to happen in a lstat() call in the thread lambda https://github.com/NixOS/nix/blob/2.3.9/src/libstore/build.cc#L4093
It's "deletePath()" that calls lstat(). It's the first lstat() outside the the main thread - in case it's a cygwin problem. But I tried to reproduce that in a program apart (call lstat from another thread) and all worked fine.
It could be that the code is simply racy and the race goes bad under cygwin. I checked that the 'this' SubstitutionGoal is not destructed before the crash; that part should be fine. SubstitutionGoal::finished() is not called either.
nix 2.0.4 works fine.