Subject: lib/17937: libmenu set_menu_mark attempts to free() free chunk.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <rtr@wasabisystems.com>
List: netbsd-bugs
Date: 08/15/2002 00:12:22
>Number:         17937
>Category:       lib
>Synopsis:       libmenu set_menu_mark usage results in free() warning.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 14 07:14:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Tyler Retzlaff
>Release:        NetBSD 1.6E
>Organization:
	Disorganization
>Environment:
System: NetBSD elysium 1.6E NetBSD 1.6E (elysium) #0: Tue Aug 6 07:29:42 EST 2002 rtr@elysium:/wasabi/home/source/co/retry/src/sys/arch/i386/compile/elysium i386
Architecture: i386
Machine: i386
>Description:
	Call to set_menu_mark results in __progname in free(): warning chunk is
	already free. warnings during runtime.  set_menu_mark argument 1 is
	NULL so it's occuring on the internal default menu.

	I'm unsure of the circumstances that result in this I've not been able
	to reproduce it in a smaller program.

	Some background about how it's being used:

	The call to the set_menu_mark is inside a function, the free() warning
	only occurs on the second run of the function.  So the 2nd call to
	the set_menu_mark function is resulting in the error.  

	The set_menu_mark function is not used anywhere else in the program
	and is never used with any argument 1 that isn't NULL.

>How-To-Repeat:
	Use set_menu_mark extensively with argument 1 NULL (so it applies to
	default menu)

	Here's some gdb output with a single step.

	Breakpoint 1, select_if (ball=0xbfbfd558) at netcui.c:115
	115             set_menu_mark(NULL, "(X)");
	(gdb) s
	cystinst in free(): warning: chunk is already free.
	116             set_menu_unmark(NULL, "( )");
	(gdb) 

>Fix:
	I haven't looked extensively, perhaps later.
>Release-Note:
>Audit-Trail:
>Unformatted: