Program error signals


Data Structures
Algorithms
Interview Preparation
Topic-wise Practice
C++
Java
Python
Competitive Programming
Machine Learning
Web Development
Puzzles
Project Ideas
GFG School

Related Articles
CRASH() macro – interpretation
The OFFSETOF() macro
Branch prediction macros in GCC
Difference between #define and const in C?
Interesting Facts about Macros and Preprocessors in C
Compiling a C program:- Behind the Scenes
Program error signals
Escape Sequences in C
Line Splicing in C/C++
C/C++ Tokens
Variables and Keywords in C
How are variables scoped in C – Static or Dynamic?
Scope rules in C
How Linkers Resolve Global Symbols Defined at Multiple Places?
Complicated declarations in C
Redeclaration of global variable in C
Internal Linkage and External Linkage in C
Different ways to declare variable as constant in C and C++
Variable length arguments for Macros
Multiline macros in C
Arrays in C/C++
std::sort() in C++ STL
Dynamic Memory Allocation in C using malloc(), calloc(), free() and realloc()
Bitwise Operators in C/C++
What is Memory Leak? How can we avoid?
Core Dump (Segmentation fault) in C/C++
Converting Strings to Numbers in C/C++
Multidimensional Arrays in C / C++
Left Shift and Right Shift Operators in C/C++
rand() and srand() in C/C++

Program error signals
Difficulty Level : Medium
Last Updated : 21 Aug, 2021
Signals in computers are a way of communication between the process and the OS. When a running program undergoes some serious error then the OS sends a signal to the process and the process further may not execute. Some processes may have a signal handler that does some important tasks before the process leaves the CPU. 

Signal and interrupt are basically the same but a small distinction exists i.e interrupts are generated by the processor and handled by the kernel but signals are generated by the kernel and handled by the process. Error signals generally cause termination of the program and a core dump file is created named core, which stores the state of the process at the moment of termination. This file can be investigated using the debugger to know the cause of program termination. 

Error signals: 

SIGFPE – 
This error signal denotes some arithmetic error that occurred like division by zero, floating-point error. If a program stores integer data in a location that is then used as a floating-point operation, this causes an “invalid operation” exception as the processor cannot recognize the data as a floating-point value. But this signal does not specify the type of floating-point error
Posted on by