“总线错误”系统错误 [英] "Bus error" system error

查看:216
本文介绍了“总线错误”系统错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个使用某些系统库的linux工具,就像一些自定义库一样。该工具的目的是访问/配置一个在其上运行一些固件的PCI Express Express卡。我对代码做了一些微小的改动,没有什么重要的,突然出现了总线错误。我知道这是由不对齐的内存访问引起的,但在上述情况下,它更有可能在固件内存中,即通过PCI-express总线读取的固件。我当然不相信我的小软件更改可能会导致总线错误。另一个令人惊讶的事实是,不同版本的软件在这个固件上运行良好。任何人都可以在这个问题上引起注意。

I am running a linux tool which uses some system libraries as we as some custom libraries. The purpose of the tool is to access/configure a PCI-express cards that has some firmware running on it. I made some slight change to code,nothing significant and suddenly got a "Bus error". I know that is is caused by unaligned memory access, but in the above context is it more likely to be in the firmware memory, i.e a firmware read across the PCI-express bus. I certainly don't believe that my small software change could have caused the "Bus error". Another surprising fact is that a different version of software is working well with this firmware. Can anyone throw some light on the issue.

推荐答案

总线错误一般是由试图访问内存的应用程序引起的,硬件无法物理地址。原因可能是未对齐的访问以及不存在的地址,没有足够的权限访问或更改内存。没有知道你改变了什么代码,很难说出你的情况出了什么问题。甚至更多 - 使用不同的编译器或编译器设置可能会导致此行为。绝对没有任何魔法,所以你必须改变引起蝴蝶效应的东西。

Bus errors are generally caused by applications trying to access memory that hardware cannot physically address. The cause might be an unaligned access as well as non-existent address, not enough permissions to access or alter memory. It is hard to tell what went wrong in your case without knowing what code you have changed. Even more than that - using a different compiler or compiler settings can cause this behavior. There is absolutely no magic involved, so you must have changed something that caused a butterfly effect.

这篇关于“总线错误”系统错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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