Koheron / koheron-sdk

SDK for FPGA / Linux Instruments
https://www.koheron.com/software-development-kit/
Other
100 stars 40 forks source link

SIGBUS on FIFO reading #102

Closed tvanderbruggen closed 8 years ago

tvanderbruggen commented 8 years ago

SIGBUS is sometimes raised when reading FIFO data:

Program received signal SIGBUS, Bus error.
[Switching to Thread 0xb41ff450 (LWP 5784)]
0x0006111a in Klib::ReadReg32 (addr=3042365472) at middleware/drivers/wr_register.hpp:49
49  middleware/drivers/wr_register.hpp: No such file or directory.
(gdb) backtrace
#0  0x0006111a in Klib::ReadReg32 (addr=3042365472) at middleware/drivers/wr_register.hpp:49
#1  0x00061e62 in FIFOReader<65536u>::acquisition_thread_call (this=0xb552c044, acq_period=1000) at middleware/drivers/lib/fifo_reader.hpp:110
#2  0x000638c0 in std::_Mem_fn<void (FIFOReader<65536u>::*)(unsigned int)>::operator()<unsigned int, void>(FIFOReader<65536u>*, unsigned int&&) const (this=0xb4a10c44, 
    __object=0xb552c044) at /opt/Xilinx/SDK/2015.4/gnu/aarch32/lin/gcc-arm-linux-gnueabi/arm-linux-gnueabihf/include/c++/4.8.3/functional:601
#3  0x00063838 in std::_Bind_simple<std::_Mem_fn<void (FIFOReader<65536u>::*)(unsigned int)> (FIFOReader<65536u>*, unsigned int)>::_M_invoke<0u, 1u>(std::_Index_tuple<0u, 1u>) (this=0xb4a10c3c) at /opt/Xilinx/SDK/2015.4/gnu/aarch32/lin/gcc-arm-linux-gnueabi/arm-linux-gnueabihf/include/c++/4.8.3/functional:1732
#4  0x00063714 in std::_Bind_simple<std::_Mem_fn<void (FIFOReader<65536u>::*)(unsigned int)> (FIFOReader<65536u>*, unsigned int)>::operator()() (this=0xb4a10c3c)
    at /opt/Xilinx/SDK/2015.4/gnu/aarch32/lin/gcc-arm-linux-gnueabi/arm-linux-gnueabihf/include/c++/4.8.3/functional:1720
#5  0x000636ce in std::thread::_Impl<std::_Bind_simple<std::_Mem_fn<void (FIFOReader<65536u>::*)(unsigned int)> (FIFOReader<65536u>*, unsigned int)> >::_M_run() (
    this=0xb4a10c30) at /opt/Xilinx/SDK/2015.4/gnu/aarch32/lin/gcc-arm-linux-gnueabi/arm-linux-gnueabihf/include/c++/4.8.3/thread:115
#6  0xb6fb6854 in ?? () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Dmesg gives:

Unhandled fault: external abort on non-linefetch (0x1018) at 0xb556d020

Meaning that we are trying to read an address that is not mapped (http://stackoverflow.com/questions/15889483/what-do-these-kernel-panic-errors-mean)

tvanderbruggen commented 8 years ago

https://forums.xilinx.com/t5/Embedded-Linux/Zynq-Bus-Error-on-mmap-ed-io/td-p/354271