From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Preview: portable dumper Date: Wed, 14 Feb 2018 23:28:36 -0500 Message-ID: References: <047a67ec-9e29-7e4e-0fb0-24c3e59b5886@dancol.org> <83zikjxt1j.fsf@gnu.org> <8360n6ruzu.fsf@gnu.org> <834m2nplmb.fsf@gnu.org> <83inr2oje6.fsf@gnu.org> <83bmwuogfb.fsf@gnu.org> <878trydrbo.fsf@red-bean.com> <87d15jo39q.fsf@ritchie.wxcvbn.org> <26497701-9de7-b91e-7ac3-4fb5949b436e@dancol.org> 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 1518668863 22667 195.159.176.226 (15 Feb 2018 04:27:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Feb 2018 04:27:43 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 15 05:27:39 2018 Return-path: Envelope-to: ged-emacs-devel@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 1emB8f-0004JS-2x for ged-emacs-devel@m.gmane.org; Thu, 15 Feb 2018 05:27:17 +0100 Original-Received: from localhost ([::1]:37483 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emBAg-0007MS-UZ for ged-emacs-devel@m.gmane.org; Wed, 14 Feb 2018 23:29:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emBAX-0007MD-Ez for emacs-devel@gnu.org; Wed, 14 Feb 2018 23:29:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emBAU-0003pT-B1 for emacs-devel@gnu.org; Wed, 14 Feb 2018 23:29:13 -0500 Original-Received: from [195.159.176.226] (port=54554 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1emBAU-0003pA-0O for emacs-devel@gnu.org; Wed, 14 Feb 2018 23:29:10 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1emB8D-0002UM-F0 for emacs-devel@gnu.org; Thu, 15 Feb 2018 05:26:49 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 101 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:yFc6tRWVdIxPVaaGyyLSrwNsfz8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:222758 Archived-At: > I've pushed the portable dumper to the pdumper Savannah branch. It should > support a fully PIC Emacs. Thank you very much Daniel. I hope this can move to master soon. I just tried it (on Debian testing, with the latest commit at the time, i.e. 5232a17c365f871a84603caba81712415a260042) and here's my experience: - compilation fails with In file included from character.h:27:0, from buffer.h:27, from pdumper.c:18: pdumper.c: In function ‘intmax_t_to_lisp’: pdumper.c:699:29: error: conversion to ‘EMACS_INT {aka int}’ from ‘intmax_t {aka long long int}’ may alter its value [-Werror=conversion] return INTEGER_TO_CONS (value); \ ^ lisp.h:3572:19: note: in definition of macro ‘INTEGER_TO_CONS’ ? make_number (i) \ ^ pdumper.c:703:1: note: in expansion of macro ‘DEFINE_TOLISP_FUNC’ DEFINE_TOLISP_FUNC (intmax_t_to_lisp, intmax_t); ^~~~~~~~~~~~~~~~~~ pdumper.c: In function ‘pdumper_load’: pdumper.c:5049:14: error: conversion to ‘unsigned int’ from ‘off_t {aka long long int}’ may alter its value [-Werror=conversion] .size = dump_size - header->cold_start, ^~~~~~~~~ pdumper.c:5072:21: error: conversion to ‘intptr_t {aka int}’ from ‘off_t {aka long long int}’ may alter its value [-Werror=conversion] dump_public.end = dump_public.start + dump_size; ^~~~~~~~~~~ In file included from character.h:27:0, from buffer.h:27, from pdumper.c:18: I fixed those with the patch below, but it seems there's some issues with off_t vs size_t (I guess a dump file shouldn't be bigger than the available address space, so even though the max size of files can be much bigger, we can use smaller integers to refer to size&position within dump files). - after that the dump itself crashed as follows: pdumper.c:2468: Emacs fatal error: assertion failed: vector_nbytes ((struct Lisp_Vector *) in) == out_size Backtrace below. Stefan Finding pointers to doc strings... Finding pointers to doc strings...done Dumping under the name bootstrap-emacs.pdmp dumping fingerprint: d003f05f220e1040ec992fccec03d65c4934d9181cbde233f17892969593f435 pdumper.c:2468: Emacs fatal error: assertion failed: vector_nbytes ((struct Lisp_Vector *) in) == out_size Thread 1 "temacs" hit Breakpoint 1, terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:357 (gdb) bt #0 0x08194a5a in terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:357 #1 0x08216a9e in die (msg=0x833c654 "vector_nbytes ((struct Lisp_Vector *) in) == out_size", file=0x833b6f8 "pdumper.c", line=2468) at alloc.c:7796 #2 0x08227321 in dump_object_start_pseudovector (ctx=ctx@entry=0xbfffec08, out_hdr=out_hdr@entry=0xbfffe730, out_size=out_size@entry=536, in_hdr=0xbfffe948) at pdumper.c:2468 #3 0x082284d0 in dump_buffer (ctx=0xbfffec08, in_buffer=0x8718d20) at pdumper.c:2632 #4 0x08228be1 in dump_vectorlike (ctx=ctx@entry=0xbfffec08, v=0x8718d20) at pdumper.c:2825 #5 0x08228dc1 in dump_object_1 (ctx=ctx@entry=0xbfffec08, object=object@entry=XIL(0x8718d25)) at pdumper.c:2889 #6 0x08228f2e in dump_object (ctx=ctx@entry=0xbfffec08, object=XIL(0x8718d25)) at pdumper.c:2954 #7 0x0822981f in Fdump_emacs_portable (filename=XIL(0x922ce54), track_referrers=XIL(0)) at pdumper.c:3780 #8 0x08251349 in eval_sub (form=...) at eval.c:2290 #9 0x08252337 in Fif (args=XIL(0x88f13db)) at eval.c:414 #10 0x08250ff4 in eval_sub (form=...) at eval.c:2239 #11 0x082518e9 in Fprogn (body=...) at eval.c:459 #12 0x08253ef5 in Flet (args=XIL(0x88b029b)) at eval.c:973 #13 0x08250ff4 in eval_sub (form=...) at eval.c:2239 #14 0x08252337 in Fif (args=XIL(0x87f975b)) at eval.c:414 #15 0x08250ff4 in eval_sub (form=...) at eval.c:2239 #16 0x08286d3c in readevalloop (readcharfun=XIL(0x34c8), infile0=infile0@entry=0xbffff1a4, sourcename=..., sourcename@entry=XIL(0x873c434), printflag=false, unibyte=XIL(0), readfun=XIL(0), start=XIL(0), end=XIL(0)) at lread.c:2073 #17 0x08287cbc in Fload (file=XIL(0x8723644), noerror=XIL(0), nomessage=XIL(0), nosuffix=XIL(0), must_suffix=XIL(0)) at lread.c:1457 #18 0x082513c7 in eval_sub (form=...) at eval.c:2301 #19 0x0825450a in Feval (form=XIL(0x87128bb), lexical=XIL(0)) at eval.c:2107 #20 0x081992fe in top_level_2 () at keyboard.c:1122 #21 0x0824c263 in internal_condition_case (bfun=0x81992c8 , handlers=XIL(0x2988), hfun=0x819eb61 ) at eval.c:1336 #22 0x0819cbaf in top_level_1 (ignore=XIL(0)) at keyboard.c:1130 #23 0x0824c160 in internal_catch (tag=XIL(0x64e0), func=0x819caf0 , arg=XIL(0)) at eval.c:1101 #24 0x0819b8ef in command_loop () at keyboard.c:1091 #25 0x0819e233 in recursive_edit_1 () at keyboard.c:698 #26 0x0819e896 in Frecursive_edit () at keyboard.c:769 #27 0x08195aaa in main (argc=, argv=) at emacs.c:1915 Lisp Backtrace: "dump-emacs-portable" (0xbfffed5c) "if" (0xbfffee4c) "let" (0xbfffef8c) "if" (0xbffff05c) "load" (0xbffff28c) (gdb)