From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: bignum branch Date: Sun, 12 Aug 2018 21:54:23 +0300 Message-ID: <83y3dbju00.fsf@gnu.org> References: <87o9fbbw1t.fsf@tromey.com> <87zhxwig5k.fsf@tromey.com> <86lg9gl7vy.fsf@gmail.com> <87tvo4i9em.fsf@tromey.com> <86k1ozl0yd.fsf@gmail.com> <83in4iojva.fsf@gnu.org> <86bmaasm39.fsf@gmail.com> <83a7puo8oq.fsf@gnu.org> <83zhxummef.fsf@gnu.org> <83lg9em1v6.fsf@gnu.org> <86r2j5q67t.fsf@gmail.com> <83r2j4lvyo.fsf@gnu.org> <86va8gj12l.fsf@gmail.com> <83k1owlscr.fsf@gnu.org> <86mutsiy80.fsf@gmail.com> <83eff4lqon.fsf@gnu.org> <86eff4ixcj.fsf@gmail.com> <83a7pslnzz.fsf@gnu.org> <86eff4turj.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1534099943 4230 195.159.176.226 (12 Aug 2018 18:52:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 12 Aug 2018 18:52:23 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andy Moreton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 12 20:52:19 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fovTP-0000z1-DQ for ged-emacs-devel@m.gmane.org; Sun, 12 Aug 2018 20:52:19 +0200 Original-Received: from localhost ([::1]:35963 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fovVW-0004EN-3U for ged-emacs-devel@m.gmane.org; Sun, 12 Aug 2018 14:54:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fovVQ-0004EI-8l for emacs-devel@gnu.org; Sun, 12 Aug 2018 14:54:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fovVL-0003KP-B0 for emacs-devel@gnu.org; Sun, 12 Aug 2018 14:54:24 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38902) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fovVL-0003KI-6h; Sun, 12 Aug 2018 14:54:19 -0400 Original-Received: from [176.228.60.248] (port=3715 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fovVK-0001fq-Ky; Sun, 12 Aug 2018 14:54:19 -0400 In-reply-to: <86eff4turj.fsf@gmail.com> (message from Andy Moreton on Sat, 11 Aug 2018 23:15:28 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:228454 Archived-At: > From: Andy Moreton > Date: Sat, 11 Aug 2018 23:15:28 +0100 > > As Tom has completed merging to master, I have switched to the master > branch and rebuilt from a clean tree (after "git clean -Xdf"). > > Stepping through the code in gdb, I see: > > (gdb) stepi > 0x000000040016ebcb 1845 __gmp_result = mpn_popcount (__gmp_u->_mp_d, __gmp_usize); > (gdb) > 0x000000046ace5dc0 in ?? () > (gdb) > > Thread 1 received signal SIGSEGV, Segmentation fault. > 0x000000046ace5dc0 in ?? () I don't see this here, with mingw.org's GMP library. If you step through the code after typing (gdb) set debugexceptions on what Windows exception is reported that leads to this SIGSEGV? Also, could you try compiling and running the small program attached below. It is a slightly modified code of Flogcount, and I'm curious to know whether it crashes in the same way if you compile it like the crashing Emacs: with the -Og switch and with gmp.h set up for static linking. (It didn't crash for me here.) Also, do you see there the same call to __imp___gmpn_popcount as in the Emacs case. After compiling this, you can run it with different arguments to get the bit counts, and the result can be displayed as "echo %ERRORLEVEL%" in cmd.exe or "echo $?" in Bash. #include #include int main (int argc, char *argv[]) { int value = argc > 1 ? atoi (argv[1]) : 42; mpz_t tem, tem1; int retval; mpz_init (tem); mpz_add_ui (tem, tem, value); if (mpz_sgn (tem) >= 0) retval = mpz_popcount (tem); else { mpz_init (tem1); mpz_neg (tem1, tem); mpz_sub_ui (tem1, tem1, 1); retval = mpz_popcount (tem1); mpz_clear (tem1); } return retval; }