unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#58865: 29.0.50; Warnings when compiling net/dbus.el
@ 2022-10-29 12:02 Arash Esbati
  2022-10-29 15:04 ` Michael Albinus
  0 siblings, 1 reply; 8+ messages in thread
From: Arash Esbati @ 2022-10-29 12:02 UTC (permalink / raw)
  To: 58865

Hi all,

building Emacs from master (f826f56a41) issues this warning:

  In dbus-register-signal:
  net/dbus.el:842:16: Warning: reference to free variable `dbus-debug'

  In dbus-check-event:
  net/dbus.el:1073:9: Warning: reference to free variable `dbus-debug'

  In dbus-handle-event:
  net/dbus.el:1160:47: Warning: reference to free variable `dbus-debug'
  net/dbus.el:1283:9: Warning: Variable `dbus-debug' left uninitialized
  net/dbus.el:1295:9: Warning: Variable `dbus-debug' left uninitialized
  net/dbus.el:1311:9: Warning: Variable `dbus-debug' left uninitialized
  net/dbus.el:1320:9: Warning: Variable `dbus-debug' left uninitialized
  net/dbus.el:1394:9: Warning: Variable `dbus-debug' left uninitialized
  net/dbus.el:1631:9: Warning: Variable `dbus-debug' left uninitialized
  net/dbus.el:1891:18: Warning: Variable `dbus-debug' left uninitialized
    ELC      net/dns.elc

  In dbus-register-monitor:
  net/dbus.el:2032:11: Warning: reference to free variable `dbus-debug'

  In dbus--init:
  net/dbus.el:2255:8: Warning: reference to free variable `dbus-debug'

Best, Arash





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#58865: 29.0.50; Warnings when compiling net/dbus.el
  2022-10-29 12:02 bug#58865: 29.0.50; Warnings when compiling net/dbus.el Arash Esbati
@ 2022-10-29 15:04 ` Michael Albinus
  2022-10-29 21:38   ` Arash Esbati
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Albinus @ 2022-10-29 15:04 UTC (permalink / raw)
  To: Arash Esbati; +Cc: 58865

Arash Esbati <arash@gnu.org> writes:

> Hi all,

Hi Arash,

> building Emacs from master (f826f56a41) issues this warning:
>
>   In dbus-register-signal:
>   net/dbus.el:842:16: Warning: reference to free variable `dbus-debug'
>
>   In dbus-check-event:
>   net/dbus.el:1073:9: Warning: reference to free variable `dbus-debug'
>
>   In dbus-handle-event:
>   net/dbus.el:1160:47: Warning: reference to free variable `dbus-debug'
>   net/dbus.el:1283:9: Warning: Variable `dbus-debug' left uninitialized
>   net/dbus.el:1295:9: Warning: Variable `dbus-debug' left uninitialized
>   net/dbus.el:1311:9: Warning: Variable `dbus-debug' left uninitialized
>   net/dbus.el:1320:9: Warning: Variable `dbus-debug' left uninitialized
>   net/dbus.el:1394:9: Warning: Variable `dbus-debug' left uninitialized
>   net/dbus.el:1631:9: Warning: Variable `dbus-debug' left uninitialized
>   net/dbus.el:1891:18: Warning: Variable `dbus-debug' left uninitialized
>     ELC      net/dns.elc
>
>   In dbus-register-monitor:
>   net/dbus.el:2032:11: Warning: reference to free variable `dbus-debug'
>
>   In dbus--init:
>   net/dbus.el:2255:8: Warning: reference to free variable `dbus-debug'

Doesn't happen here. Is it reproducible with "make bootstrap"?

> Best, Arash

Best regards, Michael.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#58865: 29.0.50; Warnings when compiling net/dbus.el
  2022-10-29 15:04 ` Michael Albinus
@ 2022-10-29 21:38   ` Arash Esbati
  2022-10-31 15:58     ` Michael Albinus
  0 siblings, 1 reply; 8+ messages in thread
From: Arash Esbati @ 2022-10-29 21:38 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 58865

Hi Michael,

Michael Albinus <michael.albinus@gmx.de> writes:

> Doesn't happen here. Is it reproducible with "make bootstrap"?

I build Emacs with a script which does:

  git clean -fdx --exclude=ChangeLog
  ./autogen.sh
  ...

So my local repo is in a clean state when the compilation starts.  I
tried 'make bootstrap' and the issue remains.

Best, Arash





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#58865: 29.0.50; Warnings when compiling net/dbus.el
  2022-10-29 21:38   ` Arash Esbati
@ 2022-10-31 15:58     ` Michael Albinus
  2022-10-31 17:57       ` Eli Zaretskii
                         ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Michael Albinus @ 2022-10-31 15:58 UTC (permalink / raw)
  To: Arash Esbati; +Cc: 58865, Stefan Monnier

Arash Esbati <arash@gnu.org> writes:

> Hi Michael,

Hi Arash,

>> Doesn't happen here. Is it reproducible with "make bootstrap"?
>
> I build Emacs with a script which does:
>
>   git clean -fdx --exclude=ChangeLog
>   ./autogen.sh
>   ...
>
> So my local repo is in a clean state when the compilation starts.  I
> tried 'make bootstrap' and the issue remains.

In the future, please report bugs via `report-emacs-bug'. This gives
useful information.

You appear to have configured Emacs --without-dbus, which would have
been seen when using the bug submit function. Using this configure
option I can reproduce the bug.

However, dbus.el is prepared to care this situation. It contains the code

--8<---------------cut here---------------start------------->8---
;; The following symbols are defined in dbusbind.c.  We need them also
;; when Emacs is compiled without D-Bus support.
(unless (boundp 'dbus-error)
  (define-error 'dbus-error "D-Bus error"))

(unless (boundp 'dbus-debug)
  (defvar dbus-debug nil))
--8<---------------cut here---------------end--------------->8---

This has worked fine until recently. According to git bisect, the
following commit has broken this:

--8<---------------cut here---------------start------------->8---
1b1ffe07897ebe06cf96ab423fad3cde9fd6c981 is the first bad commit
commit 1b1ffe07897ebe06cf96ab423fad3cde9fd6c981
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Mon Oct 17 17:11:40 2022 -0400

    (Ffunction): Make interpreted closures safe for space
--8<---------------cut here---------------end--------------->8---

Stefan, could you pls have a look on this?

> Best, Arash

Best regards, Michael.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#58865: 29.0.50; Warnings when compiling net/dbus.el
  2022-10-31 15:58     ` Michael Albinus
@ 2022-10-31 17:57       ` Eli Zaretskii
  2022-10-31 20:33       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-11-01 11:58       ` Arash Esbati
  2 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2022-10-31 17:57 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 58865, arash, monnier

> Cc: 58865@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
> From: Michael Albinus <michael.albinus@gmx.de>
> Date: Mon, 31 Oct 2022 16:58:07 +0100
> 
> In the future, please report bugs via `report-emacs-bug'. This gives
> useful information.

Hear, hear!  For some reasons, veteran contributors and users of Emacs
neglect to use report-emacs-bug, which many times makes the triage and
the analysis of the issue harder and more time consuming, let alone
error-prone.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#58865: 29.0.50; Warnings when compiling net/dbus.el
  2022-10-31 15:58     ` Michael Albinus
  2022-10-31 17:57       ` Eli Zaretskii
@ 2022-10-31 20:33       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-11-01 15:39         ` Michael Albinus
  2022-11-01 11:58       ` Arash Esbati
  2 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-10-31 20:33 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 58865, Arash Esbati

> However, dbus.el is prepared to care this situation. It contains the code
>
> --8<---------------cut here---------------start------------->8---
> ;; The following symbols are defined in dbusbind.c.  We need them also
> ;; when Emacs is compiled without D-Bus support.
> (unless (boundp 'dbus-error)
>   (define-error 'dbus-error "D-Bus error"))
>
> (unless (boundp 'dbus-debug)
>   (defvar dbus-debug nil))
> --8<---------------cut here---------------end--------------->8---

Hmm... this will define `dbus-debug` as a dynamically scoped variable
when `dbus.el(c)` is *loaded* but not while compiling this file, so the
compilation *should* arguably emit those warnings (and those relating
the the places where we let-bind this var reflect real bugs because
we'll miscompile those bindings as if they were using static scoping).

So I think the code requires a top-level (defvar dbus-debug).

> This has worked fine until recently. According to git bisect, the
> following commit has broken this:
>
> --8<---------------cut here---------------start------------->8---
> 1b1ffe07897ebe06cf96ab423fad3cde9fd6c981 is the first bad commit

I wonder why we didn't get warnings before that commit (and why this
commit makes a difference).

...

Oh, I see.  The patch changed a bit how dynvars are recognized which
fixed some cases where `defvar`s "leaked" outside of their context.

The previous leak, in the present case, caused the `(defvar dbus-debug
nil)` to mark that var as dyn-bound in the whole file rather than only
within the `unless` where it appears.
Admittedly, in this case it was the right call :-)


        Stefan






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#58865: 29.0.50; Warnings when compiling net/dbus.el
  2022-10-31 15:58     ` Michael Albinus
  2022-10-31 17:57       ` Eli Zaretskii
  2022-10-31 20:33       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-11-01 11:58       ` Arash Esbati
  2 siblings, 0 replies; 8+ messages in thread
From: Arash Esbati @ 2022-11-01 11:58 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 58865, Stefan Monnier

Hi Michael,

Michael Albinus <michael.albinus@gmx.de> writes:

> In the future, please report bugs via `report-emacs-bug'. This gives
> useful information.
>
> You appear to have configured Emacs --without-dbus, which would have
> been seen when using the bug submit function. Using this configure
> option I can reproduce the bug.

To be honest, building Emacs worked fine without warnings from Tramp for
such a long time that I thought I'm reporting something easy to fix
(like my other report #58864 about hierarchy.el), so I even missed to
say that I'm building Emacs on Windows 10; and that would have been the
hint for '--without-dbus'.  At any rate, sorry for not being precise in
the first place; I'll consider `report-emacs-bug' in future.

Best, Arash





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#58865: 29.0.50; Warnings when compiling net/dbus.el
  2022-10-31 20:33       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-11-01 15:39         ` Michael Albinus
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Albinus @ 2022-11-01 15:39 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Arash Esbati, 58865-done

Version: 29.1

Stefan Monnier <monnier@iro.umontreal.ca> writes:

Hi Stefan,

> So I think the code requires a top-level (defvar dbus-debug).

Done, pushed to master. I'm closing the bug.

And thanks for the explanation!

>         Stefan

Best regards, Michael.





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-11-01 15:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-29 12:02 bug#58865: 29.0.50; Warnings when compiling net/dbus.el Arash Esbati
2022-10-29 15:04 ` Michael Albinus
2022-10-29 21:38   ` Arash Esbati
2022-10-31 15:58     ` Michael Albinus
2022-10-31 17:57       ` Eli Zaretskii
2022-10-31 20:33       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-01 15:39         ` Michael Albinus
2022-11-01 11:58       ` Arash Esbati

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).