linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ARM: enable dumping stacks for CONFIG_SMP
@ 2012-08-26 22:46 Colin Cross
  2012-08-26 22:46 ` [PATCH 1/2] ARM: stacktrace: enable dumping stacks for SMP && FRAME_POINTER Colin Cross
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Colin Cross @ 2012-08-26 22:46 UTC (permalink / raw)
  To: linux-arm-kernel

This topic has come up before, see
http://comments.gmane.org/gmane.linux.ports.arm.kernel/102458
for the previous discussion.

SMP is now the norm for new ARM systems, and the limitation that
CONFIG_STACKTRACE doesn't work for tasks besides 'current' causes
problems.  The particular case I'm dealing with is automated
debugging information collected from /proc/<pid>/stack when
userspace detects a process is not responding.

Dumping stacktraces is currently disabled due to the worry that the
task may be running on another CPU and that the unwinder may be
unstable when presented with a stack that is being modified.  I have
attempted to harden the frame pointer based unwinder and the unwind
table based unwinder against invalid stacks.  I separated the two
into individual patches, as I expect the patch to the table unwinder
to be more controversial than the frame pointer unwinder.

Even without the hardening, unwinding a stack for a running process
is not completely untested.  When CONFIG_ARM_UNWIND is enabled,
sysrq-t calls unwind_backtrace for all tasks including running ones.
In addition, any callers to unwind_frame with preemption enabled,
including proc_pid_stack, could see a modified stack even on a UP
system (pointed out by Rabin Vincent the last time this topic came
up).

 arch/arm/kernel/stacktrace.c |   24 +++++++++++++-----------
 arch/arm/kernel/unwind.c     |   31 +++++++++++++++++++++++++++----
 2 files changed, 40 insertions(+), 15 deletions(-)

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-10-18  6:43 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-26 22:46 [PATCH 0/2] ARM: enable dumping stacks for CONFIG_SMP Colin Cross
2012-08-26 22:46 ` [PATCH 1/2] ARM: stacktrace: enable dumping stacks for SMP && FRAME_POINTER Colin Cross
2012-08-26 22:46 ` [PATCH 2/2] ARM: unwind: enable dumping stacks for SMP && ARM_UNWIND Colin Cross
2012-10-12  0:52   ` Laura Abbott
2012-10-12  9:08   ` Russell King - ARM Linux
2012-10-12 10:02     ` Dave Martin
2012-10-16  2:15       ` Colin Cross
2012-10-16 10:12         ` Dave Martin
2012-10-16 10:55           ` Russell King - ARM Linux
2012-10-16 12:26             ` Dave Martin
2012-10-16 21:53               ` Colin Cross
2012-10-16 21:30             ` Colin Cross
2012-10-18  6:43               ` Dave Martin
2012-09-23  2:52 ` [PATCH 0/2] ARM: enable dumping stacks for CONFIG_SMP Colin Cross

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).