mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Greg Ungerer <gerg@linux-m68k.org>,
	Tomas Glozar <tglozar@redhat.com>
Subject: Re: [PATCH RFC 0/2] Add basic tracing support for m68k
Date: Wed, 20 Nov 2024 16:59:55 +0100	[thread overview]
Message-ID: <2dc1cdfa-d33a-48b6-ab77-d04b06a3efe8@yoseli.org> (raw)
In-Reply-To: <20241120103150.3442d658@gandalf.local.home>

Hi Steve,

On 20/11/2024 16:31, Steven Rostedt wrote:
> On Wed, 20 Nov 2024 12:47:19 +0100
> Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.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?

Yes, I did, sorry I thought it was in the previous dump :-(.

kbuffer_load_subbuffer: kbuf 0x8001d520, ptr 0x8025e2a0, call read_8
read_8
swap_8
kbuffer_load_subbuffer: kbuf 0x8001d520, ptr 0x8025e2a8, read_long
read_long: call read_long at 0x60022ef4 with 0x8025e2a8
__read_long_4: call read_4 at 0x600230de with 0x8025e2a8
__read_4_sw with 0x8025e2a8
__read_4_sw: ptr=0x8025e2a8, value: 00001ff0
__read_4_sw: data=00001ff0
swap_4 for 00001ff0
__read_long_4: --> read_4 at 0x600230de: f01f0000
__read_4_sw with 0x8025e2a8
__read_4_sw: ptr=0x8025e2a8, value: 00001ff0
__read_4_sw: data=00001ff0
swap_4 for 00001ff0
read_long: --> read_long at 0x60022ef4: f01f0000
__read_long_4: call read_4 at 0x600230de with 0x8025e2a8
__read_4_sw with 0x8025e2a8
__read_4_sw: ptr=0x8025e2a8, value: 00001ff0
__read_4_sw: data=00001ff0
swap_4 for 00001ff0
__read_long_4: --> read_4 at 0x600230de: f01f0000
__read_4_sw with 0x8025e2a8
__read_4_sw: ptr=0x8025e2a8, value: 00001ff0
__read_4_sw: data=00001ff0
swap_4 for 00001ff0
kbuffer_load_subbuffer: --> read_long,  flags=f01f0000
kbuffer_load_subbuffer: --> size=1f0000
kbuffer_load_subbuffer: kbuf->data=0x8025e2ac, kbuf->size=1f0000
kbuffer_load_subbuffer: kbuf 0x8001d520, ptr 0x8044e2ac, read_long 
lost_events
read_long: call read_long at 0x60022ef4 with 0x8044e2ac
__read_long_4: call read_4 at 0x600230de with 0x8044e2ac
__read_4_sw with 0x8044e2ac
Segmentation fault

JM

  reply	other threads:[~2024-11-20 15:59 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-21  9:44 Jean-Michel Hautbois
2024-10-21  9:44 ` [PATCH RFC 1/2] m68k: Add tracirqs Jean-Michel Hautbois
2024-10-22  5:28   ` Steven Rostedt
2024-10-22  5:42     ` Jean-Michel Hautbois
2024-10-22  8:30       ` Steven Rostedt
2024-10-22  9:21         ` Jean-Michel Hautbois
2024-10-23  8:47           ` Steven Rostedt
2024-10-23  9:07             ` Jean-Michel Hautbois
2024-10-23  9:13               ` Geert Uytterhoeven
2024-10-23  9:31                 ` Jean-Michel Hautbois
2024-10-23 10:30                   ` Jean-Michel Hautbois
2024-10-23  3:53   ` Michael Schmitz
2024-10-23  5:53     ` Jean-Michel Hautbois
2024-10-23  7:30       ` Michael Schmitz
2024-10-23  8:59         ` Jean-Michel Hautbois
2024-10-23  9:27           ` Steven Rostedt
2024-10-23  8:51       ` Eero Tamminen
2024-10-21  9:44 ` [PATCH RFC 2/2] arch: m68k: Add STACKTRACE support Jean-Michel Hautbois
2024-11-27 11:26   ` Jean-Michel Hautbois
2024-12-02 14:41     ` Greg Ungerer
2024-12-02 14:51       ` Jean-Michel Hautbois
2024-12-02 14:52       ` Jean-Michel Hautbois
2024-12-02 23:01         ` Greg Ungerer
2024-12-03  6:25           ` Jean-Michel Hautbois
2024-12-02 17:53       ` Jean-Michel Hautbois
2024-11-15  8:26 ` [PATCH RFC 0/2] Add basic tracing support for m68k Jean-Michel Hautbois
2024-11-15 15:25   ` Steven Rostedt
2024-11-15 15:33     ` Jean-Michel Hautbois
2024-11-15 19:55       ` Steven Rostedt
2024-11-18 10:11         ` Jean-Michel Hautbois
2024-11-18 20:20           ` Steven Rostedt
2024-11-19 14:24             ` Jean-Michel Hautbois
2024-11-19 15:26               ` Steven Rostedt
2024-11-19 16:28                 ` Steven Rostedt
2024-11-19 16:44                   ` Steven Rostedt
2024-11-19 18:06                   ` Jean-Michel Hautbois
2024-11-19 18:10                     ` Steven Rostedt
2024-11-20 11:47                       ` Jean-Michel Hautbois
2024-11-20 15:31                         ` Steven Rostedt
2024-11-20 15:59                           ` Jean-Michel Hautbois [this message]
2024-11-20 16:43                             ` Steven Rostedt
2024-11-20 16:51                               ` Jean-Michel Hautbois
2024-11-19 18:25                     ` Michael Schmitz
2024-11-28 15:25           ` Tomas Glozar
2024-12-02 12:53             ` Jean-Michel Hautbois
2024-12-02 14:45               ` Tomas Glozar

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=2dc1cdfa-d33a-48b6-ab77-d04b06a3efe8@yoseli.org \
    --to=jeanmichel.hautbois@yoseli.org \
    --cc=geert@linux-m68k.org \
    --cc=gerg@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglozar@redhat.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

all inboxes | Powered by JetHome®