Subject: lib/22223: malloc/free is ignoring malloc.conf
To: None <gnats-bugs@gnats.netbsd.org>
From: None <kefren@NetBSD.ro>
List: netbsd-bugs
Date: 07/23/2003 00:35:12
>Number:         22223
>Category:       lib
>Synopsis:       malloc/free is ignoring malloc.conf
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 22 21:36:03 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Mihai Chelaru
>Release:        NetBSD 1.6U
>Organization:
	
	None.
>Environment:
	
	
System: NetBSD smtp.girsa.ro 1.6U NetBSD 1.6U (Kefren) #2: Fri Jul 18 11:44:02 EEST 2003 root@smtp.girsa.ro:/usr/src/sys/arch/i386/compile/Kefren i386
Architecture: i386
Machine: i386
>Description:
	malloc is ignoring /etc/malloc.conf in -current (1.6U)
>How-To-Repeat:
	Simple check of 'A' options (should abort() instead of warn())

	# ln -s 'A' /etc/malloc.conf
	# ls -l /etc/malloc.conf
	lrwxr-xr-x  1 root  wheel  1 Jul 23 00:27 /etc/malloc.conf -> A
	# set | grep MALLOC_OPTIONS
	# cat 123.cpp
	#include <stdio.h>
	#include <malloc.h>

	main ()
	{
	int *a;
	a=(int*)1;
	free (a);
	printf ("Exiting\n");
	return 0;
	}

	# make 123
	c++ -O2   -o 123 123.cpp
	# ./123
	123 in free(): warning: malloc() has never been called.
	Exiting
	# 
>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted: