From owner-freebsd-current@FreeBSD.ORG Wed Jan 28 11:46:12 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 011181065674 for ; Wed, 28 Jan 2009 11:46:12 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from smtp-1.dlr.de (smtp-1.dlr.de [195.37.61.185]) by mx1.freebsd.org (Postfix) with ESMTP id 8BD418FC12 for ; Wed, 28 Jan 2009 11:46:11 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from beagle.kn.op.dlr.de ([129.247.178.136]) by smtp-1.dlr.de over TLS secured channel with Microsoft SMTPSVC(6.0.3790.1830); Wed, 28 Jan 2009 12:46:08 +0100 Date: Wed, 28 Jan 2009 12:46:10 +0100 (CET) From: Harti Brandt X-X-Sender: brandt_h@beagle.kn.op.dlr.de To: Channa In-Reply-To: <515c64960901280339m17fa9309v2e1bc3f55454ab@mail.gmail.com> Message-ID: <20090128124535.M26828@beagle.kn.op.dlr.de> References: <515c64960901280339m17fa9309v2e1bc3f55454ab@mail.gmail.com> X-OpenPGP-Key: harti@freebsd.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 28 Jan 2009 11:46:08.0964 (UTC) FILETIME=[02AD5840:01C9813E] Cc: freebsd-current@freebsd.org Subject: Re: Jemalloc SEGV for 1MB chunk X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Harti Brandt List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2009 11:46:12 -0000 On Wed, 28 Jan 2009, Channa wrote: C>Hi All, C>I am using jemalloc.c source from FreeBSD-current source. C>When i allocate 1MB of memory using malloc() and use it as the below C>test shows C> C>#include C>#include C>#include C> C>int main() C>{ C> int i; C> char *buf; C> size_t size = 1048576 ; C> C> buf = malloc(size); C> for (i = 0; i < 1048576; i++) C> buf[i] = 'a'; C> printf("The length of buff is : %d\n",strlen(buf)); C> free(buf); C> return 0; C>} C> C>When i try to call strlen(buf) SEGV is recived. Would be better to terminate the string with a '\0' so that it is really a string. harti C> C>This behaviour is seen when only for 1MB chunk if i allocate C>memory lesser than 1MB no issues noticed. C> C>Could anyone see similar problem? C>Is the above test wrong? C>Or some issue with huge memory allocation in jemalloc? C> C>Your response will be very helpful. C> C>Thanks & Regards, C>Channa C>_______________________________________________ C>freebsd-current@freebsd.org mailing list C>http://lists.freebsd.org/mailman/listinfo/freebsd-current C>To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" C> C>