[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241120103150.3442d658@gandalf.local.home>
Date: Wed, 20 Nov 2024 10:31:50 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Jean-Michel Hautbois <jeanmichel.hautbois@...eli.org>
Cc: linux-m68k@...ts.linux-m68k.org, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org, Geert Uytterhoeven
<geert@...ux-m68k.org>, Greg Ungerer <gerg@...ux-m68k.org>, Tomas Glozar
<tglozar@...hat.com>
Subject: Re: [PATCH RFC 0/2] Add basic tracing support for m68k
On Wed, 20 Nov 2024 12:47:19 +0100
Jean-Michel Hautbois <jeanmichel.hautbois@...eli.org> wrote:
> Long story short: it fails at kbuffer_load_subbuffer() call in
> read_cpu_pages().
>
> I added printf in the kbuffer helpers in libevent, and it finishes at:
> __read_long_4: call read_4 at 0x600230c2
> __read_4_sw: ptr=0x8044e2ac
>
> static unsigned int __read_4_sw(void *ptr)
> {
> printf("%s: ptr=%p, value: %08x\n", __func__, ptr, *(unsigned int *)ptr);
> unsigned int data = *(unsigned int *)ptr;
> printf("%s: data=%08x\n", __func__, data);
>
> return swap_4(data);
> }
>
> As soon as ptr is dereferenced, the segfault appears.
> ptr should be ok though, as the address is valid afaik...
But you don't know what ptr it failed on, right?
If dereferencing a pointer will crash, the below line:
printf("%s: ptr=%p, value: %08x\n", __func__, ptr, *(unsigned int *)ptr);
Will crash before printing, because you are dereferencing ptr. Perhaps you
should change this to:
printf("%s: ptr=%p\n" value: %08x\n", __func__, ptr);
printf(" value: %08x\n", *(unsigned int *)ptr);
And that way you will see what 'ptr' is before the crash. Or did you do
that already?
-- Steve
>
> I must say that now I am stuck :-(.
Powered by blists - more mailing lists