Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emacs Crashes When Opening Certain Buffers #20

Closed
ghost opened this issue Apr 16, 2018 · 4 comments
Closed

Emacs Crashes When Opening Certain Buffers #20

ghost opened this issue Apr 16, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Apr 16, 2018

System: Arch Linux
Emacs Version: 27.0.50

Using the popular Doom-Emacs, opening certain buffers immediately causes emacs to crash. For instance, when in Zoom-Mode and opening neotree Emacs stops responding and is subsequently killed.

@cyrus-and
Copy link
Owner

I can confirm that, the backtrace looks like this for GNU Emacs 26.0.90 on Debian:

Fatal error 11: Segmentation fault
Backtrace:
emacs[0x50b635]
emacs[0x4f1b54]
emacs[0x509d9e]
emacs[0x50a089]
emacs[0x50a0c0]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x110c0)[0x7faf647780c0]
emacs[0x432487]
emacs[0x455ea4]
emacs[0x4fbd0b]
emacs[0x4fe8e7]
emacs[0x500434]
emacs[0x565bde]
emacs[0x4f1ee4]
emacs[0x565b7c]
emacs[0x4f1ea0]
emacs[0x4f6743]
emacs[0x4f6ab3]
emacs[0x419dd4]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7faf63b412e1]
emacs[0x41ab0a]
Segmentation fault

Anyway even though Zoom is involved in this, this is surely a bug in Emacs itself at this stage, it shouldn't be possible to cause a segmentation fault from an elisp program. I suggest to file an issue to Emacs, M-x report-emacs-bug seems the right tool for the job or use the mailing list.

Feel free to link this issue in the description and to add any further information here.

@cyrus-and
Copy link
Owner

Using GDB:

[0] from 0x0000000000432487 in reconsider_clip_changes+23 at xdisp.c:13699
[1] from 0x0000000000455ea4 in redisplay_internal+708 at xdisp.c:13909
[2] from 0x0000000000458185 in redisplay+5 at xdisp.c:13488
[3] from 0x00000000004fbd0b in read_char+2155 at keyboard.c:2480
[4] from 0x00000000004fe8e7 in read_key_sequence+951 at keyboard.c:9147
[5] from 0x0000000000500434 in command_loop_1+548 at keyboard.c:1368
[6] from 0x0000000000565bde in internal_condition_case+62 at eval.c:1332
[7] from 0x00000000004f1ee4 in command_loop_2+36 at keyboard.c:1110
[8] from 0x0000000000565b7c in internal_catch+92 at eval.c:1097
[9] from 0x00000000004f1ea0 in command_loop+160 at keyboard.c:1089
[10] from 0x00000000004f6743 in recursive_edit_1+115 at keyboard.c:695
[11] from 0x00000000004f6ab3 in Frecursive_edit+227 at keyboard.c:766
[12] from 0x0000000000419dd4 in main+2740 at emacs.c:1713

The segmentation fault happens here:

static void
reconsider_clip_changes (struct window *w)
{
  struct buffer *b = XBUFFER (w->contents);

  if (b->clip_changed // *** SEGMENTATION FAULT ***
      && w->window_end_valid
      && w->current_matrix->buffer == b
      && w->current_matrix->zv == BUF_ZV (b)
      && w->current_matrix->begv == BUF_BEGV (b))
    b->clip_changed = false;

  /* If display wasn't paused, and W is not a tool bar window, see if
     point has been moved into or out of a composition.  In that case,
     set b->clip_changed to force updating the screen.  If
     b->clip_changed has already been set, skip this check.  */
  if (!b->clip_changed && w->window_end_valid)
    {
      ptrdiff_t pt = (w == XWINDOW (selected_window)
                      ? PT : marker_position (w->pointm));

      if ((w->current_matrix->buffer != b || pt != w->last_point)
          && check_point_in_composition (w->current_matrix->buffer,
                                         w->last_point, b, pt))
        b->clip_changed = true;
    }
}

@cyrus-and
Copy link
Owner

cyrus-and commented Apr 29, 2018

Steps to reproduce this are:

  1. start with a fresh doom-emacs setup;
  2. M-x load-file RET /path/to/zoom.el;
  3. M-x zoom-mode;
  4. M-x neotree-show.

Note: it does not happen with only NeoTree and Zoom.

Someone should narrow it down and submit a proper bug report.

@cyrus-and
Copy link
Owner

cyrus-and commented Apr 29, 2018

FWIW here is the "bug report".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant