From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.devel Subject: Re: bignum branch Date: Sat, 11 Aug 2018 17:54:42 +0100 Message-ID: <86va8gj12l.fsf@gmail.com> References: <87o9fbbw1t.fsf@tromey.com> <86in4rgt1m.fsf@gmail.com> <83pnyyu0k1.fsf@gnu.org> <86k1p59haq.fsf@gmail.com> <83va8osuz2.fsf@gnu.org> <87ftzrknyg.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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1534006410 19907 195.159.176.226 (11 Aug 2018 16:53:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 11 Aug 2018 16:53:30 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 11 18:53:26 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 1foX8n-000544-MM for ged-emacs-devel@m.gmane.org; Sat, 11 Aug 2018 18:53:25 +0200 Original-Received: from localhost ([::1]:60835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1foXAu-0002t1-EC for ged-emacs-devel@m.gmane.org; Sat, 11 Aug 2018 12:55:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1foXAF-0002lc-Jm for emacs-devel@gnu.org; Sat, 11 Aug 2018 12:54:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1foXAC-0005oC-I5 for emacs-devel@gnu.org; Sat, 11 Aug 2018 12:54:55 -0400 Original-Received: from [195.159.176.226] (port=55881 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1foXAC-0005mS-8z for emacs-devel@gnu.org; Sat, 11 Aug 2018 12:54:52 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1foX82-0004Jb-NF for emacs-devel@gnu.org; Sat, 11 Aug 2018 18:52:38 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 65 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:O6GZRBlcH55InjhemS3DSw0IvBU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:228414 Archived-At: On Sat 11 Aug 2018, Eli Zaretskii wrote: > Strange that it shows nothing before the exception handler. Did you > run the test under GDB to begin with, or only attached it after the > abort dialog popped up? If the latter, please run the test from GDB > to begin with (it is easier to do that if you run the test > interactively). That dump was from attachig after the crtash: running it under gdb to start with produces the same unhelpful backtrace. >> Let me know if there is anything I should look for in gdb to try to >> debug this. > > In case you already run the test from GDB: Is it true that logcount > always crashes in this build? If so, can you step through logcount > and tell where exactly it crashes? Once you determine the C line in > which it crashes, please re-run the test with a breakpoint inside > logcount, step through the function until you get to the crashing > line, and then use "stepi" to step into the function that crashes. > Please show the transcript of this stepping. This always crashes when handling a bignum, in mpz_popcount at the call to mpn_popcount. In the gdb session below, I evaluated this in the scratch buffer: (logcount (1+ most-positive-fixnum)) (gdb) b Flogcount Breakpoint 4 at 0x40016e2de: file C:/emacs/git/emacs/bignum/src/data.c, line 3340. (gdb) run -Q Starting program: C:\emacs\git\emacs\bignum\build\mingw64-x86_64\src\emacs.exe -Q [New Thread 7140.0x73c] [New Thread 7140.0x1124] [New Thread 7140.0x770] [New Thread 7140.0x2160] [New Thread 7140.0x9e0] [New Thread 7140.0x1a48] [Thread 7140.0x770 exited with code 0] [Thread 7140.0x2160 exited with code 0] [Thread 7140.0x1124 exited with code 0] Thread 1 hit Breakpoint 4, Flogcount (value=XIL(0x4c5ec51)) at C:/emacs/git/emacs/bignum/src/data.c:3340 3340 { (gdb) n 3341 CHECK_INTEGER (value); (gdb) 3343 if (BIGNUMP (value)) (gdb) 3345 if (mpz_sgn (XBIGNUM (value)->value) >= 0) (gdb) 3346 return make_fixnum (mpz_popcount (XBIGNUM (value)->value)); (gdb) s __gmpz_popcount (__gmp_u=0x4c5ec60) at C:/msys64/mingw64/include/gmp.h:1844 1844 if (__GMP_LIKELY (__gmp_usize > 0)) (gdb) s 1845 __gmp_result = mpn_popcount (__gmp_u->_mp_d, __gmp_usize); (gdb) stepi 0x000000040016e405 1845 __gmp_result = mpn_popcount (__gmp_u->_mp_d, __gmp_usize); (gdb) 0x000000046ace5dc0 in ?? () (gdb) Thread 1 received signal SIGSEGV, Segmentation fault. 0x000000046ace5dc0 in ?? () (gdb)