linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@linux.intel.com>
To: Holger Brunck <holger.brunck@keymile.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Cc: "mingo@kernel.org" <mingo@kernel.org>
Subject: Re: debug problems on ppc 83xx target due to changed struct task_struct
Date: Fri, 12 Aug 2016 09:09:04 -0700	[thread overview]
Message-ID: <57ADF4A0.5040807@linux.intel.com> (raw)
In-Reply-To: <4e16aad4-80d3-ffcc-d183-681b48d4751b@keymile.com>

On 08/12/2016 08:47 AM, Holger Brunck wrote:
> On 12/08/16 17:14, Dave Hansen wrote:
>> On 08/12/2016 07:50 AM, Holger Brunck wrote:
>>> When I try to debug our multithreaded userspace application with gdb I  get
>>> stuck when trying to single step code.
>>
>> Can you clarify "stuck"?  Like the instructions don't advance?  Have you
>> been able to find a root cause for this?
> 
> the behaviour is slightly different on the kernel versions. So my setup is a
> remote debug session via gdbserver.
> 
> After connecting to the gdbserver I set a break point and start to run my
> program. When hitting the breakpoint I try to single step. With stuck I mean
> that the connection to the gdbserver is broken and I can't control my debug
> session anymore while the application is not continuing.

Could you try debugging locally with gdb?  It would be nice to take all
the stuff involved with remote debugging out of the picture.

Have you tried turning on a bunch of kernel debugging (SLAB/SLUB
debugging, pagealloc debug, lockdep, etc...)?  If something is getting
corrupted, those tend to catch it.

> On Kernel 4.2 I got additionally the following dump in my serial terminal:
> 
> ------------[ cut here ]------------
> WARNING: at
> /opt/keymile/ws_root/git_repositories/prod/keyne/plat/kernel/gpl/kernel/sched/core.c:1975
> Modules linked in:
> CPU: 0 PID: 0 Comm: swapper Not tainted 4.2.0-00003-g0478a57 #10
> task: c04213d0 ti: c0434000 task.ti: c0434000
> NIP: c003c4ac LR: c005d7f0 CTR: c005d7c8
> REGS: c0435ce0 TRAP: 0700   Not tainted  (4.2.0-00003-g0478a57)
> MSR: 00021032 <ME,IR,DR,RI>  CR: 22044228  XER: 20000000
> 
> GPR00: c005dfd8 c0435d90 c04213d0 cfba7a70 c042624c 00000000 00000001 00000000
> GPR08: 00000001 00000001 00000007 ffffffff 42044228 eec349c0 00000000 00000000
> GPR16: 0fe75f34 c0434000 0000000a c005d7c8 00000001 0000000a c0430000 c042624c
> GPR24: 7ffc66b5 7ffc66b5 00000001 c0434000 0000000a c0426240 cfb81e90 c04261e0
> NIP [c003c4ac] wake_up_process+0x10/0x20
> LR [c005d7f0] hrtimer_wakeup+0x28/0x44
> Call Trace:
> [c0435d90] [c0426240] 0xc0426240 (unreliable)
> [c0435da0] [c005dfd8] __hrtimer_run_queues.constprop.7+0x114/0x214
> [c0435df0] [c005e334] hrtimer_interrupt+0xb8/0x29c
> [c0435e40] [c0009c80] __timer_interrupt+0xb8/0x1c4
> [c0435e60] [c000a03c] timer_interrupt+0x8c/0xb8
> [c0435e90] [c000ece4] ret_from_except+0x0/0x14
> --- interrupt: 901 at arch_cpu_idle+0x24/0x6c
>     LR = arch_cpu_idle+0x24/0x6c
> [c0435f50] [c0434000] 0xc0434000 (unreliable)
> [c0435f60] [c0044cc0] cpu_startup_entry+0x138/0x1cc
> [c0435fb0] [c03fdde0] start_kernel+0x32c/0x340
> [c0435ff0] [00003438] 0x3438
> 
> 
> This trace is missing when I try the same with latest kernel 4.7. But the
> behaviour is similar. The board is still reachable via telnet but I need to kill
> the gdbserver session manually to get control over the initial serial terminal
> again. When I move the mentioned line of code everything works fine.

I think that warning was just a false positive.  It got removed:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=119d6f6a3be8b

Is the process still alive at the point that the remote debugger stops
responding?  What is it doing at that point?

  reply	other threads:[~2016-08-12 16:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-12 14:50 debug problems on ppc 83xx target due to changed struct task_struct Holger Brunck
2016-08-12 15:14 ` Dave Hansen
2016-08-12 15:47   ` Holger Brunck
2016-08-12 16:09     ` Dave Hansen [this message]
2016-08-15 14:35       ` Holger Brunck
2016-08-15 16:19         ` Dave Hansen
2016-08-16 17:27           ` christophe leroy
2016-08-16 17:36             ` Dave Hansen
2016-08-17  8:22               ` Christophe Leroy
2016-08-17 15:27             ` Holger Brunck
2016-08-18  8:23               ` Christophe Leroy
2016-08-19 11:03               ` Christophe Leroy
2016-08-19 11:14                 ` Holger Brunck
2016-08-19 13:44                   ` Christophe Leroy
2016-08-19 16:26                     ` Holger Brunck
2016-08-16 22:13           ` Benjamin Herrenschmidt
2016-08-17 15:05             ` Holger Brunck
2016-08-17 14:59           ` Holger Brunck

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=57ADF4A0.5040807@linux.intel.com \
    --to=dave.hansen@linux.intel.com \
    --cc=holger.brunck@keymile.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mingo@kernel.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;
as well as URLs for NNTP newsgroup(s).