如何确定涉及段错误的库

发布于 2024-12-27 15:22:31 字数 928 浏览 2 评论 0原文

我在 CentOS 5.7 上运行 nagios 3.2.3,并且某些原因导致它出现段错误。最近,配置中添加了许多服务器,因此很难判断哪个附加指令触发了问题。

然而,nagios 3.2.3 软件包来自 rpmforge,并且许多现有的 perl 库可能是 CentOS 基础/更新存储库,因此我预计某些冲突的库会导致此问题。

在 strace 下运行 nagios 服务器二进制文件 会导致出现段错误;

open("/usr/bin/p1.pl", O_RDONLY)        = 4
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffefee6da0) = -1 ENOTTY (Inappropriate ioctl for device)
lseek(4, 0, SEEK_CUR)                   = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
fstat(4, {st_mode=S_IFREG|0664, st_size=31878, ...}) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
readlink("/proc/self/exe", "/usr/bin/nagios"..., 4095) = 15
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

所以我尝试过一些事情;

  1. 内核是最新的,并且服务器已重新启动。 yum -y
  2. update 已经运行,并且服务器重新启动 /usr/bin/nagios -v
  3. /etc/nagios/nagios.cfg 通过了飞行前检查,

无法在不重新编译的情况下禁用嵌入式 perl,这是一个巨大的烦恼。

I have nagios 3.2.3 running on CentOS 5.7, and something is causing it to segfault. recently many servers were added to the configuration so its hard to tell what additional directive is triggering the problem.

However the nagios 3.2.3 package comes from rpmforge and many of the existing perl libs are likely to be CentOS base/updates repos, so I am expecting that some conflicting library is causing this..

Running the nagios server binary under strace results in the following segfault;

open("/usr/bin/p1.pl", O_RDONLY)        = 4
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fffefee6da0) = -1 ENOTTY (Inappropriate ioctl for device)
lseek(4, 0, SEEK_CUR)                   = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
fstat(4, {st_mode=S_IFREG|0664, st_size=31878, ...}) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
readlink("/proc/self/exe", "/usr/bin/nagios"..., 4095) = 15
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

so some things that I have tried;

  1. the kernel is up to date, and the server has been rebooted. yum -y
  2. update has been run, and server rebooted /usr/bin/nagios -v
  3. /etc/nagios/nagios.cfg passes the pre-flight check

cant disable the embedded perl without recompiling, which is a massive annoyance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撕心裂肺的伤痛 2025-01-03 15:22:31

--- SIGSEGV(分段错误)@ 0 (0) ---

这意味着某些代码取消引用了 NULL 指针。

在 GDB 下运行 /usr/bin/nagios,并使用 where 命令找出哪个代码执行了此操作。

--- SIGSEGV (Segmentation fault) @ 0 (0) ---

That means some code dereferenced a NULL pointer.

Run /usr/bin/nagios under GDB, and use where command to find out which code did this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文