title: Debugging Fatal Error - alloc: invalid block: 0000000001F00AEF0: 0 0
body: <p>I have a GUI written in R that utilizes Tcl/TK package as well a C .dll that also uses Tcl library. I have done some research on this issue, and it seems to be memory related. I am an inexperienced programmer, so I am not sure where I should be looking for this memory issue. Each call of <code>malloc()</code> has a matching <code>free()</code>, and same with the analogous <code>Tcl_Alloc()</code> and <code>Tcl_Free()</code>. This error is very hard to reproduce as well, thus I am afraid I cannot provide a reproducible example as it is seemingly random in nature. One pattern is however that it seems to only happen upon closure of the program, though this is very inconsistent. </p>
  
  <p>By making this post, I am hoping to gain a logical process that one should take in an attempt to debug this problem in a general context under Tcl/Tk - C - R applications. I am not looking for a solution specific to my code, but rather what an individual should think about when encountering this problem.</p>