From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.bugs Subject: bug#21509: 25.0.50; X11 error: BadPixmap when creating first emacsclient frame; and memory leak Date: Fri, 08 Sep 2017 18:49:38 -0700 Message-ID: <87vaks8wul.fsf@scrawny> References: <877fno9w6b.fsf@secretsauce.net> <59ABD636.3070302@gmx.at> <87wp5d8y37.fsf@scrawny> <59AE5DD1.9050602@gmx.at> 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 1504921820 17992 195.159.176.226 (9 Sep 2017 01:50:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 9 Sep 2017 01:50:20 +0000 (UTC) User-Agent: mu4e 0.9.19; emacs 26.0.50 Cc: 21509@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 09 03:50:14 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 1dqUuR-00043F-96 for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Sep 2017 03:50:11 +0200 Original-Received: from localhost ([::1]:47888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqUuV-0007ep-Bm for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Sep 2017 21:50:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dqUuM-0007cX-Gb for bug-gnu-emacs@gnu.org; Fri, 08 Sep 2017 21:50:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dqUuJ-0001vC-DB for bug-gnu-emacs@gnu.org; Fri, 08 Sep 2017 21:50:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47946) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dqUuJ-0001ux-1Y for bug-gnu-emacs@gnu.org; Fri, 08 Sep 2017 21:50:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dqUuI-0003pm-Ki for bug-gnu-emacs@gnu.org; Fri, 08 Sep 2017 21:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Sep 2017 01:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21509 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21509-submit@debbugs.gnu.org id=B21509.150492178514708 (code B ref 21509); Sat, 09 Sep 2017 01:50:02 +0000 Original-Received: (at 21509) by debbugs.gnu.org; 9 Sep 2017 01:49:45 +0000 Original-Received: from localhost ([127.0.0.1]:56627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dqUu0-0003pA-Pc for submit@debbugs.gnu.org; Fri, 08 Sep 2017 21:49:44 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:37433) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dqUtx-0003p0-66 for 21509@debbugs.gnu.org; Fri, 08 Sep 2017 21:49:42 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 20F3720FBE; Fri, 8 Sep 2017 21:49:40 -0400 (EDT) Original-Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 08 Sep 2017 21:49:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=0REBdA ZSlcYGwLdxC4sk4OcL7xvzLWjpBWnZ7xcp+6A=; b=AZE2cSeD2lrYE/rJgb4DP1 Hi9azL2ZF8W/zwLyKR+Mg8gIuQXhqGocY8cIC8t6NQ3F3iG7+uoc/PnN2m7UEFgq fl4DagWjjTa3Bkv/Oj9ztBV0FBH9UG2YTBzl9T7Ix4IlLqdKkXxz3+zTTBOcQn32 h9fKH4bYGeFTwcL5PwuRZlMstw0yC11VAntAxSomLRqgeVNSOM5AMi7RLXaWYobK 4GB0+n6HSDHr9QqhAYzgW4AECLZJauR/kEN0ImeTmS8y/rxYbWIt5FHCcklKscHd VwG+flFwnxozRQKdCUs7cI9RfXbJOJq2svXAplVs9x48fGhSJ24zHbOSzHpeTC8g == DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=0REBdAZSlcYGwLdxC4sk4OcL7xvzLWjpBWnZ7xcp+6A=; b=iUv2hpLV 2hbI/vI64Ka6luePXBSCQRbgnoISwCyEMPt7ngqakKSwQkai2m1fBUSsdTjNaTrc Yt88ig+YSh6IOLbUt1d9LDnKzySvVXMXOC6uvw/Wiw+nlqtmikDGy+b4oTOkUNRl 600p4Vw80pIRNl7rHJlO4I3ntxZGbxPqgjUbDRSqxqUuJZF0SRzxrRUoNVtIzeMG Jg0DXZ3xJ+bsX/7sMPfPhqXoiZJ6aL+lnd+wEaNMW+qSg+h6doua7i8bvyTCG6AW yL4B7rYPSQicyCxTEGY3++jPjaxu7/amMpVdXZ+QD0TaUuG9I4jt4uK5ZJrTVgTh uYmjjvS/G790zw== X-ME-Sender: X-Sasl-enc: qgnnoLnSYE5faqCsDhv5dyALaEFWOes61FtTb6XlENFT 1504921779 Original-Received: from scrawny (50-1-153-150.dsl.dynamic.fusionbroadband.com [50.1.153.150]) by mail.messagingengine.com (Postfix) with ESMTPA id BDB9E240B1; Fri, 8 Sep 2017 21:49:39 -0400 (EDT) Original-Received: from dima by scrawny with local (Exim 4.88) (envelope-from ) id 1dqUtu-0003cv-Ge; Fri, 08 Sep 2017 18:49:38 -0700 In-reply-to: <59AE5DD1.9050602@gmx.at> 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:136693 Archived-At: martin rudalics writes: > > but also > > massively plugged the memory leaks that were associated with new emacs > > frames. Awesome! > > 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. > 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. > 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. > 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 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.