Repository navigation
Closed
Description
I finally got to valgrinding nix because of http://hydra.nixos.org/build/9629029. Would someone knowledgeable in nix internals look at it? CC @edolstra @shlevy
I only found the problem when running the timeout test, command /nix/store/ymgzxx2ng3ziv8ps3db2ylfnifyp37yf-nix-1.6.1/bin/nix-store --add-root ./result --indirect -r --option build-max-log-s ize 100 /tmp/nix-build-nix-1.6.1.drv-2/nix-1.6.1/tests/test-tmp/store/cdbjyhrsk1w8kfg3nbkn261dh15hcjw7-timeout.drv!out
The relevant parts seem to be:
==26137== Syscall param rt_sigaction(act->sa_mask) points to uninitialised byte(s)
==26137== at 0x5CEC4BE: __libc_sigaction (in /nix/store/94n64qy99ja0vgbkf675nyk39g9b978n-glibc-2.19/lib/libpthread-2.19.so)
==26137== by 0x50E14EC: nix::restoreSIGPIPE() (build.cc:417)
==26137== by 0x50EE623: nix::DerivationGoal::initChild() (build.cc:2248)
==26137== by 0x50EC421: nix::DerivationGoal::startBuilder() (build.cc:2062)
==26137== by 0x50E7223: nix::DerivationGoal::tryToBuild() (build.cc:1398)
==26137== by 0x50E46CE: nix::DerivationGoal::work() (build.cc:1008)
==26137== by 0x50F5EEA: nix::Worker::run(std::set<boost::shared_ptr<nix::Goal>, std::less<boost::shared_ptr<nix::Goal> >, std::allocator<boost
::shared_ptr<nix::Goal> > > const&) (build.cc:3142)
==26137== by 0x50F77B8: nix::LocalStore::buildPaths(std::set<std::string, std::less<std::string>, std::allocator<std::string> > const&, bool)
(build.cc:3329)
==26137== by 0x412A92: opRealise(std::list<std::string, std::allocator<std::string> >, std::list<std::string, std::allocator<std::string> >) (
nix-store.cc:137)
==26137== by 0x41A0E7: run(std::list<std::string, std::allocator<std::string> >) (nix-store.cc:921)
==26137== by 0x4E3C96F: nix::initAndRun(int, char**) (shared.cc:230)
==26137== by 0x4E3D078: main (shared.cc:284)
==26137== Address 0xffefedcb8 is on thread 1's stack
==26137==
==26133== Invalid write of size 8
==26133== at 0x50F6E19: nix::Worker::waitForInput() (build.cc:3267)
==26133== by 0x50F603A: nix::Worker::run(std::set<boost::shared_ptr<nix::Goal>, std::less<boost::shared_ptr<nix::Goal> >, std::allocator<boost::shared_ptr<nix::Goal> > > const&) (build.cc:3151)
==26133== by 0x50F77B8: nix::LocalStore::buildPaths(std::set<std::string, std::less<std::string>, std::allocator<std::string> > const&, bool) (build.cc:3329)
==26133== by 0x412A92: opRealise(std::list<std::string, std::allocator<std::string> >, std::list<std::string, std::allocator<std::string> >) (nix-store.cc:137)
==26133== by 0x41A0E7: run(std::list<std::string, std::allocator<std::string> >) (nix-store.cc:921)
==26133== by 0x4E3C96F: nix::initAndRun(int, char**) (shared.cc:230)
==26133== by 0x4E3D078: main (shared.cc:284)
==26133== Address 0x7a3dfe0 is 112 bytes inside a block of size 128 free'd
==26133== at 0x4C27951: operator delete(void*) (in /nix/store/4g2m964cc2rma46m5fc0x8bz2qaw2krn-valgrind-3.9.0/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==26133== by 0x51095E3: __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<int const, nix::Child> > >::deallocate(std::_Rb_tree_node<std::pair<int const, nix::Child> >*, unsigned long) (new_allocator.h:110)
==26133== by 0x5107AAD: std::_Rb_tree<int, std::pair<int const, nix::Child>, std::_Select1st<std::pair<int const, nix::Child> >, std::less<int>, std::allocator<std::pair<int const, nix::Child> > >::_M_put_node(std::_Rb_tree_node<std::pair<int const, nix::Child> >*) (stl_tree.h:374)
==26133== by 0x510549A: std::_Rb_tree<int, std::pair<int const, nix::Child>, std::_Select1st<std::pair<int const, nix::Child> >, std::less<int>, std::allocator<std::pair<int const, nix::Child> > >::_M_destroy_node(std::_Rb_tree_node<std::pair<int const, nix::Child> >*) (stl_tree.h:396)
==26133== by 0x5101FC0: std::_Rb_tree<int, std::pair<int const, nix::Child>, std::_Select1st<std::pair<int const, nix::Child> >, std::less<int>, std::allocator<std::pair<int const, nix::Child> > >::_M_erase(std::_Rb_tree_node<std::pair<int const, nix::Child> >*) (stl_tree.h:1127)
==26133== by 0x5109CF8: std::_Rb_tree<int, std::pair<int const, nix::Child>, std::_Select1st<std::pair<int const, nix::Child> >, std::less<int>, std::allocator<std::pair<int const, nix::Child> > >::clear() (stl_tree.h:860)
==26133== by 0x51089BF: std::_Rb_tree<int, std::pair<int const, nix::Child>, std::_Select1st<std::pair<int const, nix::Child> >, std::less<int>, std::allocator<std::pair<int const, nix::Child> > >::_M_erase_aux(std::_Rb_tree_const_iterator<std::pair<int const, nix::Child> >, std::_Rb_tree_const_iterator<std::pair<int const, nix::Child> >) (stl_tree.h:1757)
==26133== by 0x5105EF6: std::_Rb_tree<int, std::pair<int const, nix::Child>, std::_Select1st<std::pair<int const, nix::Child> >, std::less<int>, std::allocator<std::pair<int const, nix::Child> > >::erase(std::_Rb_tree_iterator<std::pair<int const, nix::Child> >, std::_Rb_tree_iterator<std::pair<int const, nix::Child> >) (stl_tree.h:848)
==26133== by 0x51027F9: std::_Rb_tree<int, std::pair<int const, nix::Child>, std::_Select1st<std::pair<int const, nix::Child> >, std::less<int>, std::allocator<std::pair<int const, nix::Child> > >::erase(int const&) (stl_tree.h:1771)
==26133== by 0x50FFB10: std::map<int, nix::Child, std::less<int>, std::allocator<std::pair<int const, nix::Child> > >::erase(int const&) (stl_map.h:727)
==26133== by 0x50F5897: nix::Worker::childTerminated(int, bool) (build.cc:3086)
==26133== by 0x50E44BC: nix::DerivationGoal::killChild() (build.cc:971)
Metadata
Metadata
Assignees
Labels
No labels
Activity
restoreSIGPIPE(): Fill in sa_mask
vcunat commentedon Mar 29, 2014
Nice, can some Hydra admin extend the jobset to full build? I think it can be merged, as this was the only blocker IMO. http://hydra.nixos.org/jobset/nixpkgs/vcunat-stdenv
edolstra commentedon Mar 29, 2014
Done.
edolstra commentedon Mar 29, 2014
Note btw that I said "probably fixes" in my commit message, but GitHub doesn't parse "probably" :-)
vcunat commentedon Mar 30, 2014
I planned to re-run the valgrind tests again anyway, probably today.
vcunat commentedon Mar 31, 2014
I verified that valgrind warnings are gone for the timeout test (on 034b6f6; except for GC-related ones, but I ignore those). Also I tried a full nix build 16-times and I got no segfault (same branch as was failing on Hydra, except for updated nix).
Merge pull request NixOS#231 from nix-dot-dev/dependabot/pip/black-22…
meson: correctly set NIX_CONF_DIR to $sysconfdir/nix
Merge pull request NixOS#231 from kolloch/dependabot/cargo/sample_pro…
Merge pull request NixOS#231 from DeterminateSystems/fix-parallel-crash
doc/inventory: Batch D — file new catalog candidates NixOS#227-NixOS#233
nix-env: use getArg in opInstall --priority parser
doc/inventory: scope candidate bodies to post-Batch-G review verdicts
doc/inventory: STATUS — record batch H (six candidates, four shards)
doc/inventory: post-review fixes — Branch lines + speculative-API tra…
doc/inventory: 2026-05 adversarial audit — corrections, NixOS#241-Nix…
nix-env: fix --priority regression by using needArg, not getArg
nix-env: use needArg in opInstall --priority parser