From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C4A723A5489C; Fri, 30 Apr 2021 13:19:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C4A723A5489C 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 13:19:22 +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 13:19:22 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27806 --- Comment #3 from Tom de Vries --- Hmm, so it seems to be related to this bit of code in gdb_mpz::safe_export: ... 147 gdb::unique_xmalloc_ptr exported 148 (mpz_export (NULL, &word_countp, -1 /* order */, buf.size () /* size */, 149 endian, 0 /* nails */, exported_val.val)); ... The gdb::unique_xmalloc_ptr makes sure that free is called on exported.get (). But when I step into the allocation: ... (gdb) s __gmpz_export (data=3D0x0, countp=3D0x7fffffffcee8, order=3D-1, size=3D4, e= ndian=3D-1, nail=3D0, z=3D0x7fffffffcef0) at mpz/export.c:50 Downloading source file /usr/src/debug/gmp-6.2.1-3.1.x86_64/mpz/export.c... ... 79 data =3D (*__gmp_allocate_func) (count*size); ... it seems that it uses a garbage-collect malloc from libguile: ... (gdb) s custom_gmp_malloc (alloc_size=3D4) at numbers.c:240 Downloading source file /usr/src/debug/guile-3.0.5-2.4.x86_64/libguile/numbers.c... 240 return scm_gc_malloc_pointerless (alloc_size, "GMP"); (gdb) s scm_gc_malloc_pointerless (size=3D4, what=3D0x7ffff7ee970f "GMP") at gc-malloc.c:210 Downloading source file /usr/src/debug/guile-3.0.5-2.4.x86_64/libguile/gc-malloc.c... 210 return do_gc_malloc_atomic (size, what); (gdb) s do_gc_malloc_atomic (what=3D0x7ffff7ee970f "GMP", size=3D4) at gc-malloc.c:= 92 92 return GC_MALLOC_ATOMIC (size ? size : sizeof (void *)); (gdb) s 0x00007ffff7e2c2e8 in GC_malloc_atomic@plt () from /usr/lib64/libguile-3.0.= so.1 ... --=20 You are receiving this mail because: You are on the CC list for the bug.=