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: Bignum speedup patch causes crash at startup Date: Tue, 04 Sep 2018 15:21:11 +0100 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1536070839 15839 195.159.176.226 (4 Sep 2018 14:20:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 4 Sep 2018 14:20:39 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (windows-nt) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 04 16:20:35 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 1fxCC1-0003zl-R8 for ged-emacs-devel@m.gmane.org; Tue, 04 Sep 2018 16:20:34 +0200 Original-Received: from localhost ([::1]:51194 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxCE8-0003ID-BM for ged-emacs-devel@m.gmane.org; Tue, 04 Sep 2018 10:22:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxCCq-0001jm-E0 for emacs-devel@gnu.org; Tue, 04 Sep 2018 10:21:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxCCm-0006T5-70 for emacs-devel@gnu.org; Tue, 04 Sep 2018 10:21:24 -0400 Original-Received: from [195.159.176.226] (port=40935 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fxCCl-0006Ru-Ge for emacs-devel@gnu.org; Tue, 04 Sep 2018 10:21:20 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fxCAc-0001kq-OC for emacs-devel@gnu.org; Tue, 04 Sep 2018 16:19:06 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 103 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:9QlRevfSsluh9YB/2E0VK4NZIRo= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:229227 Archived-At: Hi, The recent changes in commit fe042e9d ("Speed up (+ 2 2) by a factor of 10") cause an immediate crash in 64bit emacs on Windows. A patch that is this invasive should have been posted for comment and review before it was committed. The patch contains both refactorings to move code around and new code changes. It would have been better to split this into more than one patch, to enable easier bisection of problems. Running master under GDB shows: (gdb) run -Q Starting program: C:\emacs\git\emacs\master\build\mingw64-x86_64\src\emacs.exe -Q [New Thread 13388.0x29bc] [New Thread 13388.0x24b4] [New Thread 13388.0x2cd0] [New Thread 13388.0x12e8] [New Thread 13388.0x8f8] [Thread 13388.0x2cd0 exited with code 0] [New Thread 13388.0x36cc] Thread 1 received signal SIGSEGV, Segmentation fault. 0x000000006acd4efb in ?? () from C:\msys64\mingw64\bin\libgmp-10.dll (gdb) bt #0 0x000000006acd4efb in ?? () from C:\msys64\mingw64\bin\libgmp-10.dll #1 0x000000040018bcca in mpz_set_intmax (v=, result=) at C:/emacs/git/emacs/master/src/bignum.h:66 #2 bignum_integer (i=, tmp=) at C:/emacs/git/emacs/master/src/bignum.h:79 #3 rounding_driver (arg=make_number(2), divisor=, double_round=, int_divide=0x6acc9560, name=name@entry=0x40067f71f "ceiling") at C:/emacs/git/emacs/master/src/floatfns.c:362 #4 0x000000040018be79 in Fceiling (arg=, divisor=) at C:/emacs/git/emacs/master/src/floatfns.c:446 #5 0x0000000400186a35 in funcall_subr (subr=0x400653d20 , numargs=numargs@entry=0x2, args=args@entry=0xbfcc00) at C:/emacs/git/emacs/master/src/eval.c:2899 #6 0x000000040018485e in Ffuncall (nargs=0x3, args=args@entry=0xbfcbf8) at C:/emacs/git/emacs/master/src/eval.c:2822 #7 0x00000004001ce74e in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=args_template@entry=make_number(1028), nargs=nargs@entry=0x4, args=, args@entry=0xbfcfc0) at C:/emacs/git/emacs/master/src/bytecode.c:632 #8 0x00000004001882ce in funcall_lambda (fun=XIL(0x4002dd295), nargs=nargs@entry=0x4, arg_vector=arg_vector@entry=0xbfcfc0) at C:/emacs/git/emacs/master/src/lisp.h:1707 #9 0x000000040018495f in Ffuncall (nargs=0x5, args=args@entry=0xbfcfb8) at C:/emacs/git/emacs/master/src/eval.c:2824 #10 0x00000004001ce74e in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=args_template@entry=make_number(1024), nargs=nargs@entry=0x4, args=, args@entry=0xbfd200) at C:/emacs/git/emacs/master/src/bytecode.c:632 #11 0x00000004001882ce in funcall_lambda (fun=XIL(0x4002dd195), nargs=nargs@entry=0x4, arg_vector=arg_vector@entry=0xbfd200) at C:/emacs/git/emacs/master/src/lisp.h:1707 #12 0x000000040018495f in Ffuncall (nargs=0x5, args=args@entry=0xbfd1f8) at C:/emacs/git/emacs/master/src/eval.c:2824 #13 0x00000004001ce74e in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=args_template@entry=make_number(1024), nargs=nargs@entry=0x4, args=, args@entry=0xbfd438) at C:/emacs/git/emacs/master/src/bytecode.c:632 #14 0x00000004001882ce in funcall_lambda (fun=XIL(0x4002dd7c5), nargs=nargs@entry=0x4, arg_vector=arg_vector@entry=0xbfd438) at C:/emacs/git/emacs/master/src/lisp.h:1707 #15 0x000000040018495f in Ffuncall (nargs=nargs@entry=0x5, args=args@entry=0xbfd430) at C:/emacs/git/emacs/master/src/eval.c:2824 #16 0x00000004001895d5 in call4 (fn=, arg1=arg1@entry=XIL(0x4007800c5), arg2=arg2@entry=XIL(0xf228), arg3=arg3@entry=XIL(0xf228), arg4=arg4@entry=XIL(0xf228)) at C:/emacs/git/emacs/master/src/eval.c:2698 #17 0x000000040001031b in frame_windows_min_size (frame=frame@entry=XIL(0x4007800c5), horizontal=horizontal@entry=XIL(0xf228), ignore=XIL(0xf228), pixelwise=pixelwise@entry=XIL(0xf228)) at C:/emacs/git/emacs/master/src/lisp.h:932 #18 0x0000000400011373 in adjust_frame_size (f=0x4007800c0 , new_width=, new_height=, inhibit=inhibit@entry=0x5, pretend=0x0, parameter=parameter@entry=XIL(0x3f00)) at C:/emacs/git/emacs/master/src/lisp.h:932 #19 0x0000000400004b19 in change_frame_size_1 (f=, new_width=, new_height=, pretend=, delay=, safe=, pixelwise=) at C:/emacs/git/emacs/master/src/lisp.h:932 #20 0x000000040000ce6b in change_frame_size (f=0x400714c50 , new_width=0x1, new_height=0x27ee60, pretend=0x60, pretend@entry=0x0, delay=delay@entry=0x0, safe=safe@entry=0x0, pixelwise=0x0) at C:/emacs/git/emacs/master/src/dispnew.c:5583 #21 0x000000040000cf83 in do_pending_window_change (safe=safe@entry=0x0) at C:/emacs/git/emacs/master/src/dispnew.c:5509 #22 0x0000000400017eb0 in x_set_font (f=0x400baea20 , arg=XIL(0x518bea4), oldval=) at C:/emacs/git/emacs/master/src/frame.c:4341 #23 0x00000004000166b4 in x_set_frame_parameters (f=, f@entry=0x400baea20 , alist=, alist@entry=XIL(0xbfd813)) at C:/emacs/git/emacs/master/src/lisp.h:1035 #24 0x00000004000199d5 in x_default_parameter (f=0x400baea20 , alist=, prop=XIL(0x6ee8), deflt=XIL(0x400bb2a25), xprop=0x4006933d3 "font", xclass=0x4006933d8 "Font", type=RES_TYPE_STRING) at C:/emacs/git/emacs/master/src/frame.c:5090 #25 0x000000040020c412 in x_default_font_parameter (f=f@entry=0x400baea20 , parms=parms@entry=XIL(0x400808873)) at C:/emacs/git/emacs/master/src/lisp.h:932 #26 0x0000000400216c6f in Fx_create_frame (parameters=XIL(0x400808873)) at C:/emacs/git/emacs/master/src/w32fns.c:5845 #27 0x0000000400186a29 in funcall_subr (subr=0x400659d40 , numargs=numargs@entry=0x1, args=args@entry=0xbfdb18) at C:/emacs/git/emacs/master/src/eval.c:2897 #28 0x000000040018485e in Ffuncall (nargs=0x2, args=args@entry=0xbfdb10) at C:/emacs/git/emacs/master/src/eval.c:2822 #29 0x00000004001ce74e in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=args_template@entry=make_number(256), nargs=nargs@entry=0x1, args=, args@entry=0xbfdda8) at C:/emacs/git/emacs/master/src/bytecode.c:632 #30 0x00000004001882ce in funcall_lambda (fun=XIL(0x40030acd5), nargs=nargs@entry=0x1, arg_vector=arg_vector@entry=0xbfdda8) at C:/emacs/git/emacs/master/src/lisp.h:1707 #31 0x000000040018495f in Ffuncall (nargs=0x2, args=args@entry=0xbfdda0) at C:/emacs/git/emacs/master/src/eval.c:2824 #32 0x00000004001ce74e in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=args_template@entry=make_number(257), nargs=nargs@entry=0x1, args=, args@entry=0xbfe148) at C:/emacs/git/emacs/master/src/bytecode.c:632 #33 0x00000004001882ce in funcall_lambda (fun=XIL(0x4009af115), nargs=nargs@entry=0x1, arg_vector=arg_vector@entry=0xbfe148) at C:/emacs/git/emacs/master/src/lisp.h:1707 #34 0x000000040018495f in Ffuncall (nargs=nargs@entry=0x2, args=args@entry=0xbfe140) at C:/emacs/git/emacs/master/src/eval.c:2824 #35 0x0000000400184cce in Fapply (nargs=0x2, args=0xbfe140) at C:/emacs/git/emacs/master/src/eval.c:2399 #36 0x00000004001869e0 in funcall_subr (subr=0x4006533e0 , numargs=numargs@entry=0x2, args=args@entry=0xbfe140) at C:/emacs/git/emacs/master/src/eval.c:2877 #37 0x000000040018485e in Ffuncall (nargs=0x3, args=args@entry=0xbfe138) at C:/emacs/git/emacs/master/src/eval.c:2822 #38 0x00000004001ce74e in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=args_template@entry=make_number(128), nargs=nargs@entry=0x1, args=, args@entry=0xbfe3e0) at C:/emacs/git/emacs/master/src/bytecode.c:632 #39 0x00000004001882ce in funcall_lambda (fun=XIL(0x400a3dc65), nargs=nargs@entry=0x1, arg_vector=arg_vector@entry=0xbfe3e0) at C:/emacs/git/emacs/master/src/lisp.h:1707 #40 0x000000040018495f in Ffuncall (nargs=0x2, args=args@entry=0xbfe3d8) at C:/emacs/git/emacs/master/src/eval.c:2824 #41 0x00000004001ce74e in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=args_template@entry=make_number(256), nargs=nargs@entry=0x1, args=, args@entry=0xbfe6e0) at C:/emacs/git/emacs/master/src/bytecode.c:632 #42 0x00000004001882ce in funcall_lambda (fun=XIL(0x400399b25), nargs=nargs@entry=0x1, arg_vector=arg_vector@entry=0xbfe6e0) at C:/emacs/git/emacs/master/src/lisp.h:1707 #43 0x000000040018495f in Ffuncall (nargs=0x2, args=args@entry=0xbfe6d8) at C:/emacs/git/emacs/master/src/eval.c:2824 #44 0x00000004001ce74e in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=args_template@entry=make_number(0), nargs=nargs@entry=0x0, args=, args@entry=0xbfe930) at C:/emacs/git/emacs/master/src/bytecode.c:632 #45 0x00000004001882ce in funcall_lambda (fun=XIL(0x400398f55), nargs=nargs@entry=0x0, arg_vector=arg_vector@entry=0xbfe930) at C:/emacs/git/emacs/master/src/lisp.h:1707 #46 0x000000040018495f in Ffuncall (nargs=0x1, args=args@entry=0xbfe928) at C:/emacs/git/emacs/master/src/eval.c:2824 #47 0x00000004001ce74e in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=args_template@entry=make_number(0), nargs=nargs@entry=0x0, args=, args@entry=0xbff1c8) at C:/emacs/git/emacs/master/src/bytecode.c:632 #48 0x00000004001882ce in funcall_lambda (fun=XIL(0x4003a21f5), nargs=nargs@entry=0x0, arg_vector=arg_vector@entry=0xbff1c8) at C:/emacs/git/emacs/master/src/lisp.h:1707 #49 0x000000040018495f in Ffuncall (nargs=0x1, args=args@entry=0xbff1c0) at C:/emacs/git/emacs/master/src/eval.c:2824 #50 0x00000004001ce74e in exec_byte_code (bytestr=, vector=, maxdepth=, args_template=args_template@entry=make_number(0), nargs=nargs@entry=0x0, args=, args@entry=0xbff550) at C:/emacs/git/emacs/master/src/bytecode.c:632 #51 0x00000004001882ce in funcall_lambda (fun=XIL(0x4003a11a5), fun@entry=XIL(0), nargs=nargs@entry=0x0, arg_vector=arg_vector@entry=0xbff550) at C:/emacs/git/emacs/master/src/lisp.h:1707 #52 0x000000040018756c in apply_lambda (fun=XIL(0), fun@entry=XIL(0x4003a11a5), args=, count=count@entry=0x4) at C:/emacs/git/emacs/master/src/eval.c:2959 #53 0x0000000400187dbf in eval_sub (form=form@entry=XIL(0x400909363)) at C:/emacs/git/emacs/master/src/eval.c:2332 #54 0x000000040018a4ed in Feval (form=XIL(0x400909363), lexical=lexical@entry=XIL(0)) at C:/emacs/git/emacs/master/src/eval.c:2107 #55 0x00000004000f01d8 in top_level_2 () at C:/emacs/git/emacs/master/src/lisp.h:932 #56 0x00000004001836b6 in internal_condition_case (bfun=bfun@entry=0x4000f01bc , handlers=handlers@entry=XIL(0x5ef0), hfun=hfun@entry=0x4000f59e0 ) at C:/emacs/git/emacs/master/src/eval.c:1349 #57 0x00000004000f2814 in top_level_1 (ignore=) at C:/emacs/git/emacs/master/src/lisp.h:932 #58 0x00000004001835ee in internal_catch (tag=, func=func@entry=0x4000f27c8 , arg=arg@entry=XIL(0)) at C:/emacs/git/emacs/master/src/eval.c:1114 #59 0x00000004000f4e55 in command_loop () at C:/emacs/git/emacs/master/src/lisp.h:932 #60 0x0000000000000000 in ?? () Backtrace stopped: previous frame inner to this frame (corrupt stack?) Lisp Backtrace: "ceiling" (0xbfcc00) "window--min-size-1" (0xbfcfc0) "window-min-size" (0xbfd200) "frame-windows-min-size" (0xbfd438) "x-create-frame" (0xbfdb18) "x-create-frame-with-faces" (0xbfdda8) 0x9af110 PVEC_COMPILED "apply" (0xbfe140) "frame-creation-function" (0xbfe3e0) "make-frame" (0xbfe6e0) "frame-initialize" (0xbfe930) "command-line" (0xbff1c8) "normal-top-level" (0xbff550)