cron 作业中出现总线错误

发布于 2024-09-25 06:33:38 字数 167 浏览 9 评论 0原文

我已经设置了一个 cron 作业,用于使用 php 从我的网站发送电子邮件。一切正常。 今天我收到一条错误消息,如下所示“/bin/sh: line 1: 29681 Bus error”。 您能告诉我这个总线错误是什么及其解决方案吗?

预先感谢

玫瑰

I have set up a cron job for sending emails from my site using php. It was working fine.
Today I got one error message like this "/bin/sh: line 1: 29681 Bus error".
Could you please tell me what is this bus error and its solutions?

Thanks In Advance

Rose

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

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

发布评论

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

评论(4

时光是把杀猪刀 2024-10-02 06:33:38

“总线错误”可能意味着正在调用的程序正在尝试取消引用空指针或某些类似的无效内存地址。它通常来自使用未初始化的值(取消引用空指针),或使用意外覆盖的值(例如,当使用保存的值压入堆栈时,但长度计算错误或用于提取数据的数据类型错误) )。

IME,很少有硬件故障的迹象。这通常是一个错误 - 所以“gdb”通常比“dmesg”更有帮助;也就是说,我早在 1991 年就参与了一些关于 UNIX 系统的研究,该研究表明某些内核和内核恐慌是电源故障(德克萨斯州奥斯汀的雷暴)的结果,但这些并没有出现在“dmesg”中尽管是“硬件”,但仍会输出:)

我目前有时会在 SugarCRM 安装中收到此消息。大约 99% 的情况下 cron.php 都会按预期工作。有时我会收到“总线错误 - 核心转储”消息。不过,我没有将核心转储到 crontab 中指定的目录中。这使得调试变得稍微复杂一些 - 我需要确保正在捕获核心转储!我不太担心,因为一切似乎都很顺利。所以这是一个低优先级的任务...我最终可能会找到并修复它,但更有可能的是我们将升级到 PHP、MySQL 和 Sugar 的较新版本 - 这些更改可能会让问题消失。

'bus error' probably means that the program that is being invoked is trying to dereference a null pointer or some similarly invalid memory address. It usually comes from using an uninitialised value (dereferencing a null pointer), or from using a value that has been accidentally overwritten (e.g. when the stack is pushed with saved values, but lengths are miscalculated or the wrong data type used to extract the data).

IME, there is rarely any implication of a hardware fault. It's usually a bug - so 'gdb' will usually help much more than 'dmesg'; that said, I was involved in some research on UNIX Systems back in 1991 that suggests that some cores and kernel panics are a consequence of power supply glitches (thunder storms in Austin, Texas), but those don't show up in 'dmesg' output despite being "hardware" :)

I'm currently getting this message in a SugarCRM installation, sometimes. About 99% of the time the cron.php works as expected. Sometimes I get a 'bus error - core dumped' message. I'm not getting a core dumped in the directory named in the crontab, though. That makes debugging this slightly more complex - I need to make sure that the core dump is being captured! I'm not too worried, as everything appears to be working. So it is a low priority task... I may find and fix it, eventually, but it is more likely that we'll upgrade to a newer version of PHP, MySQL and Sugar - and those changes may make the problem go away.

绾颜 2024-10-02 06:33:38

似乎有一些关于各种原因的线索。

这是我想尝试的一个:

出现某种硬件问题。

尝试

`dmesg`

如果无法读取它
自己的二进制文件,你必须重新启动并希望
/var/log/messages 有一些东西
在重新启动之前有用。

Seem a couple of threads about all sorts of causes.

Here is one I would try:

Some kind of hardware trouble is going on.

Try

`dmesg`

If that can't read it's
own binary, you gotta reboot and hope
that /var/log/messages has something
useful from before the reboot.

心凉 2024-10-02 06:33:38

当磁盘已满时我得到了这个。尝试df看看。

I got this when the disk was full. Try df to see.

一桥轻雨一伞开 2024-10-02 06:33:38

当您使用带有字符串的大括号来表示不存在的偏移量时,旧版本的 php (<7.4) 可能会发生这种情况。

例如,这将导致:

$myString = "Hello World";
$myCharacter = $myString{20};

作为旁注,这在 >= 7.4 中被折旧。您可以将代码更改为:

substr($myCharacter, 20, 1);

This can happen with older versions of php (<7.4) when you are using curly brackets with strings for an offset that doesn't exist.

For example this will cause it:

$myString = "Hello World";
$myCharacter = $myString{20};

As a side note this is depreciated in >= 7.4. You can change the code to:

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