Skip to content

Instantly share code, notes, and snippets.

@iDoka
Last active October 1, 2018 11:51
Show Gist options
  • Save iDoka/6b3add3203975a9c038886e96310406a to your computer and use it in GitHub Desktop.
Save iDoka/6b3add3203975a9c038886e96310406a to your computer and use it in GitHub Desktop.
Segmentation fault (core dumped): how to diagnose and fixing?

Here the good methodologies to find and fix segmentation fault errors

  1. Compile you program using the -g -O0 gcc-switch, or add options to string CFLAGS and/or CXXFLAGS in Makefile.
  2. Then use gdb (if need - pass command argument using --args option): gdb --args ./proxmark3 /dev/ttyACM0
  3. Use some gdb magic:
(gdb) run
<segfault happens here>
(gdb) backtrace
<offending code is shown here>

This link list I find useful:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment