GNU bug report logs - #52560
Profiles don't survive roundtrips via files

Previous Next

Package: emacs;

Reported by: Paul Pogonyshev <pogonyshev <at> gmail.com>

Date: Thu, 16 Dec 2021 18:12:01 UTC

Severity: normal

To reply to this bug, email your comments to 52560 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#52560; Package emacs. (Thu, 16 Dec 2021 18:12:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Pogonyshev <pogonyshev <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 16 Dec 2021 18:12:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Profiles don't survive roundtrips via files
Date: Thu, 16 Dec 2021 19:11:03 +0100
[Message part 1 (text/plain, inline)]
Emacs 27.2, pretty sure it has existed since forever and still exists.

To reproduce:

M-x profiler-start RET RET
<do whatever for a few seconds>
M-x profiler-stop RET
M-x profiler-report RET

After expanding a few nodes under `command-execute' you should come to
something like `#<subr call-interactively>'.

Now continue:

M-: (profiler-write-profile (profiler-cpu-profile) "/tmp/buggy-elisp.prof")
RET
M-: (profiler-report-profile (profiler-read-profile
"/tmp/buggy-elisp.prof")) RET

Expand the same nodes and observe that nodes with `#<whatever>' under them
no longer match, after file-roundtrip these `#<...>' multiply like crazy.
It seems what's going on is that these things get stored as strings in the
file, and after rereading them into memory, they no longer compare as equal
by profiler calltree-building code.

Paul
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52560; Package emacs. (Sun, 19 Dec 2021 11:54:01 GMT) Full text and rfc822 format available.

Message #8 received at 52560 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: 52560 <at> debbugs.gnu.org
Subject: Re: bug#52560: Profiles don't survive roundtrips via files
Date: Sun, 19 Dec 2021 12:53:38 +0100
Paul Pogonyshev <pogonyshev <at> gmail.com> writes:

> Emacs 27.2, pretty sure it has existed since forever and still exists.
>
> To reproduce:
>
> M-x profiler-start RET RET
> <do whatever for a few seconds>
> M-x profiler-stop RET
> M-x profiler-report RET
>
> After expanding a few nodes under `command-execute' you should come to
> something like `#<subr call-interactively>'.
>
> Now continue:
>
> M-: (profiler-write-profile (profiler-cpu-profile) "/tmp/buggy-elisp.prof") RET
> M-: (profiler-report-profile (profiler-read-profile "/tmp/buggy-elisp.prof")) RET
>
> Expand the same nodes and observe that nodes with `#<whatever>' under them
> no longer match, after file-roundtrip these `#<...>' multiply like crazy. 

I'm unable to reproduce this in Emacs 29 -- but then again, the profiles
report doesn't say things like #<whatever> in Emacs 29, so I may be
misunderstanding what you mean.

Could you try Emacs 28 (or 29) and see whether this problem still exists
there?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 19 Dec 2021 11:54:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52560; Package emacs. (Wed, 22 Dec 2021 12:32:02 GMT) Full text and rfc822 format available.

Message #13 received at 52560 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: 52560 <at> debbugs.gnu.org
Subject: Re: bug#52560: Profiles don't survive roundtrips via files
Date: Wed, 22 Dec 2021 13:30:55 +0100
Paul Pogonyshev <pogonyshev <at> gmail.com> writes:

> You need any profile that involves unnamed byte-compiled functions,
> i.e. lambda in code. Also, not as leaves, they must call other
> functions, because the problem appears when merging profile backtraces
> with this, i.e. there must be several.  Maybe "default" backtrace of
> running Emacs in 28 and up doesn't include those, but I'm pretty sure
> unnamed functions could not just disappear.

When "doing whatever" includes doing a completing-read, I get some
#<compiled> things...  but after following your recipe, I'm still not
sure I understand what the problem is.  Can you include some screenshots
of the good display and the bad display?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#52560; Package emacs. (Wed, 22 Dec 2021 16:04:02 GMT) Full text and rfc822 format available.

Message #16 received at 52560 <at> debbugs.gnu.org (full text, mbox):

From: Paul Pogonyshev <pogonyshev <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 52560 <at> debbugs.gnu.org
Subject: Re: bug#52560: Profiles don't survive roundtrips via files
Date: Wed, 22 Dec 2021 17:03:27 +0100
[Message part 1 (text/plain, inline)]
On the right is the original profile, on the left it is after a round-trip
via file (save/restore). Node "#<compiled -0xd1347ae057bdde2>" is now
displayed twice, even though profile contents is supposed to be exactly the
same.

Disregard ugly fonts etc. I just started this Docker image:
https://github.com/Silex/docker-emacs/blob/master/master/debian/Dockerfile.
Version is reported as GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X
toolkit, cairo version 1.16.0, Xaw3d scroll bars)

On Wed, 22 Dec 2021 at 13:30, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> Paul Pogonyshev <pogonyshev <at> gmail.com> writes:
>
> > You need any profile that involves unnamed byte-compiled functions,
> > i.e. lambda in code. Also, not as leaves, they must call other
> > functions, because the problem appears when merging profile backtraces
> > with this, i.e. there must be several.  Maybe "default" backtrace of
> > running Emacs in 28 and up doesn't include those, but I'm pretty sure
> > unnamed functions could not just disappear.
>
> When "doing whatever" includes doing a completing-read, I get some
> #<compiled> things...  but after following your recipe, I'm still not
> sure I understand what the problem is.  Can you include some screenshots
> of the good display and the bad display?
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>
[Message part 2 (text/html, inline)]
[bug-52560.png (image/png, attachment)]

Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 21 Jan 2022 13:38:02 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 241 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.