From nobody@FreeBSD.org  Fri Jul 20 02:52:09 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 9050437B401
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 20 Jul 2001 02:52:09 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id f6K9q9Q61372;
	Fri, 20 Jul 2001 02:52:09 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200107200952.f6K9q9Q61372@freefall.freebsd.org>
Date: Fri, 20 Jul 2001 02:52:09 -0700 (PDT)
From: Andrew BLiznak <andrew@ort.lviv.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: make (1) dump core while processing ^C from console with malloc's "recursive call." diagnostic.
X-Send-Pr-Version: www-1.0

>Number:         29103
>Category:       bin
>Synopsis:       make (1) dump core while processing ^C from console with malloc's "recursive call." diagnostic.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    harti
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 20 03:00:04 PDT 2001
>Closed-Date:    Mon Nov 15 12:59:10 GMT 2004
>Last-Modified:  Mon Nov 15 12:59:10 GMT 2004
>Originator:     Andrew BLiznak
>Release:        5.0-CURRENT
>Organization:
"ORT" Ltd.
>Environment:
FreeBSD pyvo.ort 5.0-CURRENT FreeBSD 5.0-CURRENT #5: Fri Jul 13 18:49:45 EEST 2001     andrew@pyvo.ort:/usr/obj/usr/src/sys/PYVO  i386
>Description:
Got this backtrace:

pyvo# gdb /usr/obj/usr/src/usr.bin/make/make -c make.core
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...
Core was generated by `make'.
Program terminated with signal 6, Abort trap.
#0  0x8062010 in kill ()
(gdb) bt
#0  0x8062010 in kill ()
#1  0x806fc96 in abort () at /usr/src/lib/libc/../libc/stdlib/abort.c:70
#2  0x806ea85 in wrterror (p=0x807636f "recursive call.\n")
    at /usr/src/lib/libc/../libc/stdlib/malloc.c:295
#3  0x806eaa4 in wrtwarning (p=0x807636f "recursive call.\n")
    at /usr/src/lib/libc/../libc/stdlib/malloc.c:303
#4  0x806f999 in free (ptr=0x0)
    at /usr/src/lib/libc/../libc/stdlib/malloc.c:1099
#5  0x80498b8 in CompatInterrupt (signo=2)
    at /usr/src/usr.bin/make/compat.c:118
#6  0xbfbfffac in ?? ()
#7  0x806f9ad in free (ptr=0x80bff00)
    at /usr/src/lib/libc/../libc/stdlib/malloc.c:1103
#8  0x805a470 in Var_Subst (var=0x0,
    str=0x80a4c00 "PORTOBJFORMAT=${PORTOBJFORMAT} ${INSTALL_MACROS} CURDIR=${MASTERDIR} DISTDIR=${DISTDIR}  WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR}  SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR}  PORTSDIR=$"...,
    ctxt=0x80a9980, undefErr=0) at /usr/src/usr.bin/make/var.c:2444
#9  0x805943f in Var_Parse (
    str=0x80a4c00 "PORTOBJFORMAT=${PORTOBJFORMAT} ${INSTALL_MACROS} CURDIR=${MASTERDIR} DISTDIR=${DISTDIR}  WRKDIR=${WRKDIR} WRKSRC=${WRKSRC} PATCHDIR=${PATCHDIR}  SCRIPTDIR=${SCRIPTDIR} FILESDIR=${FILESDIR}  PORTSDIR=$"...,
    ctxt=0x80a9980, err=0, lengthPtr=0xbfbfe940, freePtr=0xbfbfe944)
    at /usr/src/usr.bin/make/var.c:1718
#10 0x805a39c in Var_Subst (var=0x0,
    str=0x80ab801 "@if [ -f ${SCRIPTDIR}/${.TARGET:S/^real-/pre-/} ]; then  cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV", ctxt=0x80a9980, undefErr=0)
    at /usr/src/usr.bin/make/var.c:2398
#11 0x80499d3 in CompatRunCommand (cmdp=0x80ab801, gnp=0x80a9980)
    at /usr/src/usr.bin/make/compat.c:213
#12 0x805aab4 in Lst_ForEachFrom (l=0x80acee0, ln=0x80831d0,
    proc=0x8049984 <CompatRunCommand>, d=0x80a9980)
    at /usr/src/usr.bin/make/lst.lib/lstForEachFrom.c:94
#13 0x805aa71 in Lst_ForEach (l=0x80acee0, proc=0x8049984 <CompatRunCommand>,
    d=0x80a9980) at /usr/src/usr.bin/make/lst.lib/lstForEach.c:73
#14 0x8049f4b in CompatMake (gnp=0x80a9980, pgnp=0x80a9980)
    at /usr/src/usr.bin/make/compat.c:505
#15 0x804a241 in Compat_Run (targs=0x809a520)
    at /usr/src/usr.bin/make/compat.c:701
#16 0x8051156 in main (argc=3, argv=0xbfbff7ac)
    at /usr/src/usr.bin/make/main.c:871
#17 0x8048135 in _start (arguments=0xbfbff8a8 "make")
    at /usr/src/lib/csu/i386-elf/crt1.c:96
(gdb)
>How-To-Repeat:
Don't know how this repitable.

cd /usr/ports/graphics/png
make

hit ^C quickly before make print's any output

I have copy of core + program with debuging symbols for future examining
>Fix:

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->harti 
Responsible-Changed-By: harti 
Responsible-Changed-When: Fri Aug 13 11:03:15 GMT 2004 
Responsible-Changed-Why:  
I take this. The reason for the core is quite obvious from 
the backtrace: the interrupt handler CompatInterrupt call free() 
which it shouldn't do. In general interrupt handlers are allowed 
to call only a small number of functions. This will require some work, 
though. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=29103 
State-Changed-From-To: open->closed 
State-Changed-By: harti 
State-Changed-When: Mon Nov 15 12:58:30 GMT 2004 
State-Changed-Why:  
Fixed in RELENG_6 by not doing the interrupt processing from the 
signal handler. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=29103 
>Unformatted:
