Bus errors are rare nowadays on x86 and 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, it is not manipulating the pointer itself that will cause issues. It’s accessing the memory it points to (dereferencing).
Related Posts:
- What is a bus error? Is it different from a segmentation fault?
- What causes a segmentation fault (core dump) to occur in C?
- What is newline character — ‘\n’
- Why does ENOENT mean “No such file or directory”?
- segmentation fault : 11
- What are .a and .so files?
- segmentation fault : 11
- Connect: Socket operation on non-socket
- Connect: Socket operation on non-socket
- What is the difference between read and pread in unix?
- What does WEXITSTATUS(status) return?
- What can cause a “Resource temporarily unavailable” on sock send() command
- Which of sprintf/snprintf is more secure?
- Execution of printf() and Segmentation Fault
- What is `S_ISREG()`, and what does it do?
- Reaching EOF with fgets
- segmentation fault using scanf
- Segmentation fault- strcat
- segmentation fault with strcpy [duplicate]
- Implementing Taylor Series for sine and cosine in C
- warning: implicit declaration of function
- pthread_join() and pthread_exit()
- Why should we typedef a struct so often in C?
- What is the difference between ++i and i++?
- Undefined reference to pthread_create in Linux
- Stack smashing detected
- Why am I getting “void value not ignored as it ought to be”?
- Pointer Arithmetic
- Openssl : error “self signed certificate in certificate chain”
- How do I create an array of strings in C?
- How do function pointers in C work?
- Expression must be a modifiable L-value
- “Expected expression before ‘ { ‘ token”
- How to generate a random int in C?
- How do I use valgrind to find memory leaks?
- C pointers and arrays: [Warning] assignment makes pointer from integer without a cast
- How to print the array?
- How to solve the error: assignment to expression with array type
- What does “1e” mean?
- how to use uint64_t in C [duplicate]
- munmap_chunk(): invalid pointer
- How do I solve the following errors: “Undefined reference to WinMain”, “[Error] Id returned 1 exit status”?
- Warning comparison between pointer and integer
- What is the LD_PRELOAD trick?
- How do I properly compare strings in C?
- How to correctly use the extern keyword in C
- How do we check if a pointer is NULL pointer?
- how to use wait in C
- How do I calculate MB/s & MiB/s?
- How to create my own header file in c++?
- In C programming, what is `undefined reference`error, when compiling?
- double free or corruption (fasttop)
- Returning string from C function
- error: expected declaration or statement at end of input in c
- Why do I get clang: error: linker command failed with exit code 1?
- How to convert integer to char in C?
- Program received signal SIGPIPE, Broken pipe
- How to read from stdin with fgets()?
- Why am I getting “array initializer must be an initializer list or string literal”?
- What does it mean to write to stdout in C?
- what is the unsigned datatype?
- #31 expression must have integral type
- How do you pass a function as a parameter in C?
- Reading a string with scanf
- getopt_long() — proper way to use it?
- C read file line by line
- C read file line by line
- Copying a part of a string (substring) in C
- Incompatible implicit declaration of built-in function ‘malloc’
- Does C have a “foreach” loop construct?
- How to solve error: expected identifier or ‘(‘
- Reversing a string in C
- When a number is written as 0x00… what does the x mean
- How to remove the character at a given index from a string in C?
- waitpid, wnohang, wuntraced. How do I use these
- Split string with delimiters in C
- How to pause in C?
- (.text+0x20): undefined reference to `main’ and undefined reference to function
- Why am I getting this error: “data definition has no type or storage class”?
- I’m getting “Invalid Initializer”, what am I doing wrong?
- Writing binary number system in C code
- Convert char array to string use C
- warning: passing argument ’from incompatible pointer type [enabled by default]’
- Return a `struct` from a function in C
- Why should we check WIFEXITED after wait in order to kill child processes in Linux system call?
- Scanning Multiple inputs from one line using scanf
- Allocating char array using malloc
- Implementation of strtok() function
- C fopen vs open
- switch case: error: case label does not reduce to an integer constant
- warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
- warning: return makes pointer from integer without a cast but returns integer as desired
- The difference between char * and char[] [duplicate]
- How to clear input buffer in C?
- Reasoning behind C sockets sockaddr and sockaddr_storage
- What primitive data type is time_t? [duplicate]
- Usage of \b and \r in C
- Parsing command-line arguments in C
- Compiler warning – suggest parentheses around assignment used as truth value
- lvalue required as increment operand