Outils pour utilisateurs

Outils du site


tech:notes_segmentation_fault

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

tech:notes_segmentation_fault [2026/10/27 22:12] – créée Jean-Baptistetech:notes_segmentation_fault [2026/11/03 16:49] (Version actuelle) – Jean-Baptiste
Ligne 3: Ligne 3:
  
 # Notes segmentation fault # Notes segmentation fault
 +
 +Pour comprendre et analyser l'origine d'un tel plantage dans vos programmes, vous pouvez compiler avec les options de débogage de GCC (gcc -g) et utiliser un outil comme GDB ou AddressSanitizer (Coddy Tech).
 +  * https://coddy.tech/docs/fr/c/segmentation-fault
 +  * https://en.wikipedia.org/wiki/Segmentation_fault
 +
 +
 +## Common Causes
 +
 +* Null or Uninitialized Pointers: Dereferencing a pointer that points to a random memory address instead of a valid allocation.
 +* Buffer Overflow / Out-of-Bounds Access: Writing or reading past the end of an array or buffer.
 +* Stack Overflow: Allocating too much memory on the stack (such as a massive local array) instead of the heap (using `std::vector` in C++ or dynamic allocation).
 +* Use-After-Free: Accessing memory after it has already been freed or deleted.
 +
 +
 +## How to Debug It
 +
 +* Use GDB: Run your program inside the GNU Debugger (gdb ./your_program) and type run, then backtrace (or bt) once it crashes to find the exact line of code causing the fault.
 +* Check Memory with Valgrind: Run valgrind --leak-check=yes ./your_program to catch invalid reads, writes, and memory corruption.
 +* Inspect Array and Stack Sizes: If working in C/C++, replace raw fixed-size arrays with safe containers like std::vector.
 +If you want to troubleshoot further, let me know:
 +* What programming language or tool are you running?
 +* Can you share the code snippet or stack trace around where the crash happens?
  
  
tech/notes_segmentation_fault.1793135572.txt.gz · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki