emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bignum branch


From: Andy Moreton
Subject: Re: bignum branch
Date: Sat, 11 Aug 2018 17:54:42 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt)

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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]