Subject: bug#43389: 28.0.50; Emacs memory leaks using hard disk all time

From: Jean Louis <[email-masked]>
Date: Mon, 23 Nov 2020 23:18:13 +0300

* Carlos O'Donell <[email-masked]> [2020-11-23 23:06]:
> On 11/23/20 2:55 PM, Jean Louis wrote:
> > * Carlos O'Donell <[email-masked]> [2020-11-23 22:37]:
> >>>
> >>> # MTRACE_CTL_VERBOSE=1
> >>> MTRACE_CTL_FILE=/home/data1/protected/tmp/mtraceEMACS.mtr LD_PRELOAD=/home/data1/protected/Programming/git/glibc-malloc-trace-utils/libmtrace.so emacs >> $DEBUG 2>&1
> >>>
> >>> I have tried like above and it will block as soon as eww is loads some
> >>> page with the same error as previously.
> >>
> >> That's interesting. Are you able to attach gdb and get a backtrace to see
> >> what the process is blocked on?
> > 
> > I can do C-g one time to interrupt something going on, then I get error
> > 
> > (gdb) continue
> Please issue 'thread apply all backtrace' to get a backtrace from all
> the threads to see where they are stuck.
> 
> You will need debug information for this for all associated frames in
> the backtrace. Depending on your distribution this may require debug
> information packages.

sudo gdb -pid 25584
GNU gdb (GDB) 7.12.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 25584
[New LWP 25585]
[New LWP 25586]
[New LWP 25588]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
0x00007f6afd4765dc in pselect () from /lib/libc.so.6
(gdb) continue
Continuing.
[New Thread 0x7f6aed1dbc00 (LWP 25627)]
[Thread 0x7f6aed1dbc00 (LWP 25627) exited]
[New Thread 0x7f6aed1dbc00 (LWP 25628)]
[Thread 0x7f6aed1dbc00 (LWP 25628) exited]
  C-c C-c
Thread 1 "emacs" received signal SIGINT, Interrupt.
0x00007f6afd4765dc in pselect () from /lib/libc.so.6
(gdb) thread apply backtrace
Invalid thread ID: backtrace
(gdb) thread apply all backtrace

Thread 4 (Thread 0x7f6aee2ae700 (LWP 25588)):
#0  0x00007f6afd47435d in poll () at /lib/libc.so.6
#1  0x00007f6b011a4b98 in  () at /lib/libglib-2.0.so.0
#2  0x00007f6b011a4f52 in g_main_loop_run () at /lib/libglib-2.0.so.0
#3  0x00007f6b019b62c8 in  () at /usr/lib/libgio-2.0.so.0
#4  0x00007f6b011ccfca in  () at /lib/libglib-2.0.so.0
#5  0x00007f6afe242069 in start_thread () at /lib/libpthread.so.0
#6  0x00007f6afd47e30f in clone () at /lib/libc.so.6

Thread 3 (Thread 0x7f6aeeaaf700 (LWP 25586)):
#0  0x00007f6afd47435d in poll () at /lib/libc.so.6
#1  0x00007f6b011a4b98 in  () at /lib/libglib-2.0.so.0
#2  0x00007f6b011a4cbe in g_main_context_iteration () at /lib/libglib-2.0.so.0
#3  0x00007f6aeeab755d in  () at /usr/lib/gio/modules/libdconfsettings.so
#4  0x00007f6b011ccfca in  () at /lib/libglib-2.0.so.0
#5  0x00007f6afe242069 in start_thread () at /lib/libpthread.so.0
#6  0x00007f6afd47e30f in clone () at /lib/libc.so.6

Thread 2 (Thread 0x7f6aef6c8700 (LWP 25585)):
#0  0x00007f6afd47435d in poll () at /lib/libc.so.6
#1  0x00007f6b011a4b98 in  () at /lib/libglib-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#2  0x00007f6b011a4cbe in g_main_context_iteration () at /lib/libglib-2.0.so.0
#3  0x00007f6b011a4d12 in  () at /lib/libglib-2.0.so.0
#4  0x00007f6b011ccfca in  () at /lib/libglib-2.0.so.0
#5  0x00007f6afe242069 in start_thread () at /lib/libpthread.so.0
#6  0x00007f6afd47e30f in clone () at /lib/libc.so.6

Thread 1 (Thread 0x7f6b049e9100 (LWP 25584)):
#0  0x00007f6afd4765dc in pselect () at /lib/libc.so.6
#1  0x00000000005cf500 in really_call_select (arg=0x7ffc16edfa80) at thread.c:592
#2  0x00000000005d006e in flush_stack_call_func (arg=0x7ffc16edfa80, func=0x5cf4b0 <really_call_select>) at lisp.h:3791
#3  0x00000000005d006e in thread_select (func=<optimized out>, max_fds=max_fds@entry=19, rfds=rfds@entry=0x7ffc16edfb60, wfds=wfds@entry=0x7ffc16edfbe0, efds=efds@entry=0x0, timeout=timeout@entry=0x7ffc16ee0170, sigmask=0x0) at thread.c:624
#4  0x00000000005eb023 in xg_select (fds_lim=19, rfds=rfds@entry=0x7ffc16ee02a0, wfds=0x7ffc16ee0320, efds=<optimized out>, timeout=<optimized out>, sigmask=<optimized out>) at xgselect.c:131
#5  0x00000000005aeab4 in wait_reading_process_output (time_limit=time_limit@entry=30, nsecs=nsecs@entry=0, read_kbd=-1, do_display=do_display@entry=true, wait_for_cell=wait_for_cell@entry=0x0, wait_proc=wait_proc@entry=0x0, just_wait_proc=0) at process.c:5604
#6  0x00000000004253f8 in sit_for (timeout=timeout@entry=0x7a, reading=reading@entry=true, display_option=display_option@entry=1) at dispnew.c:6111
#7  0x00000000004fe415 in read_char (commandflag=commandflag@entry=1, map=map@entry=0x3184a63, p---Type <return> to continue, or q <return> to quit---
rev_event=<optimized out>, used_mouse_menu=used_mouse_menu@entry=0x7ffc16ee0b5b, end_time=end_time@entry=0x0) at keyboard.c:2742
#8  0x0000000000500841 in read_key_sequence (keybuf=keybuf@entry=0x7ffc16ee0c50, prompt=prompt@entry=0x0, dont_downcase_last=dont_downcase_last@entry=false, can_return_switch_frame=can_return_switch_frame@entry=true, fix_current_buffer=fix_current_buffer@entry=true, prevent_redisplay=prevent_redisplay@entry=false) at keyboard.c:9546
#9  0x0000000000502040 in command_loop_1 () at keyboard.c:1354
#10 0x000000000056a40e in internal_condition_case (bfun=bfun@entry=0x501e30 <command_loop_1>, handlers=handlers@entry=0x90, hfun=hfun@entry=0x4f8da0 <cmd_error>) at eval.c:1359
#11 0x00000000004f370c in command_loop_2 (ignore=ignore@entry=0x0) at keyboard.c:1095
#12 0x000000000056a3ac in internal_catch (tag=tag@entry=0xd740, func=func@entry=0x4f36f0 <command_loop_2>, arg=arg@entry=0x0) at eval.c:1120
#13 0x00000000004f36c9 in command_loop () at keyboard.c:1074
#14 0x00000000004f89c6 in recursive_edit_1 () at keyboard.c:718
#15 0x00000000004f8ce4 in Frecursive_edit () at keyboard.c:790
#16 0x000000000041a8f3 in main (argc=1, argv=0x7ffc16ee1048) at emacs.c:2047
(gdb)