From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OFQnFeAgaGdcfSkAWB0awg (envelope-from ) for ; Sun, 22 Dec 2024 09:23:28 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=default header.b=Yoq7jv5K; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 5332A1E097; Sun, 22 Dec 2024 09:23:28 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0287C1E05C for ; Sun, 22 Dec 2024 09:23:28 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 97E6C385841D for ; Sun, 22 Dec 2024 14:23:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 97E6C385841D Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=default header.b=Yoq7jv5K Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 13E4F3858D3C for ; Sun, 22 Dec 2024 14:22:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 13E4F3858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 13E4F3858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734877373; cv=none; b=AO7i9pq+SeivNQH4y8p9rOL7RXC/IGeOrki9WeqIJCtGbsf7t8xIxRmh1ftpXNckq+DhyEcLUa3BZbI7/JpeXFNhtfuIqJFPvYW8cVWfjXDVtmLNympUojAiohJ6FLVhL+HffOINCYnRasV1P0aBzI/vqtF0iHYlyiImsgtWd6Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1734877373; c=relaxed/simple; bh=s3OAGhw8jRxLehjt6tPwMP3u1QXGsAoQ4XT5mZEEBkU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=L3naaVnyUAIWE7yKAgkC+AW0acIQSWsNBa0ff2i2zwCDwjsVa7qq73Vl+U/5bQmiNF/F4l26V1UOi+34S1GpCVO2QpBw9wdFgVx8DzkH8XQxqQqA1+fTVZKMKwjeSO5ym3LK7IzIH0fRSAsAugn4vT0o9UWPIYjDqVfxu/TMr00= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13E4F3858D3C Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 4BMEMlIg090737 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 22 Dec 2024 09:22:52 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 4BMEMlIg090737 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1734877372; bh=AkaREJWLA6z2a0hjHREfojYNMLjZrVm4J/KqwJGsZrs=; h=Date:Subject:To:Cc:From:In-Reply-To:From; b=Yoq7jv5Kp+fWk+GTU9HMMiGSBlEDlFoh+4brvN6DWTSFkY0P3c+zO//2APmaDnQnh GRITVUGjtvvoDSalWZP9PpYqi4dtUU9lvJoEh/rS8byow8o4rBCaUAlv8zRlFhR9ln PdXxSwpFMgr9jJWiY5L5XH+hG8RZ84EdJIimkNvw= Received: by simark.ca (Postfix, from userid 112) id A4BE91E0BB; Sun, 22 Dec 2024 09:22:47 -0500 (EST) Received: from [10.0.0.11] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id C27AA1E05C; Sun, 22 Dec 2024 09:22:45 -0500 (EST) Message-ID: <45c1954c-866b-4e91-8d12-8c2f0d59fbb6@polymtl.ca> Date: Sun, 22 Dec 2024 09:22:45 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gdb/jit: fix jit-reader linetable integrity To: liuyang22 , gdb-patches Cc: tom References: Content-Language: en-US From: Simon Marchi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sun, 22 Dec 2024 14:22:47 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 2024-12-22 06:46, liuyang22 wrote: > On Dec 22, 2024 10:12, Simon Marchi 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