WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Fix core dumps of guests > 2 GB in size on i386

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Fix core dumps of guests > 2 GB in size on i386
From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Date: Wed, 15 Nov 2006 22:02:21 +0000
Delivery-date: Wed, 15 Nov 2006 14:02:40 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
During testing of Xen 3.0.3 tree we discovered that core dumps of guests
with more than 2 GB of RAM would fail on i386 platforms. A quick look at
the libxc code for generating core files shows that it does not use the
O_LARGEFILE flag or explicit open64 function when opening the file. Thus
the file is limited to 2^31-1 bytes.

The attached patch adds the O_LARGEFILE flag when opening the file. It
is also neccessary to add additional CFLAGS & LDFLAGS to enable use of
the POSIX Largefile  standard.  There are two ways to enable LFS support,
in implicit mode all types, functions & macros are automatically changed
to the 64 bit variants at compile time - this however changes the ABI
contract - eg size_t is now 64-bits instead of 32. The alternate is the
explicit mode, which merely makes 64-bit variants of the calls available
and thus preserves ABI. Thus in this patch I use the explicit LFS mode
and then pass O_LARGEFILE to the open() call flags.

Without this patch you see:

  # xm list
  xm Name                                      ID Mem(MiB) VCPUs State   Time(s)
  Domain-0                                   0     1485     4 r-----   4905.3
  coretest                                   9     2556     1 -b----     15.0
  # xm dump-core coretest
  Dumping core of domain: coretest ...
  Error: Failed to dump core: (27, 'File too large')
  Usage: xm dump-core [-L|--live] [-C|--crash] <Domain> [Filename]
  # ls -l /var/xen/dump/
  total 4721672
  -rw------- 1 root root 2147483647 Nov 15 16:33 
2006-1115-1632.46-coretest.9.core-incomplete


With this patch applied:

  # xm list
  Name                                      ID Mem(MiB) VCPUs State   Time(s)
  Domain-0                                   0     1485     4 r-----     29.6
  coretest                                   1     2556     1 r-----      3.1
  # xm dump-core coretest
  Dumping core of domain: coretest ...
  # ls -l /var/xen/dump/
  total 4721672
  -rw------- 1 root root 2682781696 Nov 15 16:58 
2006-1115-1657.33-coretest.1.core



  Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>

Regards,
Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

Attachment: xen-core-2gb.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>