From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6225 invoked by alias); 29 Sep 2009 10:20:35 -0000 Received: (qmail 6207 invoked by uid 22791); 29 Sep 2009 10:20:32 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 29 Sep 2009 10:20:27 +0000 Received: (qmail 28880 invoked from network); 29 Sep 2009 10:20:24 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 29 Sep 2009 10:20:24 -0000 From: Pedro Alves To: gdb@sourceware.org Subject: Re: reg: GDB's generate-core-file option Date: Tue, 29 Sep 2009 10:20:00 -0000 User-Agent: KMail/1.9.10 Cc: Michael Snyder , Aarthy References: <30ca7ede0909281909n40cccc62m8e3c574546f7208f@mail.gmail.com> <4AC18D2F.5080809@vmware.com> In-Reply-To: <4AC18D2F.5080809@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909291120.42397.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00320.txt.bz2 On Tuesday 29 September 2009 05:29:35, Michael Snyder wrote: > > The > > problem is that for one process i get the following error. > > > > warning: Failed to write corefile contents (No space left on device). > > ../../gdb/utils.c:1058: internal-error: virtual memory exhausted: > > can't allocate 92123136 bytes. > > This is an out-of-memory error. It comes from function "nomem()" > in utils.c, and results from the failure of an xmalloc() call. > > There is only one xmalloc() call in gcore.c, it looks like this: > > memhunk = xmalloc (size); A bit more context around that line on current-ish GDB sources, shows: size = min (total_size, MAX_COPY_BYTES); memhunk = xmalloc (size); and MAX_COPY_BYTES is described as: /* The largest amount of memory to read from the target at once. We must throttle it to limit the amount of memory used by GDB during generate-core-file for programs with large resident data. */ #define MAX_COPY_BYTES (1024 * 1024) If this is a recent GDB, it can't be that particular xmalloc call. You must have an old GDB? This MAX_COPY_BYTES cap was added in 2006. > > warning: Failed to write corefile contents (No space left on device). ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Note that this happens before gdb's internal error. You're already going to end up with a partial core. -- Pedro Alves