From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D83913857C78; Fri, 30 Apr 2021 14:29:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D83913857C78 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:29: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: 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:29:12 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27806 --- Comment #9 from Tom de Vries --- Two relevant pieces from guile.git/NEWS: ... ** Fix important incompatibility with GnuTLS Guile uses the GNU multi-precision (GMP) library to implement arbitrary-precision integers (bignums) and fractions. Usually Guile is built to dynamically link to libgmp. In this configuration, any other user of GMP in the process uses the same libgmp instance, with the same shared state. An important piece of shared state is the GMP allocator, responsible for allocating storage for the digits of large integers. For Guile it's most efficient to install libgc as the GMP allocator. That way Guile doesn't need to install finalizers, which have significant overhead, to free GMP values when Guile bignums are collected. Using libgc to allocate digits also allows Guile's GC to adequately measure the memory cost of these values. However, if the Guile process is linked to some other user of GMP, then probably the references from the other library to GMP values aren't visible to the garbage collector. In this case libgc could prematurely collect values from that other GMP user. This isn't theoretical, sadly: it happens for Guile-GnuTLS. GnuTLS uses GMP, and so does Guile. Since Guile 2.0.4, Guile has installed libgc as the GMP allocator, so since then, Guile-GnuTLS has been buggy. Therefore, the default is now to not install libgc as the GMP allocator. This may slow down some uses of bignums. If you know that your Guile program will never use a library that uses GMP, you can set the GUILE_INSTALL_GMP_MEMORY_FUNCTIONS=3D1 in your environment. Guile sets this environment variable when building Guile, for example. See "Environment Variables" in the manual, for more. In some future, Guile may switch to GMP's more low-level "MPN" API for working with bignums, which would allow us to regain the ability to use GC-managed digit storage in all configurations. ** New build option: --enable-mini-gmp For some users, it would be preferable to bundle a private copy of the GMP bignum library into Guile. Some users would like to avoid the extra dependency. Others would like to use libgc to manage GMP values, while not perturbing the GMP allocator for other GMP users. For these cases, Guile now has an --enable-mini-gmp configure option, which will use a stripped-down version of GMP, bundled with Guile. This code doesn't have all the algorithmic optimizations of full GMP, but implements the same API in a basic way. It can be more optimal in a Guile context, given that it can use libgc to allocate its data. Note that a build with --enable-mini-gmp is not ABI-compatible with a "stock" build, as functions that use GMP types (scm_to_mpz, scm_from_mpz) are not exported. Thanks to Niels M=C3=B6ller and other GMP developers for their mini-gmp implementation! ... --=20 You are receiving this mail because: You are on the CC list for the bug.=