unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Dima Kogan <dima@secretsauce.net>
Cc: 21509@debbugs.gnu.org
Subject: bug#21509: 25.0.50; X11 error: BadPixmap when creating first emacsclient frame; and memory leak
Date: Sat, 09 Sep 2017 09:59:50 +0200	[thread overview]
Message-ID: <59B39F76.2010508@gmx.at> (raw)
In-Reply-To: <87vaks8wul.fsf@scrawny>

 >> IIUC your numbers of Lucid with scrollbars now coincide with the numbers
 >> of Lucid without scrollbars before the "fix".
 >
 > No, that's not right.
 >
 > Lucid with scrollbars post-fix is the blue line: memory usage is stable
 > as frames are created/destroyed: the leak is ~0
 >
 > Lucid without scrollbars pre-fix is the green line. Memory usage is
 > climbing. We aren't leaking as badly as the other cases, but we ARE
 > leaking.
 >
 > So the fix resolved the large leakages in the other cases and also the
 > small leakages that weren't scroll-bar-related.

I can't follow you.  before.no.scroll.log has

16112 19608 S ?        00:00:00 emacs
...
16112 29700 S ?        00:00:12 emacs

while after.yes.scroll.log has

17508 19652 S ?        00:00:00 emacs
...
17508 29160 S ?        00:00:13 emacs

which strike me as very similar (especially given the figures of the two
other logs).  What am I missing?

 >> OTOH the numbers for GTK largely coincide with those of Lucid with
 >> scrollbars before the "fix". So X itself seems much more dominant than
 >> any toolkit particularities.
 >
 > I don't think this is right either. Lucid with scrollbars pre-fix is the
 > purple line. We leak memory at a high, constant rate. GTK memory usage
 > (yellow) is noisy and fragmented (I bet we're invoking malloc/free much
 > more often). The baseline memory consumption is higher, the past that,
 > the leak rate isn't nearly as bad as the purple. The higher
 > fragmentation means that the internals of malloc() matter too: I invoked
 > malloc_trim() just after t=450s, and we see the memory usage dropped
 > sharply as a result.

I can't tell that since it's not in your figures.  But again, the raw
data from before.log and after.yes.scroll.gtk.log seem similar too.

 >> This does not explain any difference between the GTK (before the "fix")
 >> and Lucid (after the "fix") behaviors.  What happens with GTK when you
 >> allow it to delete the terminal by allowing terminal->reference_count
 >> drop to zero?  If it does not crash immediately, is the memory leak more
 >> heavy than it is now?
 >
 > I haven't run that experiment, but I could do that. Probably won't get
 > to it for a week, though.

Please try.  If you succeed running it, the resulting difference between
the "before" GTK and Lucid runs should IMHO show the noise introduced by
malloc/free more clearly.  And obviously running the before/after
experiments for Motif would be interesting too: The Motif build crashed
in the menu bar section while the Lucid build crashed in the scroll bar
section.

 >> Also, could you try whether changing  gc-cons-threshold  in either
 >> direction has any impact on the occurrence of the toolkit bug or the
 >> growth of the memory leak?  Once I thought that this could affect the
 >> frequency of the error but didn't get any conclusive results.
 >
 > OK. I'll look.
 >
 > By the way, if you haven't tried it yet, look at rr:
 >
 > http://www.rr-project.com

It's

http://www.rr-project.org

now.

 > It's a debugging instrumentation tool that saves a process execution
 > trace, and lets you replay it forwards and backwards in gdb. Could make
 > it possible to find heisen-problems such as this.

If it's a GC related problem, it would need more patience than I'm able
to provide anyway.  I'm still trying to find a common pattern for all
these behaviors from a coarse-grained perspective.  And obviously it
would be interesting to find out why the whereabouts at the time of the
"X11 error that blows up the window" apparently differ for the various
builds.  IIUC it's still us who determine which one to draw first - the
menu bar or the scroll bar.

martin





  reply	other threads:[~2017-09-09  7:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18  4:41 bug#21509: 25.0.50; X11 error: BadPixmap when creating first emacsclient frame; and memory leak Dima Kogan
     [not found] ` <handler.21509.B.14425512741008.ack@debbugs.gnu.org>
2015-10-02  7:32   ` bug#21509: update Dima Kogan
2017-09-03 10:15 ` bug#21509: 25.0.50; X11 error: BadPixmap when creating first emacsclient frame; and memory leak martin rudalics
2017-09-05  6:21   ` Dima Kogan
2017-09-05  8:18     ` martin rudalics
2017-09-09  1:49       ` Dima Kogan
2017-09-09  7:59         ` martin rudalics [this message]
2017-10-15  3:48           ` Dima Kogan
2017-10-15  9:40             ` martin rudalics
2017-10-15 18:24               ` Dima Kogan
2017-10-16  7:42                 ` martin rudalics
2017-10-16 16:33                   ` Dima Kogan
2017-10-17  8:58                     ` martin rudalics

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=59B39F76.2010508@gmx.at \
    --to=rudalics@gmx.at \
    --cc=21509@debbugs.gnu.org \
    --cc=dima@secretsauce.net \
    /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).