【问题标题】:/bin/bash giving a segmentation fault upon startup/bin/bash 在启动时给出分段错误
【发布时间】:2012-03-30 18:55:26
【问题描述】:

当我尝试通过 SSH 连接到远程服务器(运行 RHEL 4.4.5-6)时,我遇到了来自 bash 的分段错误。提供我的凭据后,SSH 客户端返回“上次登录:...”信息,然后挂起。

出于好奇,我按下了 Ctrl-C 并能够进入 bash 提示符。但是,这不是我看到的“通常”提示(它通常有我的用户名、服务器主机名等)。

login as: xxxxxxx
xxxxx@xxxx's password:
Last login: Fri Mar 30 14:33:41 2012 from xxx.xx.xx.xxx

-bash-4.1$ echo $0
-bash
-bash-4.1$

我试图从 GDB 运行 /bin/bash。经过中等的等待时间,我终于得到了一个 SIGSEGV 错误:

(gdb) run
Starting program: /bin/bash

Program received signal SIGSEGV, Segmentation fault.
0x08067ab5 in yyparse ()
(gdb)

我对系统所做的最后一次(重大)更改是安装 GNU 屏幕(使用 yum install screen)。当我尝试启动它时,屏幕似乎也挂起(我假设是因为它尝试运行 bash,并得到相同的段错误)。

编辑:

我尝试运行 rpm -V:

-bash-4.1$ rpm -V bash
-bash-4.1$

这是我的 .bash* 文件:

.bashrc:

# .bashrc

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

.bash_profile:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

.bash_logout:

# ~/.bash_logout

.bash_history 很长。我删除了它,再次尝试登录,得到了相同的结果。

【问题讨论】:

  • 您是否尝试将回溯发布给 bash 开发人员?
  • 我没有...你有什么推荐的?我可以将详细信息通过电子邮件发送到 bug-bash@gnu.org

标签: linux bash ssh segmentation-fault redhat


【解决方案1】:

您正在从内部递归地获取 .bashrc,在这里的简短测试中确实会导致分段错误。从 .bashrc 中删除该部分应该有望解决问题。

【讨论】:

  • 啊哈!我没有想到。我更改了我的 bashrc 以检查 /etc/bashrc 并且它完美加载。谢谢!
猜你喜欢
  • 2013-07-23
  • 2017-11-26
  • 1970-01-01
  • 1970-01-01
  • 2022-06-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多