[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MALLOC_OPTIONS doesn't work on dyn linked executables ?



  Hello.
  
  It looks like MALLOC_OPTIONS doesn't work on dynamically linked executables.
  But it works on statically compiled ones.

  See :

#include <stdlib.h>
#include <stdio.h>
int main(void)
{
	unsigned long *a = malloc(42);
	printf("%lx\n", *a);	
	return 0;
}

$ cc -o a a.c && env MALLOC_OPTIONS=J ./a
0
$ cc -static -o a a.c && env MALLOC_OPTIONS=J ./a
d0d0d0d0

  Maybe this is the expected behavior, but a small note about this in
malloc(3) would be nice.

  Best regards,

--
 __  /*-      Frank DENIS (Jedi/Sector One) <j_(_at_)_42-Networks_(_dot_)_Com>     -*\  __
 \ '/    <a href="http://www.PureFTPd.Org/";> Secure FTP Server </a>    \' /
  \/  <a href="http://www.Jedi.Claranet.Fr/";> Misc. free software </a>  \/