From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 22EE13858410; Fri, 22 Mar 2024 16:14:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 22EE13858410 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1711124096; bh=Hb++aQlm3Gafv/mSEhlV3Ka3Akxt/uhDAce19YetAls=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xcO3dH9jaLh+i5QnrUKgpSzzvlIA9sVTmQevdO28fK3YZMBiFEBeEmD/BIZY30xDz +AfVf2vYUa0y2JQYk5GvZ5fsC/fOGvTvJqE6Uys3v5NNXWTINPG8B1TCy7n/LRYGTq 9v8/NJlCi5PRHG4ZRG3LewCQiDZZdudkAFf44FMw= From: "tromey at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug gdb/31532] gdb/gmp-utils.c:169: internal-error: export_bits: Assertion `word_countp == 1' failed. Date: Fri, 22 Mar 2024 16:14:55 +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: 14.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tromey at sourceware dot org X-Bugzilla-Status: UNCONFIRMED 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: 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=3D31532 Tom Tromey changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tromey at sourceware dot o= rg --- Comment #2 from Tom Tromey --- This assert is a "shouldn't happen". So, it might be a bug elsewhere in that function, or it could be that your GMP is built in some unusual way. The function tries to export an MPZ value to a byte array. It tries to be careful to ensure the value will actually fit into the array. This checking is expected to rule out the case where more space is needed than what has been provided. The case where the result is 0 (and so word_countp=3D=3D0) is also handled explicitly by /* It's possible that one of the above results in zero, which has to be handled specially. */ if (exported_val->sgn () =3D=3D 0) { memset (buf.data (), 0, buf.size ()); return; } Since I don't know how to reproduce this, best would be if you could debug gdb and stop on the failure. Then we can see the actual value of word_countp, the other arguments, and perhaps even the input data -- that would let us even write a small reproducer invoking just mpz_export so we could see if some assumption about GMP is wrong. --=20 You are receiving this mail because: You are on the CC list for the bug.=