Skip to contentSkip to conversation

allow core files bigger than 2GB

PATCH-2.4 Willy Tarreau 2 participants 3 messages Jun 17, 2006 – Jun 18, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Marcelo,

I think I have not sent you this one. It looks valid to me. I can queue it in -upstream if you prefer to pull everything at once.

Cheers,
Willy
--

Quoted 1 line

From nobody Mon Sep 17 00:00:00 2001

From: Javier Olivares <[email protected]>
Date: Wed, 31 May 2006 00:32:59 +0200
Subject: [PATCH] bug fix for 2GB core limit in 2.4

We were having problems when running programs that used over 2GB of ram not being able to generate core files over 2GB, these are some very simple changes that fixed the problem.

The changes have been running on many Debian systems for a couple of months. Valid core files just over 3GB have been created without any problem.

---

 fs/binfmt_elf.c |    2 +-
 fs/exec.c       |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

04d0e7780b49eeef578ceec8901c71ac356df504

fs/binfmt_elf.c +1 -1
index b0ad905..6c2f357 100644
@@ -1026,7 +1026,7 @@ static int dump_write(struct file *file,
 	return file->f_op->write(file, addr, nr, &file->f_pos) == nr;
 }
 
-static int dump_seek(struct file *file, off_t off)
+static int dump_seek(struct file *file, loff_t off)
 {
 	if (file->f_op->llseek) {
 		if (file->f_op->llseek(file, off, 0) != off)
fs/exec.c +2 -1
index f196e7e..aec92be 100644
@@ -1148,7 +1148,8 @@ int do_coredump(long signr, struct pt_re
 		goto fail;
 
  	format_corename(corename, core_pattern, signr);
-	file = filp_open(corename, O_CREAT | 2 | O_NOFOLLOW, 0600);
+	file = filp_open(corename,
+	                 O_CREAT | 2 | O_NOFOLLOW | O_LARGEFILE, 0600);
 	if (IS_ERR(file))
 		goto fail;
 	inode = file->f_dentry->d_inode;
Signature · 1 line
1.3.3
#1 lore raw
Quoted 5 lines · Willy Tarreau

Marcelo,

I think I have not sent you this one. It looks valid to me. I can queue it in -upstream if you prefer to pull everything at once.

Hi,

This is a rather complex issue, to the point that your patch is not sufficient actually. While it will create a core file, it's not really a good one, and there are some nasty other issues with it (esp on 64 bit systems). The enterprise distro kernels have a more complete patch for this (I'm pretty sure both RH and SUSE have fundamentally the same patch for this), if you really want this functionality I suggest getting the patch from either of those distros to get the full thing (there's some security angle to this even iirc).

Greetings,
Arjan van de Ven

#2 lore raw
Quoted 10 lines · Arjan van de Ven
Quoted 5 lines · Willy Tarreau

Marcelo,

I think I have not sent you this one. It looks valid to me. I can queue it in -upstream if you prefer to pull everything at once.

Hi,

Quoted 8 lines

This is a rather complex issue, to the point that your patch is not sufficient actually. While it will create a core file, it's not really a good one, and there are some nasty other issues with it (esp on 64 bit systems). The enterprise distro kernels have a more complete patch for this (I'm pretty sure both RH and SUSE have fundamentally the same patch for this), if you really want this functionality I suggest getting the patch from either of those distros to get the full thing (there's some security angle to this even iirc).

Thanks for notifying us about this Arjan. I've checked in RHEL patches and found that this is done in 2.4.21-binfmt-elf.patch with a detailed explanation. The patch is rather large, not to say invasive. I believe it serves other purposes but it seems to me that it will still be invasive enough not to be merged into 2.4 mainline right now.

Quoted 2 lines

Greetings,
Arjan van de Ven

Regards,
Willy