How to determine the cause for "BUS-Error"
Question: I'm working on a variscite board with a yocto distribution and python 2.7.3.

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.

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.

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) ... ERROR test_nameprep
> (test.test_codecs.NameprepTest) ... ERROR

And the selftest stops always at

> 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 Bus error

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


Answer: 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.

