osx bash 命令给出分段错误:11
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41084393/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
osx bash command gives Segmentation fault: 11
提问by Gao Bill
when i open a new terminal window in OS X and just type bash, i got a segmentation fault:11 all the time. The problem seems to be specific to my machine as i have tried it on another machine and it worked fine. bash gives out segfault 11
当我在 OS X 中打开一个新的终端窗口并输入 bash 时,我总是遇到分段错误:11。这个问题似乎是我的机器特有的,因为我已经在另一台机器上尝试过它并且工作正常。 bash 给出段错误 11
回答by chepner
You had infinite recursion. When bash
started, it executed .bashrc
, which sources .bashrc
, which sources .bashrc
, etc. Eventually, you run out of memory somewhere, because bash
has to remember where in the previous iteration of .bashrc
it is so it can continue after the next one returns, which leads to the segmentation fault.
你有无限递归。当bash
启动时,它执行.bashrc
,其源.bashrc
,源是.bashrc
等最后,你记忆的地方跑出来,因为bash
必须记住其中的前一次迭代.bashrc
就这样它可以在下一个返回后继续,这导致了分割过错。