From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#43973: 28.0.50; [NS] Two crashes on macOS Date: Tue, 13 Oct 2020 15:00:31 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3030"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43973@debbugs.gnu.org To: Andrii Kolomoiets Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 13 15:01:31 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kSJvm-0000h6-A3 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Oct 2020 15:01:30 +0200 Original-Received: from localhost ([::1]:49792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSJvl-0002sE-0V for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Oct 2020 09:01:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSJvK-0002rA-6v for bug-gnu-emacs@gnu.org; Tue, 13 Oct 2020 09:01:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34056) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kSJvJ-0005tT-M4 for bug-gnu-emacs@gnu.org; Tue, 13 Oct 2020 09:01:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kSJvJ-0002zx-KD for bug-gnu-emacs@gnu.org; Tue, 13 Oct 2020 09:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Oct 2020 13:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43973 X-GNU-PR-Package: emacs Original-Received: via spool by 43973-submit@debbugs.gnu.org id=B43973.160259404111492 (code B ref 43973); Tue, 13 Oct 2020 13:01:01 +0000 Original-Received: (at 43973) by debbugs.gnu.org; 13 Oct 2020 13:00:41 +0000 Original-Received: from localhost ([127.0.0.1]:45602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSJuz-0002zH-03 for submit@debbugs.gnu.org; Tue, 13 Oct 2020 09:00:41 -0400 Original-Received: from mail-wr1-f45.google.com ([209.85.221.45]:40081) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSJux-0002z4-E7 for 43973@debbugs.gnu.org; Tue, 13 Oct 2020 09:00:40 -0400 Original-Received: by mail-wr1-f45.google.com with SMTP id h5so13857610wrv.7 for <43973@debbugs.gnu.org>; Tue, 13 Oct 2020 06:00:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version; bh=zVEJVW9auXJQBvLqq3TQQMwAwr4Rc+VLF9LuEeczW4Y=; b=YJ1xubPnNGM5L1CdjKbmHrj6tjSaKGfcCV7vEPRmIjUCNEfZsjYA0mj0fPkmzc683C 753WL2hrP4Gfkm5J3dq1FmuGsmmuJb0LFmgMO5vKfiwPiea7eyb684sgxEpso72UorAB jBaYSgAKjUrVctp+izmZQIBVdQfk2W+JeA6Insp7dHS8hX0qulwmUvF7Xk99xniXIkTj R9qkS/WQOKC3iA0DOgutevPB59OqQD/OBOs84eFpjBcYbm+cPqed0x7tY5MFBB7gcGyg BevitaSOxh32KK647nLzX6haW0CJKXzVBGk8dKNOax4GGxeHPsfYdii6MYyp8sL1eN3U zrdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version; bh=zVEJVW9auXJQBvLqq3TQQMwAwr4Rc+VLF9LuEeczW4Y=; b=Zn6glUGvudxrAzkjKsyxIgQHonIbHf3o/TqNbZCE6zehthMa5D+7yREQdLgRxADekt 4SO39pVt26rycRKE0oWYz4I/HKsNXDvn7DfSszDGR3kKmxU28HzH+/48kJqkz3agfiUc deRNkxnQ3hNSQagy1hKmCfAus+rcZiowYVyUWh89/G/P91JAT7C7K8rDuxGjUg98wTYZ cA5wpGBr4zVUNqvbiK+nF0jyL28oAzHuctbak4M8gSuG9zplEWNG66NuWKVaYo2AgCIv GIDV3MoK90FF84u4zM+6MT8og3IBiu8rXo7GxRNKt1W/0CR5Aej4Q9lMalUTGTi2tKa3 YnAw== X-Gm-Message-State: AOAM531l2jO3FSrVulvsnfsBxH1bNE0LrM1VW76gxFAQEADtjcKQ7xLY pdNv1ZzsWAvelTFCUYzm7aLgqzv7/3E= X-Google-Smtp-Source: ABdhPJxGm1OTIz+j5t5LtjAy8MTYL6F2DmVqsrYvCSI3Kqady/AvkmyEEev/Xg1Ynv9pRCH9YDzs4A== X-Received: by 2002:adf:de89:: with SMTP id w9mr12828626wrl.212.1602594032981; Tue, 13 Oct 2020 06:00:32 -0700 (PDT) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:cb0:6c9:2546:798c]) by smtp.gmail.com with ESMTPSA id i8sm9778567wmd.14.2020.10.13.06.00.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2020 06:00:32 -0700 (PDT) In-Reply-To: (Andrii Kolomoiets's message of "Tue, 13 Oct 2020 10:35:28 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:190417 Archived-At: >>>>> On Tue, 13 Oct 2020 10:35:28 +0300, Andrii Kolomoiets said: Andrii> Update to recent trunk brought me everyone's favorite random crashes. Andrii> In an attempt to find the recipe for reproduce the bug somehow, I spot Andrii> two crashes that I actually can reproduce in 'emacs -Q'. Andrii> The first one is more "stable": Andrii> With this code in scratch and point at '|': Andrii> (make-frame `((parent-frame . ,(selected-frame)) Andrii> (width . 0.5) Andrii> (height . 0.5) Andrii> (top . 0.5) Andrii> (left . 0.5)))| Andrii> 1. C-x C-e Andrii> 2. s-w Andrii> Repeating these two steps 3-5 times leads to crash. Most of the time Andrii> the only meaningfull record in the 'bt' is: Andrii> Thread 3 received signal SIGSEGV, Segmentation fault. Andrii> 0x00007fff6fa97678 in ?? () Andrii> (gdb) bt full Andrii> #0 0x00007fff6fa97678 in ?? () Andrii> No symbol table info available. Andrii> #1 0x0000000100476338 in -[EmacsImage dealloc] (self=0x1014c77f0, _cmd=0x7fff7afcdc58) at nsimage.m:286 Andrii> No locals. Andrii> It may be tool bar related, because Emacs is not crashing with Andrii> tool-bar-mode turned of. I think you may be right: (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x20) * frame #0: 0x00007fff6be26678 libobjc.A.dylib`objc_release + 24 frame #1: 0x00000001001f5d1f emacs`-[EmacsImage dealloc](self=0x0000000102ac8ff0, _cmd=) at nsimage.m:286:3 [opt] frame #2: 0x00007fff6be2beb3 libobjc.A.dylib`objc_object::sidetable_release(bool) + 229 frame #3: 0x00007fff301e46e1 AppKit`-[NSMenuItem dealloc] + 108 frame #4: 0x00007fff304523f8 AppKit`-[NSToolbarItem dealloc] + 110 frame #5: 0x00007fff32f072a5 CoreFoundation`__RELEASE_OBJECTS_IN_THE_ARRAY__ + 118 frame #6: 0x00007fff32f071e8 CoreFoundation`-[__NSArrayM dealloc] + 279 frame #7: 0x00007fff305b1a99 AppKit`-[NSToolbarClippedItemsIndicator dealloc] + 84 frame #8: 0x00007fff6be42054 libobjc.A.dylib`AutoreleasePoolPage::releaseUntil(objc_object**) + 134 frame #9: 0x00007fff6be26dba libobjc.A.dylib`objc_autoreleasePoolPop + 175 frame #10: 0x00007fff32f69335 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23 frame #11: 0x00007fff32f69267 CoreFoundation`__CFRunLoopDoObservers + 457 frame #12: 0x00007fff32f68805 CoreFoundation`__CFRunLoopRun + 874 frame #13: 0x00007fff32f67e3e CoreFoundation`CFRunLoopRunSpecific + 462 frame #14: 0x00007fff31b94abd HIToolbox`RunCurrentEventLoopInMode + 292 frame #15: 0x00007fff31b946f4 HIToolbox`ReceiveNextEventCommon + 359 frame #16: 0x00007fff31b94579 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 64 frame #17: 0x00007fff301da039 AppKit`_DPSNextEvent + 883 frame #18: 0x00007fff301d8880 AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352 frame #19: 0x00007fff301ca58e AppKit`-[NSApplication run] + 658 frame #20: 0x00000001001d708d emacs`-[EmacsApp run](self=0x0000000102a10a70, _cmd=) at nsterm.m:5765:9 [opt] frame #21: 0x00000001001e3a1e emacs`ns_read_socket(terminal=, hold_quit=) at nsterm.m:4741:11 [opt] frame #22: 0x00000001000d11cd emacs`gobble_input at keyboard.c:6889:17 [opt] which is nsimage.m: - (void)dealloc { [stippleMask release]; [bmRep release]; [transform release]; <==== [super dealloc]; } Alan? Andrii> The second one is not reproducible every time: Andrii> 1. M-x tool-bar-mode Andrii> 2. Evaluate Andrii> (let ((params `((parent-frame . ,(selected-frame)) Andrii> (undecorated . t)))) Andrii> (dotimes (_z 100) Andrii> (set-face-background 'internal-border "black" Andrii> (make-frame params)))) Andrii> 3. Move the frame And this I see as well, however lldb does warn us: 2020-10-13 14:54:46.765446+0200 emacs[65592:8296279] [Window] WARNING: NSWindow has detected an excessive live window count of 101. Window 0x2e668 of class 'EmacsWindow' created after passing the threshold of 100. This window is not necessarily the cause, and this warning will only be shown once per window class. Andrii> Thread 3 received signal SIGSEGV, Segmentation fault. Andrii> 0x0000000100456e88 in ns_clear_under_internal_border (f=0x13cedafe8) at nsterm.m:3052 Andrii> 3052 [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), f) set]; Andrii> (gdb) bt full I suspect some initialization has been skipped somewhere: frame #0: 0x00000001001e81bc emacs`ns_clear_under_internal_border(f=0x0000000132288150) at nsterm.m:3052:33 [opt] 3049 face = FRAME_DEFAULT_FACE (f); 3050 3051 ns_focus (f, &frame_rect, 1); -> 3052 [ns_lookup_indexed_color (NS_FACE_BACKGROUND (face), f) set]; 3053 for (int i = 0; i < 4 ; i++) 3054 { 3055 NSDivideRect (frame_rect, &edge_rect, &frame_rect, border_width, edge[i]); Target 0: (emacs) stopped. (lldb) p face (face *) $0 = 0x0000000000000000 Robert --