-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crash when evaluating module #2718
Comments
same crash happens with master 5886bc5. I wanted to investigate deeper and followed the hacking section https://nixos.org/nix/manual/#chap-hacking yet:
then I tried to run the inst/bin/nix-shell and got |
Here is a full backtrace, I hope that's helpful.
|
On Tue, 12 Mar 2019 23:28:12 -0700, Matthieu Coudron ***@***.***> wrote:
Here is a full backtrace, I hope that's helpful.
```
#0 0x00000000004361c8 in boost::io::basic_altstringbuf<char, std::char_traits<char>, std::allocator<char> >::overflow(int) ()
#1 0x00007ffff68850f9 in std::basic_streambuf<char, std::char_traits<char> >::xsputn(char const*, long) ()
from /nix/store/qh3pn6d1a6m31kb385pzi7vagwcbwayq-gcc-7.3.0-lib/lib/libstdc++.so.6
#2 0x00007ffff6875824 in std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long) ()
from /nix/store/qh3pn6d1a6m31kb385pzi7vagwcbwayq-gcc-7.3.0-lib/lib/libstdc++.so.6
#3 0x00007ffff76b753a in nix::printValue(std::ostream&, std::set<nix::Value const*, std::less<nix::Value const*>, std::allocator<nix::Value const*> >&, nix::Value const&) () from /nix/store/j40zb6apb6pl2n1imrpxikr1g221p448-nix-2.3pre6645_5886bc5/lib/libnixexpr.so
Maybe the `std::set` needs to be using one of the bdwgc allocators
instead of `std::allocator` to avoid badness?
(`gc_allocator<Value const*>` or `traceable_allocator<Value const*>`,
not sure but I'd guess the latter if at all)
…-----
Unfortunately I can't reproduce the problem, mostly because the linked
expressions (and mptcpanalyzer's shell.nix) seem to require use of
an overlay to provide the actual expression for mptcpanalyzer--
everything else just takes it for granted that the base exists
and extends it one way or another :D.
If you're able to distill the triggering expressions a bit
that might be helpful, but even if not maybe a pointer to
how one might invoke the problematic evaluation?
------
The stacktrace points to crashing while evaluating some
`builtins.trace`, which I've noted in your tree might be called
as part of a warning system -- does that sound correct?
Any chance you're dumping some insanely large tree of expressions
into `builtins.trace` or something?
Just a thought.
Not that trace should crash regardless :).
|
when I noticed trace was involved, I disabled the call in
and it stopped crashing. There should have been 8 packages , 15 at most. |
it happened again also because of a |
I can reproduce this issue on https://github.com/jtojnar/nixpkgs/tree/nix-segfault with following versions: $ nix run -f . nixStable -c nix-build --version
nix-build (Nix) 2.3.4
$ nix-build --version
nix-build (Nix) 2.4pre7346_5e7ccdc9 when building the NixOS manual using Stable Nix shows the same traceback as OP: #0 0x000000000044c127 in boost::io::basic_altstringbuf<char, std::char_traits<char>, std::allocator<char> >::overflow(int) ()
No symbol table info available.
Backtrace stopped: Cannot access memory at address 0x7ffd07c6d308 with unstable, it changes slightly: #0 0x00000000004554f7 in std::basic_streambuf<char, std::char_traits<char> >::sputc (__c=116 't',
this=0x7fffe62924c8)
at /nix/store/yrm128w6m29dcq2yg1rlgyq037vjnv0p-gcc-9.3.0/include/c++/9.3.0/streambuf:431
#1 boost::io::basic_altstringbuf<char, std::char_traits<char>, std::allocator<char> >::overflow (
this=0x7fffe62924c8, meta=116) at include/boost/format/alt_sstream_impl.hpp:290
Backtrace stopped: Cannot access memory at address 0x7fffe62906b8 |
I am still seeing this on current master.
I'm encountering this after adding a trace on purpose, so removing the trace statement isn't a workaround. I was trying to trace-print a derivation. As a workaround, I was able to trace-print the .drvPath attribute of the derivation instead. |
I can also confirm this on both Nix unstable ( A minimal example to reproduce looks like this:
My The error looks like this on both unstable and stable:
The culprit seems to be:
CCing @edolstra & @infinisil who may have an idea how to investigate this further or how to fix this :) |
I marked this as stale due to inactivity. → More info |
@Ma27 I just tried reproducing this with your example and could not (but I do get an evaluation error). |
I am trying to write some module that generates a (neo)vim config based on buildInputs (will create a proper python3Env etc).
The crash happens when running this nix-shell :
https://github.com/teto/mptcpanalyzer/blob/fda8ffb12976c3de31f537386b02eb9ded09ca9d/contrib/shell.nix
with this nixpkgs (nixos-unstable plus my WIP patches):
teto/nixpkgs@a3b1357
When I try to test it, nix crashes:
nix (Nix) 2.2
I fear the backtrace might not be very helpful as is but I don't hae yet a good workflow on nixpkgs for gdb (any hint/tip appreciated):
The text was updated successfully, but these errors were encountered: