title: When I run my code, i get a segfault, but when the debugger runs it, it says there is no issue
body: <p>I'm doing an assignment that is working with shared memory, and i'm getting segfaults whenever I run the code. So i tried using the GDB debugger to see where the fault is occurring,but when it runs the code, it exits normally and says its fine. i pasted what wasin the terminal below</p>
  
  <pre><code>./main
  This is the cb 16669520, This is the dbInfo 2117869600, and this is the db 2117869608
  this is the number of processes 1
  Segmentation fault (core dumped)
  </code></pre>
  
  <p>the first two lines it prints out are fine, but the code never reaches the end of the main. THen when I run the debugger...</p>
  
  <pre><code>gdb ./main
  (gdb) run
  Starting program: /*path*/ 
  [Thread debugging using libthread_db enabled]
  Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
  This is the cb -8848, This is the dbInfo -243544032, and this is the db -243544024
  this is the number of processes 2
  The code got this far[Inferior 1 (process 15840) exited normally]
  (gdb) backtrace
  No stack.
  </code></pre>