GNU bug report logs - #50301
[PATCH] memory-report: support calculating size for structures

Previous Next

Package: emacs;

Reported by: yikai <at> z1k.dev

Date: Tue, 31 Aug 2021 16:20:01 UTC

Severity: normal

Tags: patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50301 in the body.
You can then email your comments to 50301 AT debbugs.gnu.org in the normal way.

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#50301; Package emacs. (Tue, 31 Aug 2021 16:20:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to yikai <at> z1k.dev:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 31 Aug 2021 16:20:01 GMT) Full text and rfc822 format available.

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

From: yikai <at> z1k.dev
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] memory-report: support calculating size for structures
Date: Wed, 01 Sep 2021 00:11:18 +0800
[Message part 1 (text/plain, inline)]
Tags: patch

Tags: patch


(already sent to emacs-devel mailing list, re-submit using submit-emacs-patch)

Here's another patch on memory-report package which fixes the object
size calculation for structures (cl-defstruct types). Before this patch,
memory-report--object-size will report empty size for structure objects,
which results in incorrect report about "Largest Variables" in
memory-report result.


In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.17.4)
 of 2021-08-20 built on lilydjwg
Repository revision: 657fe8b9d87dd17d9b50dd8e15bfd917c6c630b2
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Arch Linux

Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games
 --with-sound=alsa --with-modules --without-gconf --without-gsettings
 --enable-link-time-optimization --with-native-compilation
 --with-x-toolkit=gtk3 --without-xaw3d --without-compress-install
 '--program-transform-name=s/\([ec]tags\)/\1.emacs/'
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -flto
 -fuse-linker-plugin' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

[0001-memory-report-support-calculating-size-for-structure.patch (text/patch, attachment)]

Added tag(s) pending. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 01 Sep 2021 08:18:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50301; Package emacs. (Thu, 02 Sep 2021 07:38:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: yikai <at> z1k.dev
Cc: 50301 <at> debbugs.gnu.org
Subject: Re: bug#50301: [PATCH] memory-report: support calculating size for
 structures
Date: Thu, 02 Sep 2021 09:37:26 +0200
yikai <at> z1k.dev writes:

> Here's another patch on memory-report package which fixes the object
> size calculation for structures (cl-defstruct types). Before this patch,
> memory-report--object-size will report empty size for structure objects,
> which results in incorrect report about "Largest Variables" in
> memory-report result.

Thanks; applied to Emacs 28.

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




bug marked as fixed in version 28.1, send any further explanations to 50301 <at> debbugs.gnu.org and yikai <at> z1k.dev Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 02 Sep 2021 07:38:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50301; Package emacs. (Thu, 02 Sep 2021 23:50:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 50301 <at> debbugs.gnu.org, yikai <at> z1k.dev
Subject: Re: bug#50301: [PATCH] memory-report: support calculating size for
 structures
Date: Thu, 02 Sep 2021 19:49:00 -0400
make lisp/emacs-lisp/memory-report-tests TEST_LOAD_EL=no

fails with: void-function cl-struct-slot-info




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50301; Package emacs. (Fri, 03 Sep 2021 05:48:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 50301 <at> debbugs.gnu.org, yikai <at> z1k.dev
Subject: Re: bug#50301: [PATCH] memory-report: support calculating size for
 structures
Date: Fri, 03 Sep 2021 07:47:37 +0200
Glenn Morris <rgm <at> gnu.org> writes:

> make lisp/emacs-lisp/memory-report-tests TEST_LOAD_EL=no
>
> fails with: void-function cl-struct-slot-info

Yup; now fixed.  (I didn't notice, because it didn't fail with just
"cd test; make".)

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50301; Package emacs. (Sat, 04 Sep 2021 16:39:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 50301 <at> debbugs.gnu.org, yikai <at> z1k.dev
Subject: Re: bug#50301: [PATCH] memory-report: support calculating size for
 structures
Date: Sat, 04 Sep 2021 12:38:37 -0400
> make lisp/emacs-lisp/memory-report-tests TEST_LOAD_EL=no
>
> fails with: void-function cl-struct-slot-info

And so does
emacs -Q -f memory-report

As cl-struct-slot-info is a non-autoloaded function in cl-macs
(an internal cl-lib component), I don't see how it is supposed to be
used by external packages. Yet it is documented in the cl-lib manual,
and used in eg tramp...




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50301; Package emacs. (Sun, 05 Sep 2021 08:07:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 50301 <at> debbugs.gnu.org, Lars Ingebrigtsen <larsi <at> gnus.org>, yikai <at> z1k.dev
Subject: Re: bug#50301: [PATCH] memory-report: support calculating size for
 structures
Date: Sun, 05 Sep 2021 10:06:11 +0200
Glenn Morris <rgm <at> gnu.org> writes:

Hi Glenn,

> As cl-struct-slot-info is a non-autoloaded function in cl-macs
> (an internal cl-lib component), I don't see how it is supposed to be
> used by external packages. Yet it is documented in the cl-lib manual,
> and used in eg tramp...

So we shall autoload it?

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50301; Package emacs. (Sun, 05 Sep 2021 08:43:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 50301 <at> debbugs.gnu.org, Glenn Morris <rgm <at> gnu.org>, yikai <at> z1k.dev,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#50301: [PATCH] memory-report: support calculating size for
 structures
Date: Sun, 05 Sep 2021 10:41:56 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

>> As cl-struct-slot-info is a non-autoloaded function in cl-macs
>> (an internal cl-lib component), I don't see how it is supposed to be
>> used by external packages. Yet it is documented in the cl-lib manual,
>> and used in eg tramp...
>
> So we shall autoload it?

Well, that seems like the obvious fix here...  and there's plenty of
other autoloaded functions in cl-macs.  But I've added Stefan to the
CCs; perhaps he has comments here.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50301; Package emacs. (Sun, 05 Sep 2021 14:44:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 50301 <at> debbugs.gnu.org, Glenn Morris <rgm <at> gnu.org>, yikai <at> z1k.dev,
 Michael Albinus <michael.albinus <at> gmx.de>
Subject: Re: bug#50301: [PATCH] memory-report: support calculating size for
 structures
Date: Sun, 05 Sep 2021 10:43:46 -0400
Lars Ingebrigtsen [2021-09-05 10:41:56] wrote:
> Michael Albinus <michael.albinus <at> gmx.de> writes:
>>> As cl-struct-slot-info is a non-autoloaded function in cl-macs
>>> (an internal cl-lib component), I don't see how it is supposed to be
>>> used by external packages. Yet it is documented in the cl-lib manual,
>>> and used in eg tramp...
>>
>> So we shall autoload it?
>
> Well, that seems like the obvious fix here...  and there's plenty of
> other autoloaded functions in cl-macs.  But I've added Stefan to the
> CCs; perhaps he has comments here.

Autoload sounds like the correct fix.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50301; Package emacs. (Sun, 05 Sep 2021 14:53:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 50301 <at> debbugs.gnu.org, Glenn Morris <rgm <at> gnu.org>, yikai <at> z1k.dev,
 Michael Albinus <michael.albinus <at> gmx.de>
Subject: Re: bug#50301: [PATCH] memory-report: support calculating size for
 structures
Date: Sun, 05 Sep 2021 16:52:34 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> Autoload sounds like the correct fix.

OK; now done (and removed that offending (require 'cl-macs).)

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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 04 Oct 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 196 days ago.

Previous Next


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