forked from lix-project/lix
jade
c897fba787
This happened during a PathSubstitutionGoal of a .drv file:
substitution of '/tmp/jade/nix-test/ca/eval-store/store/1lj7lsq5y0f25mfbnq6d3zd0bw5ay33n-dependencies-input-2.drv'
What happened here is that since PathSubstitutionGoal is not a
DerivationGoal, in production builds, the UB was not caught, since it
would early-exit from failing a dynamic_cast to DerivationGoal * on the
very next line, but before the null reference was ever used.
This was nonetheless UB. The fix should be to just rearrange the two
lines; I don't think there is a further bug there, since *substituting a
.drv* **necessarily** means you cannot have the representation of
the derivation as would be necessary for drv to not be null there.
Test failure:
++(eval-store.sh:12) _RR_TRACE_DIR=/home/jade/.local/share/rr rr record -- nix build -f dependencies.nix --eval-store /tmp/jade/nix-test/ca/eval-store/eval-store -o /tmp/jade/nix-test/ca/eval-store/result
don't know how to build these paths:
/tmp/jade/nix-test/ca/eval-store/store/6y51mf0p57ggipgab6hdjabbvplzsicq-dependencies-top.drv
copying 1 paths...
copying path '/tmp/jade/nix-test/ca/eval-store/store/8027afyvqb87y1sf5xhdkqsflqn1ziy8-dependencies.builder0.sh' to 'local'...
copying 1 paths...
copying path '/tmp/jade/nix-test/ca/eval-store/store/7r5pqyncvfgrryf9gzy1z56z3xigi61x-builder-dependencies-input-0.sh' to 'local'...
copying 1 paths...
copying path '/tmp/jade/nix-test/ca/eval-store/store/nhmgm87zlqy3ks96dxrn7l37b72azi99-builder-dependencies-input-1.sh' to 'local'...
copying 1 paths...
copying path '/tmp/jade/nix-test/ca/eval-store/store/nq4qa2j6y8ajqazlfq6h46ck637my1n6-builder-dependencies-input-2.sh' to 'local'...
copying 1 paths...
copying path '/tmp/jade/nix-test/ca/eval-store/store/6vh0vna9l5afck01y7iaks3hm9ikwqyj-builder-fod-input.sh' to 'local'...
building '/tmp/jade/nix-test/ca/eval-store/store/gy91pqymf2nc5v7ld1bad94xpwxdi25s-dependencies-input-0.drv'...
building '/tmp/jade/nix-test/ca/eval-store/store/w7wlkjx97ivmnrymkac5av3nyp94hzvq-dependencies-input-1.drv'...
../src/libstore/build/derivation-goal.cc:1556:22: runtime error: reference binding to null pointer of type 'Derivation'
0 0x734ba59a6886 in nix::DerivationGoal::waiteeDone(std::shared_ptr<nix::Goal>, nix::Goal::ExitCode) /home/jade/lix/lix2/build/src/libstore/build/derivation-goal.cc:1556:12
1 0x734ba59c0962 in nix::Goal::amDone(nix::Goal::ExitCode, std::optional<nix::Error>) /home/jade/lix/lix2/build/src/libstore/build/goal.cc:95:25
2 0x734ba5a1c44a in nix::PathSubstitutionGoal::done(nix::Goal::ExitCode, nix::BuildResult::Status, std::optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>) /home/jade/lix/lix2/build/src/libstore/build/substitution-goal.cc:38:5
3 0x734ba5a1b454 in nix::PathSubstitutionGoal::init() /home/jade/lix/lix2/build/src/libstore/build/substitution-goal.cc:56:9
4 0x734ba5a2a6c6 in nix::Worker::run(std::set<std::shared_ptr<nix::Goal>, nix::CompareGoalPtrs, std::allocator<std::shared_ptr<nix::Goal>>> const&) /home/jade/lix/lix2/build/src/libstore/build/worker.cc:320:23
5 0x734ba59b93d8 in nix::Store::buildPathsWithResults(std::vector<nix::DerivedPath, std::allocator<nix::DerivedPath>> const&, nix::BuildMode, std::shared_ptr<nix::Store>) /home/jade/lix/lix2/build/src/libstore/build/entry-points.cc:60:12
6 0x734ba663c107 in nix::Installable::build2(nix::ref<nix::Store>, nix::ref<nix::Store>, nix::Realise, std::vector<nix::ref<nix::Installable>, std::allocator<nix::ref<nix::Installable>>> const&, nix::BuildMode) /home/jade/lix/lix2/build/src/libcmd/installables.cc:637:36
Change-Id:
|
||
---|---|---|
.. | ||
build | ||
builtins | ||
linux | ||
platform | ||
binary-cache-store.cc | ||
binary-cache-store.hh | ||
build-result.cc | ||
build-result.hh | ||
builtins.hh | ||
ca-specific-schema.sql | ||
common-protocol-impl.hh | ||
common-protocol.cc | ||
common-protocol.hh | ||
content-address.cc | ||
content-address.hh | ||
crypto.cc | ||
crypto.hh | ||
daemon.cc | ||
daemon.hh | ||
derivations.cc | ||
derivations.hh | ||
derived-path-map.cc | ||
derived-path-map.hh | ||
derived-path.cc | ||
derived-path.hh | ||
downstream-placeholder.cc | ||
downstream-placeholder.hh | ||
dummy-store.cc | ||
dummy-store.md | ||
export-import.cc | ||
filetransfer.cc | ||
filetransfer.hh | ||
fs-accessor.hh | ||
gc-store.hh | ||
gc.cc | ||
globals.cc | ||
globals.hh | ||
http-binary-cache-store.cc | ||
http-binary-cache-store.md | ||
indirect-root-store.hh | ||
legacy-ssh-store.cc | ||
legacy-ssh-store.md | ||
length-prefixed-protocol-helper.hh | ||
lix-store.pc.in | ||
local-binary-cache-store.cc | ||
local-binary-cache-store.md | ||
local-fs-store.cc | ||
local-fs-store.hh | ||
local-store.cc | ||
local-store.hh | ||
local-store.md | ||
lock.cc | ||
lock.hh | ||
log-store.cc | ||
log-store.hh | ||
machines.cc | ||
machines.hh | ||
make-content-addressed.cc | ||
make-content-addressed.hh | ||
meson.build | ||
misc.cc | ||
names.cc | ||
names.hh | ||
nar-accessor.cc | ||
nar-accessor.hh | ||
nar-info-disk-cache.cc | ||
nar-info-disk-cache.hh | ||
nar-info.cc | ||
nar-info.hh | ||
optimise-store.cc | ||
outputs-spec.cc | ||
outputs-spec.hh | ||
parsed-derivations.cc | ||
parsed-derivations.hh | ||
path-info.cc | ||
path-info.hh | ||
path-references.cc | ||
path-references.hh | ||
path-regex.hh | ||
path-with-outputs.cc | ||
path-with-outputs.hh | ||
path.cc | ||
path.hh | ||
pathlocks.cc | ||
pathlocks.hh | ||
platform.cc | ||
profiles.cc | ||
profiles.hh | ||
realisation.cc | ||
realisation.hh | ||
remote-fs-accessor.cc | ||
remote-fs-accessor.hh | ||
remote-store-connection.hh | ||
remote-store.cc | ||
remote-store.hh | ||
s3-binary-cache-store.cc | ||
s3-binary-cache-store.hh | ||
s3-binary-cache-store.md | ||
s3.hh | ||
schema.sql | ||
serve-protocol-impl.hh | ||
serve-protocol.cc | ||
serve-protocol.hh | ||
sqlite.cc | ||
sqlite.hh | ||
ssh-store-config.hh | ||
ssh-store.cc | ||
ssh-store.md | ||
ssh.cc | ||
ssh.hh | ||
store-api.cc | ||
store-api.hh | ||
store-cast.hh | ||
uds-remote-store.cc | ||
uds-remote-store.hh | ||
uds-remote-store.md | ||
worker-protocol-impl.hh | ||
worker-protocol.cc | ||
worker-protocol.hh |