From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E19643858D33; Mon, 26 Dec 2022 12:59:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E19643858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1672059552; bh=5u/p0XUgVBmFcqAxn0Nw6aqVZcrEF9w77qFcywc0DUo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=grqIBtqY1iXtixVWcQ9UAuljtZCKkZghh9vGYtQ91iNNgeR/ZC1ilkVwCUTN+dKoI OXeTdOlcVPRxSArEvI49RVa412+BgmKhnGY2ZMf7So2+o3L3qqyfrq6Bu1zbke1USj vcp4L8OceTZLTAKqovplMFuy5h/BSdjNrKfH8kgQ= From: "aburgess at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/29941] Inferior call strlen(p) gives segfaults in GDB 13, (somewhat?) works in GDB11 and GDB12 Date: Mon, 26 Dec 2022 12:59:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: aburgess at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: 13.1 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: target_milestone cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29941 Andrew Burgess changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |13.1 CC| |aburgess at redhat dot com --- Comment #3 from Andrew Burgess --- I think that for now a better fix would be something like the totally untes= ted patch below which uses prepare_reinflate and reinflate. Simon has a patch on-list that removes the need for calling prepare_reinfla= te and reinflate, but I doubt that will be merged to the GDB13 branch, it's a pretty big change. Also worth noting that I can't reproduce the original failure on my x86-64 machine, and I don't have time to setup an environment where I can test thi= s as a fix right now. ### START ### diff --git a/gdb/infcall.c b/gdb/infcall.c index c1db3e22189..ec9669a6b6a 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -848,6 +848,7 @@ call_function_by_hand_dummy (struct value *function, bool stack_temporaries =3D thread_stack_temporaries_enabled_p (call_thre= ad.get ()); frame =3D get_current_frame (); + frame.prepare_reinflate (); gdbarch =3D get_frame_arch (frame); if (!gdbarch_push_dummy_call_p (gdbarch)) @@ -863,6 +864,8 @@ call_function_by_hand_dummy (struct value *function, "target calling convention."), get_function_name (funaddr, name_buf, sizeof (name_buf))); + frame.reinflate (); + if (values_type =3D=3D NULL || values_type->is_stub ()) values_type =3D default_return_type; if (values_type =3D=3D NULL) ### END ### --=20 You are receiving this mail because: You are on the CC list for the bug.=