Comments (8)
A segfault in the evaluator is usually due to an infinite recursion in the Nix expression. GDB says:
#0 0x00007ffff7976505 in nix::ExprOpConcatLists::eval(nix::EvalState&, nix::Env&, nix::Value&) ()
from /nix/store/9n6swhw1qr71f8xls4i4dzfbmnachgv3-nix-1.1pre2718_8da6772/lib/nix/libexpr.so.0
#1 0x00007ffff797e47d in nix::EvalState::forceValue(nix::Value&) () from /nix/store/9n6swhw1qr71f8xls4i4dzfbmnachgv3-nix-1.1pre2718_8da6772/lib/nix/libexpr.so.0
#2 0x00007ffff7976482 in nix::ExprVar::eval(nix::EvalState&, nix::Env&, nix::Value&) () from /nix/store/9n6swhw1qr71f8xls4i4dzfbmnachgv3-nix-1.1pre2718_8da6772/lib/nix/libexpr.so.0
#3 0x00007ffff7976523 in nix::ExprOpConcatLists::eval(nix::EvalState&, nix::Env&, nix::Value&) ()
from /nix/store/9n6swhw1qr71f8xls4i4dzfbmnachgv3-nix-1.1pre2718_8da6772/lib/nix/libexpr.so.0
#4 0x00007ffff797e47d in nix::EvalState::forceValue(nix::Value&) () from /nix/store/9n6swhw1qr71f8xls4i4dzfbmnachgv3-nix-1.1pre2718_8da6772/lib/nix/libexpr.so.0
#5 0x00007ffff7976482 in nix::ExprVar::eval(nix::EvalState&, nix::Env&, nix::Value&) () from /nix/store/9n6swhw1qr71f8xls4i4dzfbmnachgv3-nix-1.1pre2718_8da6772/lib/nix/libexpr.so.0
#6 0x00007ffff7976523 in nix::ExprOpConcatLists::eval(nix::EvalState&, nix::Env&, nix::Value&) ()
from /nix/store/9n6swhw1qr71f8xls4i4dzfbmnachgv3-nix-1.1pre2718_8da6772/lib/nix/libexpr.so.0
...
repeated a few thousand times.
from nix.
I've tested a bit, and I think it's not a bug in ghcWithPackages
, but rather an actual problem in Nix. I've tried to add dependencies of hledgerWeb
to the list instead of hledgerWeb
itself, and it turns out that if I add both yesod
and yesodDefault
to the list, I get a segfault, but if I choose only one of the two, I don't.
from nix.
It seems I can "fix" this by changing the definition of the library function closePropagation
which is used by ghcWithPackages
, so that it produces smaller intermediate lists while running. However, I think that only qualifies as a workaround. Nix shouldn't just segfault if something gets too large.
from nix.
How do we proceed with this issue? Would it be possible to commit the fix to closePropagation
as a quick work around?
from nix.
@kosmikus, can you commit your fix? In general Nix expressions shouldn't recurse too deeply because the C stack is not infinite (well, not until we can use GCC's -fsplit-stack). The crashNix expression goes over 80000 levels deep.
It would be nice to give a better error message than "signal 11", but there is no portable way to detect a stack overflow.
from nix.
I had hesitated committing the fix because these are central library functions which may affect other things, and I haven't checked if my new version returns all results in the same order. But yes, I can try to do it.
from nix.
Committed as NixOS/nixpkgs@3fbd694.
from nix.
The crashes in ghcWithPackages
are now gone.
from nix.
Related Issues (20)
- unable to create build users HOT 1
- tailscale ssh auth prompt blocks distributed builds because stdout is captured
- `nix log --last`
- `fetchTree`/`github:`: add `merge` argument HOT 6
- Lazy, async instantiation and fetching (tracking)
- Cross-builds failing on "struct statvfs"
- Build failure on x86_64-darwin due to aws-sdk-cpp dependency HOT 1
- `nix path-info --derivation <path>` gives different deriver than `nix path-info <path> --json | jq .[].deriver`
- Failed to reinstall on macOS 15.0 HOT 1
- Cannot lock unlocked input HOT 1
- cli: Match multiple --out-link for multiple installables
- daemon socket not found HOT 3
- Conflict: /etc/bashrc already exists as a symlink from a previous nix install HOT 1
- nix 2.23.3 run cache performance regression HOT 1
- Progress bar says `N copied (M failed)` but no details HOT 2
- Show the references of a failing build when `disallowedReferences` are referenced
- nix develop quite slow on macOS 15.0 HOT 2
- Bash autocompletion mangles flake references with queries
- showOption giving incorrect location for modules brought in via Flakes HOT 4
- Allow sandboxing development shells HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nix.