linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: "qiwu.chen" <qiwuchen55@gmail.com>
Cc: corbet@lwn.net, mhocko@suse.com, jani.nikula@intel.com,
	akpm@linux-foundation.org, brauner@kernel.org,
	paulmck@kernel.org, linux-doc@vger.kernel.org,
	"qiwu.chen" <qiwu.chen@transsion.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] exit: dump current pt_regs info on global init exit
Date: Sun, 22 Sep 2024 14:54:59 +0200	[thread overview]
Message-ID: <20240922125458.GA9426@redhat.com> (raw)
In-Reply-To: <20240922095504.7182-2-qiwu.chen@transsion.com>

Add lkml.

On 09/22, qiwu.chen wrote:
>
> @@ -847,10 +848,12 @@ void __noreturn do_exit(long code)
>  		 * If the last thread of global init has exited, panic
>  		 * immediately to get a useable coredump.
>  		 */
> -		if (unlikely(is_global_init(tsk)))
> +		if (unlikely(is_global_init(tsk))) {
> +			/* dump the pt_regs of current thread for debugging. */
> +			show_regs(task_pt_regs(tsk));
>  			panic("Attempted to kill init! exitcode=0x%08x\n",
>  				tsk->signal->group_exit_code ?: (int)code);

Well, this means that show_regs() will be called twice if CONFIG_DEBUG_BUGVERBOSE
at least on x86, see dump_stack() in panic(). See also show_regs_if_on_stack()
in show_trace_log_lvl().

Not good...

Oleg.


  reply	other threads:[~2024-09-22 12:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-22  9:55 [PATCH v3 1/2] panic: add option to dump task maps info in panic_print qiwu.chen
2024-09-22  9:55 ` [PATCH v3 2/2] exit: dump current pt_regs info on global init exit qiwu.chen
2024-09-22 12:54   ` Oleg Nesterov [this message]
2024-09-23  5:11     ` chenqiwu
2024-09-22 13:12 ` [PATCH v3 1/2] panic: add option to dump task maps info in panic_print Oleg Nesterov
2024-09-23  4:08   ` chenqiwu
2024-09-22 13:13 ` Oleg Nesterov

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=20240922125458.GA9426@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=corbet@lwn.net \
    --cc=jani.nikula@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=paulmck@kernel.org \
    --cc=qiwu.chen@transsion.com \
    --cc=qiwuchen55@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).