From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2D80B3854834; Fri, 30 Apr 2021 14:56:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D80B3854834 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/27806] free(): invalid pointer during gdb.ada/fixed_cmp.exp Date: Fri, 30 Apr 2021 14:56:03 +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: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 14:56:04 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27806 --- Comment #13 from Tom de Vries --- Well, this works: ... diff --git a/gdb/guile/guile.c b/gdb/guile/guile.c index 9c2a40b61be..71e74892ab3 100644 --- a/gdb/guile/guile.c +++ b/gdb/guile/guile.c @@ -664,10 +664,19 @@ gdbscm_finish_initialization (const struct extension_langua ge_defn *extlang) { gdb::block_signals blocker; + /* Save libgmp memory functions. */ + void *(*alloc_func) (size_t); + void *(*realloc_func) (void *, size_t, size_t); + void (*free_func) (void *, size_t); + mp_get_memory_functions (&alloc_func, &realloc_func, &free_func); + /* scm_with_guile is the most portable way to initialize Guile. Plus we need to initialize the Guile support while in Guile mode (e.g., called from within a call to scm_with_guile). */ scm_with_guile (call_initialize_gdb_module, NULL); + + /* Restore libgmp memory functions. */ + mp_set_memory_functions (alloc_func, realloc_func, free_func); } /* Set Guile's backtrace to match the "set guile print-stack" default. ... --=20 You are receiving this mail because: You are on the CC list for the bug.=