Quoth Wolf, Josef [EMAIL PROTECTED]:
> I've just checked uClibc.  It uses alloca only when a MMU is
> available. If there's no MMU, it falls back to mmap().
> 
> Now I'm somewhat confused.  What's wrong with alloca in the
> vfork context? Maybe the problem is coupled with setjmp
> implementations of vfork?  I found
> http://gcc.gnu.org/ml/gcc/2005-06/msg01265.html but that
> discusses vfork implementation.
> That's a totally different thing from exec* implementation
> since the exec* functions have their own stack frames

Checking my notes, we apparently applied the following patch to uClibc,
which prevented a memory leak:

--- r86/uClibc/libc/unistd/exec.c
+++ r87/uClibc/libc/unistd/exec.c
@@ -41,7 +41,7 @@
 extern char *__strchrnul(const char *s, int c);

 
/**********************************************************************/
-#ifdef __UCLIBC_HAS_MMU__
+#if defined(__UCLIBC_HAS_MMU__) ||
defined(__UCLIBC_UCLINUX_BROKEN_MUNMAP__)

 /* We have an MMU, so use alloca() to grab space for buffers and
  * arg lists. */


Not sure if that's a *good* patch or not, but it works (by making it use
alloca instead of mmap, since BROKEN_MUNMAP is defined by default).

_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to