From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.emacs.devel Subject: Re: Dumper problems and a possible solutions Date: Thu, 26 Jun 2014 00:28:39 -0400 Message-ID: <20140626042839.GI179@brightrain.aerifal.cx> References: <53AB0EF8.4090608@yandex.ru> <831tucrguf.fsf@gnu.org> <20140625183241.GW179@brightrain.aerifal.cx> <83wqc4q0xl.fsf@gnu.org> <20140625190333.GZ179@brightrain.aerifal.cx> <83vbropzlz.fsf@gnu.org> <20140625195730.GA179@brightrain.aerifal.cx> <83tx78pwzd.fsf@gnu.org> <20140625203403.GC179@brightrain.aerifal.cx> <83simspexv.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1403756944 23998 80.91.229.3 (26 Jun 2014 04:29:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Jun 2014 04:29:04 +0000 (UTC) Cc: dmantipov@yandex.ru, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 26 06:28:57 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X01It-0003nu-Cb for ged-emacs-devel@m.gmane.org; Thu, 26 Jun 2014 06:28:55 +0200 Original-Received: from localhost ([::1]:42200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X01It-0003pd-1Q for ged-emacs-devel@m.gmane.org; Thu, 26 Jun 2014 00:28:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X01In-0003pW-1Q for emacs-devel@gnu.org; Thu, 26 Jun 2014 00:28:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X01Ij-0004Zl-0f for emacs-devel@gnu.org; Thu, 26 Jun 2014 00:28:48 -0400 Original-Received: from 216-12-86-13.cv.mvl.ntelos.net ([216.12.86.13]:44458 helo=brightrain.aerifal.cx) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X01Ie-0004Z1-HA; Thu, 26 Jun 2014 00:28:40 -0400 Original-Received: from dalias by brightrain.aerifal.cx with local (Exim 3.15 #2) id 1X01Id-0005ud-00; Thu, 26 Jun 2014 04:28:39 +0000 Content-Disposition: inline In-Reply-To: <83simspexv.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 216.12.86.13 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:172744 Archived-At: On Thu, Jun 26, 2014 at 05:44:44AM +0300, Eli Zaretskii wrote: > > Date: Wed, 25 Jun 2014 16:34:03 -0400 > > From: Rich Felker > > Cc: dmantipov@yandex.ru, emacs-devel@gnu.org > > > > > And still, there are only a few (maybe 10) times we allocate these > > > 700K tables, so 400MB sound very strange to me. > > > > In my log, I see 768k allocations occuring roughly 94 times. > > 768K times 94 doesn't get anywhere close to 400MB. Yes, there were also a number of ~200k and ~400k allocations though, which I did not get around to identifying the source of. > > > > Those ctors are free to inspect global data. For example one might > > > > contain (this sort of idiom is necessary if you can't control the > > > > relative order of ctors): if (!init) { do_something(); init=1; }. In > > > > that case, the dump would save the value of init, and do_something() > > > > would fail to happen at runtime. > > > > > > That's the same problem as with your clock_gettime, and it must be > > > fixed anyway, because any ctor run at dump time is almost certainly > > > picking up data that is irrelevant to the run time. > > > > Libc could _possibly_ work around it by virtue of having full control > > over the init code. For other libraries, the issue is not fixable (see > > my above example with code that has to control dependency order of > > ctors), and shouldn't have to be fixed. > > But the problem likely doesn't exist, because otherwise we will have > known about it by now. Emacs cannot use such libraries. I wouldn't be so sure. How much testing is even done with static linking? With dynamic linking, the library's state will all be lost across dump. Lots of the libraries emacs can optionally use have sketchy global state, and I wouldn't be surprised at all if at least one of them were failing to properly initialize in the post-dump emacs. The symptoms might not even be immediately visible if the state saved when dumping were "close enough" to correct to be used post-dump. Rich