[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
MALLOC_OPTIONS doesn't work on dyn linked executables ?
- To: tech_(_at_)_openbsd_(_dot_)_org
- Subject: MALLOC_OPTIONS doesn't work on dyn linked executables ?
- From: Jedi/Sector One <obsd-tech_(_at_)_pureftpd_(_dot_)_org>
- Date: Sat, 18 Oct 2003 23:58:01 +0200
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> \/
Visit your host, monkey.org