[sr-dev] [kamailio/kamailio] Google Sanitizers: memory not freed during shutdown (Issue #2892)

sergey-safarov notifications at github.com
Thu Oct 21 13:36:41 CEST 2021

One more [link](https://www.reddit.com/r/cprogramming/comments/57pg5s/dynamically_allocated_memory_and_fork/)
> When you fork a process, all of the malloc-heap structures will become COW by virtue of living within privately mapped page contents, which means that you can malloc, then fork, and then safely/correctly free the same pointer in the parent and child process. (Note also that the same rules apply to function returns—a single function call pre-fork can result in two valid returns post-fork with no problems, because the stack and stack management structures will be COWed.) “Required” doesn’t really enter into it TBH; if you no longer need something and it’s allocated usually, free it once you’re in the new process.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20211021/4c0c377c/attachment.htm>

More information about the sr-dev mailing list