X-MimeOLE: Produced By Microsoft Exchange V6.5
Received: by onstor-exch02.onstor.net 
	id <01C7A7BB.D217BB13@onstor-exch02.onstor.net>; Tue, 5 Jun 2007 14:52:32 -0700
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-class: urn:content-classes:message
Subject: RE: malloc source code (Defect 19165)
Date: Tue, 5 Jun 2007 14:52:34 -0700
Message-ID: <BB375AF679D4A34E9CA8DFA650E2B04E04020639@onstor-exch02.onstor.net>
In-Reply-To: <BB375AF679D4A34E9CA8DFA650E2B04E028FB481@onstor-exch02.onstor.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: malloc source code (Defect 19165)
Thread-Index: Acenuw+xhLjqBfVERU6P2DnV6LBz5QAAF8CQ
References: <BB375AF679D4A34E9CA8DFA650E2B04E028FB481@onstor-exch02.onstor.net>
From: "Brian DeForest" <brian.deforest@onstor.com>
To: "Mike Lee" <mike.lee@onstor.com>,
	"Andy Sharp" <andy.sharp@onstor.com>,
	"Larry Scheer" <larry.scheer@onstor.com>
Cc: "Ken Renshaw" <ken.renshaw@onstor.com>,
	"Raj Kumar" <raj.kumar@onstor.com>,
	"Maxim Kozlovsky" <maxim.kozlovsky@onstor.com>

I believe Max made this change to force a core dump rather than return
NULL.   The code is in the BSD tree:

.../openbsd/src/lib/libc/stdlib/malloc.c=20

-----Original Message-----
From: Mike Lee=20
Sent: Tuesday, June 05, 2007 2:47 PM
To: Andy Sharp; Larry Scheer
Cc: Ken Renshaw; Raj Kumar; Brian DeForest
Subject: malloc source code (Defect 19165)

Hi Andy and Larry:

I'm chasing after Defect 19165, where one of the SSC daemons crashed
with the stack shown below.
I'm trying to figure out under what circumstance(s) malloc() would call
wrterror() and abort() since it is not clear from the stack.  If it is
due to memory exhaustion, then I like to figure out why malloc didn't
just return NULL instead of aborting.

As such, I'm trying to find the source code for malloc.c, where the
malloc() we used is compiled from.

Would you know where it may be?

Thanks.

-Mike

(gdb) where
#0  0x507abb34 in kill () at kill:2
#1  0x5082bc24 in abort ()
#2  0x5082ce1c in wrterror ()
#3  0x5082ebfc in malloc ()
#4  0x5082bf80 in calloc ()
#5  0x502e446c in rmc_alloc_msg (sz=3D24376) at rmc_api.c:1395
#6  0x502e5444 in rmc_get_msg (hdr=3D0x7ffff098) at rmc_api.c:1678
#7  0x502dad38 in rmc_internal_msgalloc (sess=3D0x1013fc00,
msg=3D0x7ffff098, msg_alloc=3D0x502e53f4 <rmc_get_msg>) at rmc.c:1755
#8  0x502d67e4 in rmc_internal_getmsg (sess=3D0x10114338,
msg_alloc=3D0x502e53f4 <rmc_get_msg>) at rmc.c:776
#9  0x502e2e5c in rmc_waitfor_msg (sess=3D0x10114000, msg=3D0x7ffff278,
get_msgbuf=3D0x502e53f4 <rmc_get_msg>, timeout=3D0x7ffff270)
    at rmc_api.c:1017
#10 0x502e2974 in rmc_rpc (sess=3D0x10114000, req_buf=3D0x7ffff330,
req_len=3D24, resp_buf=3D0x7ffff348, resp_len=3D0x7ffff2e0)
    at rmc_api.c:926
#11 0x489328 in sendRequestToFp (sess=3D0x10114000, timeout_sec=3D0,
mid=3D9611, req=3D0x7ffff330, req_len=3D24, resp=3D0x7ffff348,
    resp_len=3D80) at ndmp-ssc-util.c:699
#12 0x453dbc in ndmp_sendGetStateReq (sess=3D0x10114000) at
ndmp-data.c:3669
#13 0x4344e4 in ndmp_procSession (sess=3D0x10114000) at ndmp-main.c:3937
#14 0x42e3c4 in ndmp_acceptClient (serverFd=3D12) at ndmp-main.c:2490
#15 0x43009c in main (argc=3D1, argv=3D0x7ffffe64) at ndmp-main.c:2881
(gdb)          =20
