如何确定“BUS-Error"的原因? [英] How to determine the cause for "BUS-Error"

查看:53
本文介绍了如何确定“BUS-Error"的原因?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个带有 yocto 发行版和 python 2.7.3 的 variscite 板.

I'm working on a variscite board with a yocto distribution and python 2.7.3.

我有时会收到来自 python 解释器的总线错误消息.
我的程序在错误发生前至少几个小时或几天正常运行.
但是当我得到它一次时,我尝试重新启动程序时直接得到它.
在系统再次工作之前,我必须重新启动.

I get sometimes a Bus error message from the python interpreter.
My program runs normally at least some hours or days before the error ocours.
But when I get it once, I get it directly when I try to restart my program.
I have to reboot before the system works again.

我的程序只使用了一个串口、一个 USB 通信和一些 tcp 套接字.

My program uses only a serial port, a bit usb communication and some tcp sockets.

我可以切换到另一个硬件并遇到同样的问题.

I can switch to another hardware and get the same problems.

我还使用了 python selftest
python -c "从测试导入 testall"

I also used the python selftest with
python -c "from test import testall"

我得到这两个测试的错误

And I get errors for these two tests

test_getattr (test.test_builtin.BuiltinTest) ... 错误 test_nameprep(test.test_codecs.NameprepTest) ... 错误

test_getattr (test.test_builtin.BuiltinTest) ... ERROR test_nameprep (test.test_codecs.NameprepTest) ... ERROR

自检总是在

test_callback_register_double (ctypes.test.test_callbacks.SampleCallbacksTestCase) ... 分割故障

test_callback_register_double (ctypes.test.test_callbacks.SampleCallbacksTestCase) ... Segmentation fault

但是当系统运行几个小时时,自测会提前停止

But when the systems runs some hours the selftests stops earlier at

ctypes.macholib.dyld总线错误

ctypes.macholib.dyld Bus error

我用memtester检查了内存,好像没问题.
如何找到问题的原因?

I checked the RAM with memtester, it seems to be okay.
How I can find the cause for the problems?

推荐答案

总线错误通常是由应用程序试图访问硬件无法物理寻址的内存引起的.在您的情况下,存在分段错误,这可能会导致取消引用错误指针或类似的东西,从而导致访问物理上不可寻址的内存地址.我会从根源开始首先导致分段错误,因为总线错误是次要症状.

Bus errors are generally caused by applications trying to access memory that hardware cannot physically address. In your case there is a segmentation fault which may cause dereferencing a bad pointer or something similar which leads to accessing a memory address which physically is not addressable. I'd start by root causing the segmentation fault first as the bus error is the secondary symptom.

这篇关于如何确定“BUS-Error"的原因?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆