13.4 Runtime error messages
error while loading shared libraries:
cannot open shared object file: No such file or directory
The program uses shared libraries, but the necessary shared library
files cannot be found by the dynamic linker when the program starts.
The search path for shared libraries is controlled by the environment
LD_LIBRARY_PATH (see section 3.2 Shared libraries and static libraries).
These runtime messages indicate a memory access error.
Common causes include:
There is a subtle difference between segmentation faults and bus errors.
A segmentation fault occurs when a process tries to access memory
protected by the operating system. A bus error occurs when valid memory
is accessed in an incorrect way (for example, trying to read an
unaligned value on architectures where values must be aligned with
- dereferencing a null pointer or uninitialized pointer
- out-of-bounds array access
- incorrect use of
free and related functions
- use of
scanf with invalid arguments
floating point exception
This runtime error is caused by an arithmetic exception, such as
division by zero, overflow, underflow or an invalid operation (e.g.
taking the square root of -1). The operating system determines
which conditions produce this error. On GNU systems, the functions
fedisableexcept can be used to trap or
mask each type of exception.
This error is produced by the operating system when an illegal machine
instruction is encountered. It occurs when code has been compiled for
one specific architecture and run on another.