Outils pour utilisateurs

Outils du site


tech:notes_segmentation_fault

Ceci est une ancienne révision du document !


Notes segmentation fault

Segmentation Fault - segmentation violation - address not mapped - invalid memory access

Code 11 / 139

L'erreur “Exited with code -11” (ou Code de sortie -11 / exit code -11) signifie presque toujours que votre programme a été arrêté brutalement par le système d'exploitation à cause d'une erreur de segmentation (Segmentation Fault / SIGSEGV). En informatique, le code de sortie d'un processus crashé par un signal Unix correspond souvent à - (le numéro du signal). Le signal 11 étant SIGSEGV (Invalid memory reference).

You didn't find a definitive answer because there isn't one. It's up to the author of the program to decide what exit codes they wish to use. Standard C only says that exit(0) or exit(EXIT_SUCCESS) indicate that the program is successful, and that exit(EXIT_FAILURE) indicates an error of some kind. (Returning a value from main is equivalent to calling exit with that value.) Most common operating systems including Windows, Linux, OSX, etc. use 0 for success and values from 1 to 255 to indicate errors; still choosing between error codes is up to the application writer, the value 11 isn't anything special.

Under Linux and most other Unix variants, the signal number 11 indicates a segmentation fault,… A segmentation fault happens when a program makes some kind of invalid memory access, so it's a plausible consequence of accessing an array out of bounds, or an error in pointer arithmetic, or trying to access a null pointer, or other pointer-related errors. Signal 11 is not the same thing as exit code 11: when a program dies due to a signal, it's marked as having been killed by a signal, rather than having exited normally. Unix shells report signals by reporting an exit code which is the signal number plus 128, so 139 for a segmentation fault.

Source https://stackoverflow.com/questions/31103254/meaning-of-exit-code-11-in-c/31104032#comment50221640_31103254

FIXME

tech/notes_segmentation_fault.1793135572.txt.gz · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki