• Monty's avatar
    Added checking to protect against simultaneous double free in safemalloc · 79d9a725
    Monty authored
    If two threads would call sf_free() / free_memory() at the same time,
    bad_ptr() would not detect this. Fixed by adding extra detection
    when working with the memory region under sf_mutex.
    
    Other things:
    - If safe_malloc crashes while mutex is hold, stack trace printing will
      hang because we malloc is called by my_open(), which is used by stack
      trace printing code. Fixed by adding MY_NO_REGISTER flag to my_open,
      which will disable the malloc() call to remmeber the file name.
    79d9a725
my_sys.h 43 KB