From 58e74c7e7faf0bdf84f1b2030b98e122ab38f70f Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sat, 4 May 2002 04:30:57 +0000 Subject: [PATCH] . --- winsup/cygwin/how-fhandlers-work.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/winsup/cygwin/how-fhandlers-work.txt b/winsup/cygwin/how-fhandlers-work.txt index 5e810a780..cef46fedc 100644 --- a/winsup/cygwin/how-fhandlers-work.txt +++ b/winsup/cygwin/how-fhandlers-work.txt @@ -63,3 +63,13 @@ cannot. For an example step-by-step to create a new fhandler, see ../doc/fhandler-tut.txt + +Note: In most case, it is safe to assume that using new/delete (or +malloc/free) in an fhandler is dangerous and to be avoided. The reason +for this is that memory allocated to fhandlers is copied between execed +processes in the cygwin heap. Memory allocated in new/delete is only +copied to forked processes. So use cmalloc/cfree. + +Obviously it is possible to use new/delete in some situations but if you're +seeing strange core dumps with usages like cat < /my/newfhandler then the +above may well be the culprit.