Linux Bus Error Cause
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more linux bus error message about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users linux bus error core dumped Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping how to solve bus error in linux each other. Join them; it only takes a minute: Sign up “Bus error” system error [closed] up vote 6 down vote favorite 2 I am running a linux tool which uses some system libraries as we as some bus error in c 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
How To Debug Bus Error
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. linux debugging bus share|improve this question edited May 3 '11 at 13:44 skaffman 278k63619656 asked May 3 '11 at 13:40 liv2hak 3,8741759109 closed as off-topic by Ciro Santilli 烏坎事件2016六四事件 法轮功, Yu Hao, Chris Loonam, John Pirie, Rob Aug 7 '15 at 16:35 This question appears to be off-topic. The users who voted to close gave this specific reason:"Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Ciro Santilli 烏坎事件2016六四事件 法轮功, Yu Hao, Chris Loonam, John Pirie, RobIf this question can be reworded to fit the rules in the help center, please edit the question. 1 > I certainly don't believe that my small software change could have caused the "Bus error".... –sehe May 3 '11 at 14:21 Voting to close as unclear. We need more details :-) –Ciro Santilli 烏坎事件2016六四事件 法轮功 Aug 7 '15 at 10:55 add a comment| 1 Answer 1 active oldest votes up vote 16 down vote acce
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us
Sigbus Error Linux
Learn more about Stack Overflow the company Business Learn more about hiring developers bus error vs segmentation fault or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack bus error ubuntu Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up What is a bus error? up vote http://stackoverflow.com/questions/5870353/bus-error-system-error 156 down vote favorite 49 What does the "bus error" message mean, and how does it differ from a segfault? c unix segmentation-fault bus-error share|improve this question edited Oct 18 '15 at 10:44 Cool Guy 15.7k51952 asked Oct 17 '08 at 14:48 raldi 7,272216178 add a comment| 15 Answers 15 active oldest votes up vote 151 down vote accepted Bus errors are rare nowadays on x86 and http://stackoverflow.com/questions/212466/what-is-a-bus-error occur when your processor cannot even attempt the memory access requested, typically: using a processor instruction with an address that does not satisfy its alignment requirements. Segmentation faults occur when accessing memory which does not belong to your process, they are very common and are typically the result of: using a pointer to something that was deallocated. using an uninitialized hence bogus pointer. using a null pointer. overflowing a buffer. PS: To be more precise this is not manipulating the pointer itself that will cause issues, it's accessing the memory it points to (dereferencing). share|improve this answer edited Oct 17 '08 at 15:18 answered Oct 17 '08 at 15:12 bltxd 5,72322336 52 They aren't rare; I'm just at Exercise 9 from How to Learn C the Hard Way and already encountered one... –11684 Mar 26 '13 at 20:12 5 Another cause of bus errors (on Linux anyway) is when the operating system can't back a virtual page with physical memory (e.g. low-memory conditions or out of huge pages when using huge page memory.) Typically mmap (and malloc) just reserve the virtual address space, and the kernel assigns the physical memory on demand (so called soft page faults.
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of http://stackoverflow.com/questions/838540/bus-error-vs-segmentation-fault this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign bus error up Bus error vs Segmentation fault up vote 25 down vote favorite 8 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 ? c share|improve this question edited May 2 '12 at 12:04 casperOne linux bus error 58.2k10127202 asked May 8 '09 at 6:56 Thunderboltz 6253915 add a comment| 6 Answers 6 active oldest votes up vote 34 down vote accepted 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). share|improve this answer answered May 8 '09 at 7:06 paxdiablo 491k1189731422 10 Memory mapped files can also generate SIGBUS. –bk1e May 8 '09 at 16:06 on arm SIGBUS can occur if you read a float from an address that is not 4 byte aligned –shoosh Mar 30 at 7:29 shoosh, I'm pretty certain that's covered by my second bullet point. –paxdiablo Mar 30 at 13:28 add a comment| up vote 11 down vote SIGBUS will also be raised if you mmap() a file and attempt to access part of the mapped buffer that extends past the end of the file, as well as for