From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#27205: 25.2; Crash on OS X when writing in org-mode Date: Sat, 03 Jun 2017 11:13:26 +0300 Message-ID: <83r2z1biah.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1496477657 10604 195.159.176.226 (3 Jun 2017 08:14:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 3 Jun 2017 08:14:17 +0000 (UTC) Cc: 27205@debbugs.gnu.org To: Sebastian Gniazdowski Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 03 10:14:07 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1dH4CE-0002Cm-Ki for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Jun 2017 10:14:06 +0200 Original-Received: from localhost ([::1]:52906 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dH4CJ-0003M2-R2 for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Jun 2017 04:14:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dH4CE-0003Lx-8b for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2017 04:14:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dH4CB-00039q-1O for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2017 04:14:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49694) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dH4CA-00039I-TB for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2017 04:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dH4CA-0004UK-Iu for bug-gnu-emacs@gnu.org; Sat, 03 Jun 2017 04:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Jun 2017 08:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27205 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27205-submit@debbugs.gnu.org id=B27205.149647763117228 (code B ref 27205); Sat, 03 Jun 2017 08:14:02 +0000 Original-Received: (at 27205) by debbugs.gnu.org; 3 Jun 2017 08:13:51 +0000 Original-Received: from localhost ([127.0.0.1]:52371 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dH4Bz-0004To-Aw for submit@debbugs.gnu.org; Sat, 03 Jun 2017 04:13:51 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59773) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dH4Bx-0004Tb-NC for 27205@debbugs.gnu.org; Sat, 03 Jun 2017 04:13:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dH4Bp-0002Wk-5g for 27205@debbugs.gnu.org; Sat, 03 Jun 2017 04:13:44 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dH4Bp-0002WG-2U; Sat, 03 Jun 2017 04:13:41 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4504 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dH4Bo-0004gp-C8; Sat, 03 Jun 2017 04:13:40 -0400 In-reply-to: (message from Sebastian Gniazdowski on Sat, 3 Jun 2017 08:22:26 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:133210 Archived-At: > Date: Sat, 3 Jun 2017 08:22:26 +0200 > From: Sebastian Gniazdowski > > I have two stack traces. I think OS X produced one when the crash > occurred, although function calls aren't the same as lldb backtrace > done from core. First goes OX backtrace, then lldb's `bt all`. I > use Spacemacs. > [...] > (lldb) bt all > * thread #1: tid = 0x0000, 0x00007fff868e98ea libsystem_kernel.dylib`__kill + 10, stop reason = signal SIGSTOP >   * frame #0: 0x00007fff868e98ea libsystem_kernel.dylib`__kill + 10 >     frame #1: 0x00000001000a0f36 Emacs`terminate_due_to_signal + 136 >     frame #2: 0x00000001000b84f5 Emacs`emacs_abort + 19 >     frame #3: 0x00000001001712c3 Emacs`ns_term_shutdown + 122 >     frame #4: 0x00000001000a10f0 Emacs`shut_down_emacs + 261 >     frame #5: 0x00000001000a0f03 Emacs`terminate_due_to_signal + 85 >     frame #6: 0x00000001000b84f5 Emacs`emacs_abort + 19 >     frame #7: 0x000000010008a702 Emacs`bidi_paragraph_init + 885 >     frame #8: 0x000000010001cc34 Emacs`set_iterator_to_next + 1004 I think I fixed this recently on the master branch. Can you try the patch below? diff --git a/src/xdisp.c b/src/xdisp.c index 1e7cb4ec..7ff37a6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -4999,6 +4999,14 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, { ptrdiff_t ovendpos = OVERLAY_POSITION (OVERLAY_END (overlay)); + /* Some borderly-sane Lisp might call us with the current + buffer narrowed so that overlay-end is outside the + POINT_MIN..POINT_MAX region, which will then cause + various assertion violations and crashes down the road, + starting with pop_it when it will attempt to use POSITION + set below. Prevent that. */ + ovendpos = clip_to_bounds (BEGV, ovendpos, ZV); + if (ovendpos > CHARPOS (*position)) SET_TEXT_POS (*position, ovendpos, CHAR_TO_BYTE (ovendpos)); }