Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: liuyang22 <liuyang22@iscas.ac.cn>,
	gdb-patches <gdb-patches@sourceware.org>
Cc: tom <tom@tromey.com>
Subject: Re: [PATCH] gdb/jit: fix jit-reader linetable integrity
Date: Sun, 22 Dec 2024 09:22:45 -0500	[thread overview]
Message-ID: <45c1954c-866b-4e91-8d12-8c2f0d59fbb6@polymtl.ca> (raw)
In-Reply-To: <tencent_30FF6E92AE8DFECE006189C4@qq.com>



On 2024-12-22 06:46, liuyang22 wrote:
> On Dec 22, 2024 10:12, Simon Marchi<simon.marchi@polymtl.ca> wrote:
>> On 2024-12-21 03:30, Yang Liu wrote:
>> > The custom linetable functionality in GDB's JIT Interface has been broken
>> > since commit 1acc9dca423f78e44553928f0de839b618c13766.
>> > 
>> > In that commit, linetables were made independent from the objfile, which
>> > requires objfile->section_offsets to be initialized. However, section_offsets
>> > were never initialized in objfiles generated by GDB's JIT Interface
>> > with custom jit-readers, leading to GDB crashes when stepping into JITed code
>> > blocks with the following command already executed:
>> >
>> > jit-reader-load libmygdbjitreader.so
>> >
>> > This patch fixes the issue by initializing the minimum section_offsets required
>> > for linetable parsing procedures.
>>
>> I can imagine how the problem can manifest, but do you have a
>> reproducer? I tried stepping with the binary of test
>> gdb.base/jit-reader.exp, but I couldn't get it to crash. Ideally, this
>> fix should come with a test to demonstrate the problem and the fix.
>> 
> 
> Hi Simon,
> 
> Thanks for the review!
> 
> Below is a reproducer, but I have no idea how GDB testsuite works, is it possible
> to put this in?

Thanks for the quick response.  It should be fairly easy to turn this
into a test.  I'll give it a shot if I find a bit of free time during
the holidays.

Simon

  reply	other threads:[~2024-12-22 14:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-22 11:46 liuyang22
2024-12-22 14:22 ` Simon Marchi [this message]
2024-12-22 16:38   ` Yang Liu
  -- strict thread matches above, loose matches on Subject: below --
2024-12-22 16:31 Yang Liu
2024-12-22 16:34 ` Yang Liu
2024-12-21  8:30 Yang Liu
2024-12-22  2:12 ` Simon Marchi

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=45c1954c-866b-4e91-8d12-8c2f0d59fbb6@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=liuyang22@iscas.ac.cn \
    --cc=tom@tromey.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