mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [Git pull] arch/x86 updates
Date: Sat, 20 Oct 2007 01:14:57 +0200	[thread overview]
Message-ID: <20071019231455.GA2267@elte.hu> (raw)
In-Reply-To: <alpine.LFD.0.999.0710191459340.26902@woody.linux-foundation.org>


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> On Fri, 19 Oct 2007, Thomas Gleixner wrote:
> > 
> > Pavel Emelyanov (1):
> >       i386: consolidate show_regs and show_registers for i386
> 
> While I think this is good otherwise, why does it do
> 
> 	printk(".. comm: %.*s .."
> 		TASK_COMM_LEN, current->comm,
> 
> instead of just using "%s" and "current->comm"? I only noticed because 
> there was an unrelated conflict around that thing.
> 
> That "current->comm" had better be NUL-terminated already, we use it 
> as such all over the place. And if it's not, *that* should be fixed.
> 
> I'm editing it back to the simpler pure string.

it might make some marginal sense to get an oops message out when 
there's stack overflow/corruption that damages task->comm. I've seen a 
good number of traces that printed out task->comm as an overlength 
string - which obscured other, possibly more important info that could 
have been printed until the system became so hosed that it would not 
print anything.

but ... this is really splitting hairs and even when the stack and hence 
the task struct is corrupted, an accidental NIL character is almost 
always a certainty. I remember only a single case in the past ~10 years 
where an oops would print a "never ending" p->comm because the 
corruption was a runaway memset to a non-0 value.

so printing it as %s should be perfectly fine too, for all practical 
purposes. (and printing it _without_ the TASK_COMM_LEN complication 
might help get out information faster in some other crash situations - 
so the argument can be made in the opposite direction too.)

	Ingo

  parent reply	other threads:[~2007-10-19 23:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-19 21:46 Thomas Gleixner
2007-10-19 22:04 ` Linus Torvalds
2007-10-19 22:19   ` Thomas Gleixner
2007-10-19 23:14   ` Ingo Molnar [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-10-17 20:05 Thomas Gleixner

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=20071019231455.GA2267@elte.hu \
    --to=mingo@elte.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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®