unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Clemente <n142857@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 71289@debbugs.gnu.org
Subject: bug#71289: 30.0.50; cmcheckmagic aborts when tty_write_glyphs writes "Garbage collecting..." in some cases
Date: Fri, 31 May 2024 17:07:45 +0000	[thread overview]
Message-ID: <CAJKAhPDOCqGd_8YMZ8A3fzbt53ZVcTMpft5RVi5qJDxE_8RdUA@mail.gmail.com> (raw)
In-Reply-To: <86o78mp6wg.fsf@gnu.org>

> Thanks, but these backtraces are not enough, because they don't
> explain why was emacs_abort called.  We need to see all the values
> involved in this condition:
>
>  if (curX (tty) == FrameCols (tty))
>    {
>      if (!MagicWrap (tty) || curY (tty) >= FrameRows (tty) - 1) <<<<<<<<<<<
>        emacs_abort ();


These were the variables just before emacs_abort, and (abort==1) when aborting.

At point cmcheckmagic, ¿abort? 0. MagicWrap 1, curY 0, vs. 3 - 1. Now
tty has 3 rows, 14 cols
At point cmcheckmagic, ¿abort? 0. MagicWrap 1, curY 1, vs. 3 - 1. Now
tty has 3 rows, 14 cols
At point cmcheckmagic, ¿abort? 1. MagicWrap 1, curY 3, vs. 3 - 1. Now
tty has 3 rows, 14 cols

I got them by adding:
fprintf(stderr, "At point cmcheckmagic, ¿abort? %d. MagicWrap %d, curY
%d, vs. %d - 1. Now tty has %d rows, %d cols\n",
      (!MagicWrap (tty) || curY (tty) >= FrameRows (tty) - 1),
      MagicWrap(tty), curY(tty), FrameRows(tty),
      FrameRows(tty), FrameCols(tty));

I forgot curX, which is:
(gdb) p curX(tty)
$1 = 14

To reproduce this I had to try many random operations. The last thing
I did was increasing the size of an X window showing dired, from very
small (1 line, ~10 cols to 3x14); this works well most of the time but
this time this happened.


Backtrace.

(gdb) bt full
#0  terminate_due_to_signal (sig=6, backtrace_limit=40) at emacs.c:443
No locals.
#1  0x00005555556bdab0 in emacs_abort () at sysdep.c:2391
No locals.
#2  0x000055555566995d in cmcheckmagic (tty=0x5555572c4c90) at cm.c:124
No locals.
#3  0x000055555566de6f in tty_write_glyphs (f=0x555561525f60,
string=0x5555610141c0, len=14) at term.c:819
        conversion_buffer = 0x55555f7e9160 "x \\  3 dc   dc)
(Dired by name Helm Projectile yas) 7:39PM 0.41", ' ' <repeats 80
times>, "`UU"
        coding = 0x555559956cf0
        n = 14
        stringlen = 0
        tty = 0x5555572c4c90
#4  0x0000555555678203 in write_glyphs (f=0x555561525f60,
string=0x555561013f20, len=14) at terminal.c:163
No locals.
#5  0x000055555559194a in update_frame_line (f=0x555561525f60, vpos=3,
updating_menu_p=false)
    at dispnew.c:5321
        obody = 0x0
        nbody = 0x555561013f20
        op1 = 0x300000011
        op2 = 0x7fffffff78e0
        np1 = 0x7ffff549ed90 <__GI___fflush_unlocked+48>
        nend = 0x5555610141c0
        tem = 0
        osp = 32767
        nsp = -34592
        begmatch = 32767
        endmatch = -178330144
        olen = 0
        nlen = 14
        current_matrix = 0x555560cad240
        desired_matrix = 0x5555603cf860
        current_row = 0x555560c681c8
        desired_row = 0x55556045e7b8
        must_write_whole_line_p = true
        write_spaces_p = true
        colored_spaces_p = true
#6  0x0000555555590b8d in update_frame_1 (f=0x555561525f60,
force_p=true, inhibit_id_p=false,
    set_cursor_p=true, updating_menu_p=false) at dispnew.c:5008
        current_matrix = 0x555560cad240
        desired_matrix = 0x5555603cf860
        i = 3
        pause_p = 85
        preempt_count = 17
#7  0x000055555558cf9f in update_frame (f=0x555561525f60,
force_p=true, inhibit_hairy_id_p=false)
    at dispnew.c:3346
        paused_p = false
        root_window = 0x555560baa508
#8  0x00005555555cf876 in redisplay_internal () at xdisp.c:17478
        gcscrollbars = true
        f_redisplay_flag = true
        f = 0x555561525f60
        w = 0x555561526388
        sw = 0x555561526388
        fr = 0x555561525f60
        pending = false
        must_finish = false
        match_p = false
        tlbufpos = {
          charpos = 0,
          bytepos = 116
        }
--Type <RET> for more, q to quit, c to continue without paging--
        tlendpos = {
          charpos = 29241,
          bytepos = 29273
        }
        number_of_visible_frames = 7
        sf = 0x555561525f60
        polling_stopped_here = true
        tail = XIL(0x5555614f3903)
        frame = XIL(0x555561525f65)
        MAX_HSCROLL_RETRIES = MAX_HSCROLL_RETRIES
        hscroll_retries = 0
        MAX_GARBAGED_FRAME_RETRIES = MAX_GARBAGED_FRAME_RETRIES
        garbaged_frame_retries = 0
        consider_all_windows_p = true
        update_miniwindow_p = false
        count = {
          bytes = 2304
        }
#9  0x00005555555d01aa in redisplay_preserve_echo_area (from_where=11)
at xdisp.c:17761
        count = {
          bytes = 2272
        }
#10 0x00005555557ee631 in wait_reading_process_output (time_limit=30,
nsecs=0, read_kbd=-1,
    do_display=true, wait_for_cell=XIL(0), wait_proc=0x0,
just_wait_proc=0) at process.c:5585
        process_skipped = false
        wrapped = false
        channel_start = 0
        child_fd = 6
        last_read_channel = 13
        channel = 1024
        nfds = -1
        Available = {
          fds_bits = {8768089968, 0 <repeats 15 times>}
        }
        Writeok = {
          fds_bits = {0 <repeats 16 times>}
        }
        check_write = true
        check_delay = 1
        no_avail = true
        xerrno = 4
        proc = XIL(0xa00000fff)
        timeout = {
          tv_sec = 28,
          tv_nsec = 503054580
        }
        end_time = {
          tv_sec = 1717173578,
          tv_nsec = 474082259
        }
        timer_delay = {
          tv_sec = 0,
          tv_nsec = 502843472
        }
        got_output_end_time = {
          tv_sec = 1717173578,
          tv_nsec = 474082259
        }
        MINIMUM = MINIMUM
        TIMEOUT = TIMEOUT
        FOREVER = FOREVER
        wait = TIMEOUT
--Type <RET> for more, q to quit, c to continue without paging--
        got_some_output = -1
        prev_wait_proc_nbytes_read = 0
        retry_for_async = false
        count = {
          bytes = 2240
        }
        now = {
          tv_sec = 1717173549,
          tv_nsec = 971027679
        }
#11 0x0000555555594f26 in sit_for (timeout=make_fixnum(30),
reading=true, display_option=1)
    at dispnew.c:6321
        sec = 30
        nsec = 0
        do_display = true
        curbuf_eq_winbuf = false
        nbytes = 21845
#12 0x0000555555695ae5 in read_char (commandflag=1,
map=XIL(0x555560278023), prev_event=XIL(0),
    used_mouse_menu=0x7fffffff966f, end_time=0x0) at keyboard.c:2923
        tem0 = XIL(0x555555770001)
        timeout = 30
        count1 = {
          bytes = 2208
        }
        delay_level = 4
        buffer_size = 50
        c = XIL(0)
        local_getcjmp = {{
            __jmpbuf = {0, -8236620451292018264, 0, 140737168851264,
93825052522836, 0,
              -8236620451436721752, -2817863054631007832},
            __mask_was_saved = 0,
            __saved_mask = {
              __val = {93464216335616, 139753184, 140737245531531,
93825002663168, 0, 0, 140737488327872,
                93824993653913, 40800, 140737488327952,
93824993660639, 1, 0, 93464225410400, 96,
                93825002663168}
            }
          }}
        save_jump = {{
            __jmpbuf = {0, 0, 0, 0, 0, 0, 0, 0},
            __mask_was_saved = 0,
            __saved_mask = {
              __val = {0 <repeats 16 times>}
            }
          }}
        tem = XIL(0x5555557806e9)
        save = XIL(0x67e0)
        previous_echo_area_message = XIL(0)
        also_record = XIL(0)
        reread = false
        recorded = false
        polling_stopped_here = false
        orig_kboard = 0x555560b58160
        jmpcount = {
          bytes = 2208

        }





  reply	other threads:[~2024-05-31 17:07 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-31 10:18 bug#71289: 30.0.50; cmcheckmagic aborts when tty_write_glyphs writes "Garbage collecting..." in some cases Daniel Clemente
2024-05-31 11:17 ` Eli Zaretskii
2024-05-31 17:07   ` Daniel Clemente [this message]
2024-05-31 18:17     ` Eli Zaretskii
2024-06-03 15:35       ` Daniel Clemente
2024-06-03 16:21         ` Eli Zaretskii
2024-05-31 17:09 ` Daniel Clemente
2024-05-31 18:26   ` Eli Zaretskii
2024-06-03 15:56     ` Daniel Clemente
2024-06-03 16:03       ` Eli Zaretskii
2024-06-03 16:28         ` Daniel Clemente
2024-06-03 16:36           ` Eli Zaretskii
2024-06-03 16:51             ` Daniel Clemente
2024-06-03 17:44   ` Eli Zaretskii
2024-06-05 13:51     ` Daniel Clemente
2024-06-06  7:55       ` Eli Zaretskii
2024-06-03 15:36 ` Daniel Clemente
2024-06-03 16:25   ` Eli Zaretskii
2024-06-03 16:55     ` Daniel Clemente
2024-06-03 17:39       ` Eli Zaretskii
2024-06-05 13:50         ` Daniel Clemente
2024-06-05 15:06           ` Eli Zaretskii
2024-06-05 16:43             ` Eli Zaretskii
2024-06-06 12:36               ` Daniel Clemente
2024-06-06 12:34             ` Daniel Clemente
2024-06-06 14:53               ` Eli Zaretskii
2024-06-06 15:23                 ` Daniel Clemente
2024-06-06 16:13                   ` Eli Zaretskii
2024-06-06 16:44                     ` Daniel Clemente
2024-06-06 18:06                 ` Daniel Clemente
2024-06-07  6:11                   ` Eli Zaretskii
2024-06-07  6:42                     ` Daniel Clemente
2024-06-07  6:47                       ` Eli Zaretskii
2024-06-05 13:52     ` Daniel Clemente

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJKAhPDOCqGd_8YMZ8A3fzbt53ZVcTMpft5RVi5qJDxE_8RdUA@mail.gmail.com \
    --to=n142857@gmail.com \
    --cc=71289@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).