sigbus

Android Fatal Signal 7 (SIGBUS)

吃可爱长大的小学妹 提交于 2019-12-04 02:21:15
I'm getting a few SIGBUS (7) and SIGSEGV (11) crashes that I am having difficult tracking down. The thread that appears to be causing the crash is primarily used for loading images to be displayed which makes sense since the logs indicate something failing with the SkJPEGImageDecoder. I re-use memory for Bitmaps in accordance with this guide Could it have something to do with that? LogCat output: 05-20 13:46:09.775: A/libc(419): Fatal signal 7 (SIGBUS) at 0x0000001e (code=1), thread 520 (ImageLoaderExec) 05-20 13:46:09.875: I/DEBUG(172): *** *** *** *** *** *** *** *** *** *** *** *** *** ***

Structure assignment in Linux fails in ARM but succeeds in x86

依然范特西╮ 提交于 2019-12-01 09:08:09
I've noticed something really strange. say I've got the following structure defined typedef struct { uint32_t a; uint16_t b; uint32_t c; } foo; This structure is contained in a big buffer I receive from network. The following code works in x86, but I receive SIGBUS on ARM. extern void * buffer; foo my_foo; my_foo = (( foo * ) buffer)[0]; replacing the pointer dereferencing with memcpy solved the issue. Searching about SIGBUS in ARM pointed me to the fact that this is related to memory alignment somwhow. Can someone explain what's going on ? You said it yourself: there are memory alignment

Bus error vs Segmentation fault

给你一囗甜甜゛ 提交于 2019-11-28 19:44:49
问题 Difference between a bus error and a segmentation fault? Can it happen that a program gives a seg fault and stops for the first time and for the second time it may give a bus error and exit ? 回答1: On most architectures I've used, the distinction is that: a SEGV is caused when you access memory you're not meant to (e.g., outside of your address space). a SIGBUS is caused due to alignment issues with the CPU (e.g., trying to read a long from an address which isn't a multiple of 4). 回答2: SIGBUS

Debugging SIGBUS on x86 Linux

此生再无相见时 提交于 2019-11-27 04:50:29
What can cause SIGBUS (bus error) on a generic x86 userland application in Linux? All of the discussion I've been able to find online is regarding memory alignment errors, which from what I understand doesn't really apply to x86. (My code is running on a Geode , in case there are any relevant processor-specific quirks there.) You can get a SIGBUS from an unaligned access if you turn on the unaligned access trap, but normally that's off on an x86. You can also get it from accessing a memory mapped device if there's an error of some kind. Your best bet is using a debugger to identify the

Debugging SIGBUS on x86 Linux

江枫思渺然 提交于 2019-11-26 11:18:30
问题 What can cause SIGBUS (bus error) on a generic x86 userland application in Linux? All of the discussion I\'ve been able to find online is regarding memory alignment errors, which from what I understand doesn\'t really apply to x86. (My code is running on a Geode, in case there are any relevant processor-specific quirks there.) 回答1: You can get a SIGBUS from an unaligned access if you turn on the unaligned access trap, but normally that's off on an x86. You can also get it from accessing a