mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Erik Mouw <erik@harddisk-recovery.com>
To: Karel Kulhavy <clock@twibright.com>
Cc: linux-kernel@vger.kernel.org, kai@germaschewski.name, sam@ravnborg.org
Subject: Re: modpost change proposed
Date: Fri, 23 Jun 2006 14:12:51 +0200	[thread overview]
Message-ID: <20060623121250.GG14682@harddisk-recovery.com> (raw)
In-Reply-To: <20060623113138.GA29844@kestrel.barix.local>

On Fri, Jun 23, 2006 at 01:31:38PM +0200, Karel Kulhavy wrote:
> If the modpost has error it dumps core:
> modpost: vmlinux no symtab?
> /bin/sh: line 1: 28307 Aborted                 (core dumped)
> scripts/mod/modpost -o
> /home/clock/edb9302/cirrus-arm-linux-1.0.7/linux-2.6.8.1/Module.symvers
> vmlinux drivers/net/wireless/hermes.o drivers/net/wireless/orinoco.o
> drivers/net/wireless/orinoco_cs.o drivers/usb/gadget/g_file_storage.o
> make[1]: *** [__modpost] Error 134
> 
> I suggest the abort(); to be everywhere replaced with exit(1) for the
> following reasons:
> 1) it's customary

It's not. In case of a serious error, abort() gives you the chance to
do a post mortem analysis with a debugger, exit() doesn't. I do agree
that the use of abort() in modpost is not necessary. Try this patch
(against 2.6.17):

commit 726ee2748969fb2d40b45de36dd56a5abea37954
Author: Erik Mouw <erik@harddisk-recovery.com>
Date:   Fri Jun 23 14:04:52 2006 +0200

    modpost: change abort() into exit()
    
    The perror() above the abort() tells enough about the
    failure, no need to dump core (a post mortem analysis
    on the core file won't give extra information about the
    failure). Suggested by Karel Kulhavy.
    
    Signed-off-by: Erik Mouw <erik@harddisk-recovery.com>

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index d0f86ed..42a2bc0 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -283,7 +283,7 @@ static void parse_elf(struct elf_info *i
 	hdr = grab_file(filename, &info->size);
 	if (!hdr) {
 		perror(filename);
-		abort();
+		exit(1);
 	}
 	info->hdr = hdr;
 	if (info->size < sizeof(*hdr))

> 2) core dumping looks scary

If it scares you, disable it. "limit coredumpsize 0" in (t)csh, or
"ulimit -c 0" in bash.

> 3) the core takes up space on disk

If you don't like it, disable it.


Erik

-- 
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands

  reply	other threads:[~2006-06-23 12:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-23 11:31 Karel Kulhavy
2006-06-23 12:12 ` Erik Mouw [this message]
2006-06-24 21:47   ` Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060623121250.GG14682@harddisk-recovery.com \
    --to=erik@harddisk-recovery.com \
    --cc=clock@twibright.com \
    --cc=kai@germaschewski.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®