# nix: repl: segmentation fault

**URL:** https://discourse.nixosstag.fcio.net/t/nix-repl-segmentation-fault/4424
**Category:** Inbox
**Created:** [October 18, 2019, 3:38pm UTC](https://discourse.nixosstag.fcio.net/t/nix-repl-segmentation-fault/4424 "2019-10-18T15:38:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kl3](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/kl3/32/6527_2.png) [@kl3](https://discourse.nixosstag.fcio.net/u/kl3)
#### Post date: [October 18, 2019, 3:38pm UTC](https://discourse.nixosstag.fcio.net/t/nix-repl-segmentation-fault/4424/1 "2019-10-18T15:38:22Z")

</div>

Running -unstable in a single core VM with 2G RAM:

&nbsp;&nbsp;$ nixos-version  
&nbsp;&nbsp;20.03pre196836.1c40ee6fc44 (Markhor)  
&nbsp;&nbsp;$ grep MemTotal /proc/meminfo  
&nbsp;&nbsp;MemTotal: 2041736 kB

The following steps led to the crash immediately after boot in complete  
idle state:

&nbsp;&nbsp;# nix repl '\<nixpkgs\>'  
&nbsp;&nbsp;Welcome to Nix version 2.3.1. Type :? for help.

&nbsp;&nbsp;Loading '\<nixpkgs\>'...  
&nbsp;&nbsp;Added 10966 variables.

&nbsp;&nbsp;nix-repl\> :l \<nixpkgs/nixos\>  
&nbsp;&nbsp;Added 6 variables.

I then curiously looked through various variables by tab completing on  
`config.` and eventually printing the following variables in the exact  
order of listing; full output redacted for the sake of readability:

&nbsp;&nbsp;nix-repl\> config.boot.kernelModules  
&nbsp;&nbsp;nix-repl\> config  
&nbsp;&nbsp;nix-repl\> config.fileSystems  
&nbsp;&nbsp;nix-repl\> config.zramSwap  
&nbsp;&nbsp;nix-repl\> config.system  
&nbsp;&nbsp;nix-repl\> config.environemnt  
&nbsp;&nbsp;^C^P^C

&nbsp;&nbsp;^C

&nbsp;&nbsp;Segmentation fault (core dumped)

All variables were properly printed except the last one. Note how  
"environemnt" was mistyped. "^C^P^C\<Enter\>^C\<Enter\>" was typed  
literally as I noticed it hanging.

Backtrace:

#0 0x000000000049e37b in nix::EvalState::forceValue(nix::Value&, nix::Pos const&) ()  
#1 0x00007fa4ca0887b4 in nix::ExprVar::eval(nix::EvalState&, nix::Env&, nix::Value&) ()  
&nbsp;&nbsp;&nbsp;from /nix/store/cqzmhhibmhw5h92qwjd0ki4y4jhk0pl4-nix-2.3.1/lib/libnixexpr.so  
#2 0x00007fa4ca089f1e in nix::ExprSelect::eval(nix::EvalState&, nix::Env&, nix::Value&) ()  
&nbsp;&nbsp;&nbsp;from /nix/store/cqzmhhibmhw5h92qwjd0ki4y4jhk0pl4-nix-2.3.1/lib/libnixexpr.so  
#3 0x00000000004e4a1b in nix::NixRepl::evalString(std::\_\_cxx11::basic\_string\<char, std::char\_traits\<char\>, std::allocator\<char\> \>, nix::Value&) ()  
#4 0x00000000004e7760 in nix::NixRepl::processLine(std::\_\_cxx11::basic\_string\<char, std::char\_traits\<char\>, std::allocator\<char\> \>) ()  
#5 0x00000000004e7ce2 in nix::NixRepl::mainLoop(std::vector\<std::\_\_cxx11::basic\_string\<char, std::char\_traits\<char\>, std::allocator\<char\> \>, std::allocator\<std::\_\_cxx11::basic\_string\<char, std::char\_traits\<char\>, std::allocator\<char\> \> \> \> const&) ()  
#6 0x00000000004e965b in nix::CmdRepl::run(nix::ref\<nix::Store\>) ()  
#7 0x00000000004b7449 in nix::StoreCommand::run() ()  
#8 0x00000000004d57c8 in nix::mainWrapped(int, char\*\*) ()  
#9 0x00007fa4c9d8201c in nix::handleExceptions(std::\_\_cxx11::basic\_string\<char, std::char\_traits\<char\>, std::allocator\<char\> \> const&, std::function\<void ()\>)  
&nbsp;&nbsp;&nbsp;&nbsp;()  
&nbsp;&nbsp;&nbsp;from /nix/store/cqzmhhibmhw5h92qwjd0ki4y4jhk0pl4-nix-2.3.1/lib/libnixmain.so  
#10 0x0000000000441fab in main ()

I saved both executable and core dump for later inspection, feel free  
to ask for further details.

I cannot reproduce this issue.

---

<div class="post-metadata">

### Author: ![Ma27](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/ma27/32/6752_2.png) [@Ma27](https://discourse.nixosstag.fcio.net/u/Ma27)
#### Post date: [July 19, 2020, 5:41pm UTC](https://discourse.nixosstag.fcio.net/t/nix-repl-segmentation-fault/4424/2 "2020-07-19T17:41:23Z")

</div>

@kl3 I cannot help you with your actual issue, but I’d recommend to open an issue in [GitHub - NixOS/nix: Nix, the purely functional package manager](https://github.com/nixos/nix) to make sure that the issue gets actually noticed by the maintainers.

---

<div class="post-metadata">

### Author: ![monoidal](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/monoidal/32/8359_2.png) [@monoidal](https://discourse.nixosstag.fcio.net/u/monoidal)
#### Post date: [August 9, 2020, 7:22pm UTC](https://discourse.nixosstag.fcio.net/t/nix-repl-segmentation-fault/4424/3 "2020-08-09T19:22:42Z")

</div>

This is likely [segfault with nix repl · Issue #3175 · NixOS/nix · GitHub](https://github.com/NixOS/nix/issues/3175) which is fixed in 2.3.7.
