GNU bug report logs - #12647
24.2.50; emacs --daemon broken in tty

Previous Next

Package: emacs;

Reported by: Toby Cubitt <toby-dated-1351439087.748fe4 <at> dr-qubit.org>

Date: Sun, 14 Oct 2012 15:47:01 UTC

Severity: important

Merged with 12678

Found in version 24.2.50

Done: Glenn Morris <rgm <at> gnu.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 12647 in the body.
You can then email your comments to 12647 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#12647; Package emacs. (Sun, 14 Oct 2012 15:47:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Toby Cubitt <toby-dated-1351439087.748fe4 <at> dr-qubit.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 14 Oct 2012 15:47:02 GMT) Full text and rfc822 format available.

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

From: Toby Cubitt <tsc25 <at> cantab.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2.50; emacs --daemon broken in tty
Date: Sun, 14 Oct 2012 17:44:58 +0200
"emacsclient -c" throws an error if "emacs --daemon" is started outside
of X windows, . This is on a recent bzr checkout (from today).

Steps to reproduce:

1. switch to a linux virtual tty

2. emacs -Q --daemon

3. switch to X windows

4. emacsclient -c aborts with the following error:

   Waiting for Emacs...
   *ERROR*: Wrong type argument: stringp, nil


(This bug breaks the Gentoo emacs daemon init scripts.)

Note that "emacsclient -nw" does still open tty frames successfully on a
daemon started from a tty. And running "emacs --daemon" from within X
windows allows emacsclient to create both types of frame successfully.


In GNU Emacs 24.2.50.1 (i686-pc-linux-gnu, GTK+ Version 3.4.4)
 of 2012-10-14 on c3po
Bzr revision: handa <at> gnu.org-20121014080652-4o4ptkifsi2xqtk4
Windowing system distributor `The X.Org Foundation', version 11.0.11202000
Configured using:
 `configure '--prefix=/usr' '--host=i686-pc-linux-gnu'
 '--mandir=/usr/share/man' '--infodir=/usr/share/info'
 '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib'
 '--disable-dependency-tracking' '--program-suffix=-emacs-24-vcs'
 '--program-transform-name=s/emacs-[0-9].*/emacs-24-vcs/'
 '--infodir=/usr/share/info/emacs-24-vcs'
 '--enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.5.4/../../../../lib'
 '--with-gameuser=games' '--without-compress-info' '--without-hesiod'
 '--without-kerberos' '--without-kerberos5' '--with-gpm' '--with-dbus'
 '--without-gnutls' '--without-xml2' '--without-selinux'
 '--without-wide-int' '--without-sound' '--with-x' '--without-ns'
 '--without-gconf' '--without-gsettings' '--with-toolkit-scroll-bars'
 '--without-gif' '--without-jpeg' '--with-png' '--with-rsvg'
 '--without-tiff' '--with-xpm' '--without-imagemagick' '--with-xft'
 '--without-libotf' '--without-m17n-flt' '--with-x-toolkit=gtk3'
 'GENTOO_PACKAGE=app-editors/emacs-vcs-24.2.9999' 'EBZR_BRANCH=trunk'
 'EBZR_REVNO=110543' '--build=i686-pc-linux-gnu'
 'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu'
 'CFLAGS=-march=prescott -O2 -pipe -O2' 'LDFLAGS=-Wl,-O1
 -Wl,--as-needed' 'CPPFLAGS=''

Important settings:
  value of $LANG: en_GB.utf-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t


-- 
Dr T. S. Cubitt
Mathematics and Quantum Information group
Department of Mathematics
Complutense University
Madrid, Spain

email: tsc25 <at> cantab.net
web:   www.dr-qubit.org




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12647; Package emacs. (Tue, 16 Oct 2012 07:02:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Toby Cubitt <toby-dated-1351439087.748fe4 <at> dr-qubit.org>
Cc: 12647 <at> debbugs.gnu.org, Daniel Colascione <dancol <at> dancol.org>
Subject: Re: bug#12647: 24.2.50; emacs --daemon broken in tty
Date: Tue, 16 Oct 2012 03:00:21 -0400
Toby Cubitt wrote:

> "emacsclient -c" throws an error if "emacs --daemon" is started outside
> of X windows, . This is on a recent bzr checkout (from today).
>
> Steps to reproduce:
>
> 1. switch to a linux virtual tty
>
> 2. emacs -Q --daemon
>
> 3. switch to X windows
>
> 4. emacsclient -c aborts with the following error:
>
>    Waiting for Emacs...
>    *ERROR*: Wrong type argument: stringp, nil

This is due to the various changes related to display handling in
r110444 (cygw32). The specific error is from x-initialize-window-system,
which cannot find a display (don't ask me why getenv DISPLAY doesn't
work here). In the past, frame.el set x-display-name, but it does not do
that any more. Presumably it was doing it for a reason.

The following example frame.el change makes it work again, but someone
should check this area.

--- lisp/frame.el   2012-09-17 12:07:36 +0000
+++ lisp/frame.el   2012-10-16 06:54:40 +0000
@@ -655,6 +655,7 @@
       (error "Don't know how to create a frame on window system %s" w))
 
     (unless (get w 'window-system-initialized)
+      (or x-display-name (setq x-display-name display))
       (funcall (cdr (assq w window-system-initialization-alist)))
       (put w 'window-system-initialized t))
 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12647; Package emacs. (Tue, 16 Oct 2012 13:22:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 12647 <at> debbugs.gnu.org,
	Toby Cubitt <toby-dated-1351439087.748fe4 <at> dr-qubit.org>
Subject: Re: bug#12647: 24.2.50; emacs --daemon broken in tty
Date: Tue, 16 Oct 2012 09:20:06 -0400
> This is due to the various changes related to display handling in
> r110444 (cygw32).  The specific error is from x-initialize-window-system,
> which cannot find a display (don't ask me why getenv DISPLAY doesn't
> work here).

He said he started "emacs --daemon" outside of X windows, so DISPLAY is
not set.

> In the past, frame.el set x-display-name, but it does not do
> that any more.

Where did it do it?

> The following example frame.el change makes it work again, but someone
> should check this area.

To a large extent x-display-name should disappear, replaced by explicit
parameters, since it doesn't make much sense in a multi-display context.
So this part of the code is pretty ugly.  Your patch is probably OK in
the sense that it doesn't seem to make things significantly worse.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12647; Package emacs. (Tue, 16 Oct 2012 15:49:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 12647 <at> debbugs.gnu.org,
	Toby Cubitt <toby-dated-1351439087.748fe4 <at> dr-qubit.org>
Subject: Re: bug#12647: 24.2.50; emacs --daemon broken in tty
Date: Tue, 16 Oct 2012 11:47:11 -0400
Stefan Monnier wrote:

>> In the past, frame.el set x-display-name, but it does not do
>> that any more.
>
> Where did it do it?

In make-frame-on-display, right before calling
x-initialize-window-system. (Look at emacs-24.)

>> The following example frame.el change makes it work again, but someone
>> should check this area.
>
> To a large extent x-display-name should disappear

But not during a feature freeze.

> So this part of the code is pretty ugly.  Your patch is probably OK in
> the sense that it doesn't seem to make things significantly worse.

It was only an example change showing what the problem seems to be.
I'm not saying it is the right fix.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12647; Package emacs. (Tue, 16 Oct 2012 21:37:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 12647 <at> debbugs.gnu.org,
	Toby Cubitt <toby-dated-1351439087.748fe4 <at> dr-qubit.org>
Subject: Re: bug#12647: 24.2.50; emacs --daemon broken in tty
Date: Tue, 16 Oct 2012 17:34:42 -0400
>>> In the past, frame.el set x-display-name, but it does not do
>>> that any more.
>> Where did it do it?
> In make-frame-on-display, right before calling
> x-initialize-window-system. (Look at emacs-24.)
>>> The following example frame.el change makes it work again, but someone
>>> should check this area.
>> To a large extent x-display-name should disappear
> But not during a feature freeze.

Agreed.

>> So this part of the code is pretty ugly.  Your patch is probably OK in
>> the sense that it doesn't seem to make things significantly worse.
> It was only an example change showing what the problem seems to be.
> I'm not saying it is the right fix.

We agreed above that we can't afford the right fix for the
feature freeze.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12647; Package emacs. (Tue, 16 Oct 2012 21:46:01 GMT) Full text and rfc822 format available.

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

From: Toby Cubitt <toby-dated-1351633432.99529b <at> dr-qubit.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Glenn Morris <rgm <at> gnu.org>, 12647 <at> debbugs.gnu.org
Subject: Re: bug#12647: 24.2.50; emacs --daemon broken in tty
Date: Tue, 16 Oct 2012 23:42:36 +0200
On Tue, Oct 16, 2012 at 05:34:42PM -0400, Stefan Monnier wrote:
> >>> In the past, frame.el set x-display-name, but it does not do
> >>> that any more.
> >> Where did it do it?
> > In make-frame-on-display, right before calling
> > x-initialize-window-system. (Look at emacs-24.)
> >>> The following example frame.el change makes it work again, but someone
> >>> should check this area.
> >> To a large extent x-display-name should disappear
> > But not during a feature freeze.
> 
> Agreed.
> 
> >> So this part of the code is pretty ugly.  Your patch is probably OK in
> >> the sense that it doesn't seem to make things significantly worse.
> > It was only an example change showing what the problem seems to be.
> > I'm not saying it is the right fix.
> 
> We agreed above that we can't afford the right fix for the
> feature freeze.

I assume you agree that some interim fix is necessary then?

As I mentioned, this bug breaks stuff out there in the real world, such
as the Gentoo emacs init scripts. (These can be used to start emacs
daemons for users at bootup, so they always run emacs --daemon outside of
X, indeed usually before X has even been started).

Toby
-- 
Dr T. S. Cubitt
Mathematics and Quantum Information group
Department of Mathematics
Complutense University
Madrid, Spain

email: tsc25 <at> cantab.net
web:   www.dr-qubit.org




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12647; Package emacs. (Tue, 16 Oct 2012 21:56:01 GMT) Full text and rfc822 format available.

Forcibly Merged 12647 12678. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 18 Oct 2012 23:45:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12647; Package emacs. (Thu, 18 Oct 2012 23:49:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 12647 <at> debbugs.gnu.org,
	Toby Cubitt <toby-dated-1351439087.748fe4 <at> dr-qubit.org>
Subject: Re: bug#12647: 24.2.50; emacs --daemon broken in tty
Date: Thu, 18 Oct 2012 19:46:53 -0400
Stefan Monnier wrote:

> We agreed above that we can't afford the right fix for the
> feature freeze.

I was more hoping to get an answer to "why did this code change in the
first place during a feature freeze"? Ie, was it really necessary for
cygw32 that frame handling on all platforms be changed?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12647; Package emacs. (Thu, 18 Oct 2012 23:58:02 GMT) Full text and rfc822 format available.

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

From: Ulrich Mueller <ulm <at> gentoo.org>
To: 12647 <at> debbugs.gnu.org
Subject: Re: bug#12647: 24.2.50; emacs --daemon broken in tty
Date: Fri, 19 Oct 2012 01:56:24 +0200
[Sorry for the duplicate #12678, I had noticed too late that this bug
was already open for the issue.]

>> We agreed above that we can't afford the right fix for the
>> feature freeze.

> I assume you agree that some interim fix is necessary then?

Maybe r110444 could be reverted, until things are properly sorted out?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12647; Package emacs. (Fri, 19 Oct 2012 00:26:01 GMT) Full text and rfc822 format available.

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

From: Daniel Colascione <dancol <at> dancol.org>
To: Ulrich Mueller <ulm <at> gentoo.org>
Cc: 12647 <at> debbugs.gnu.org
Subject: Re: bug#12647: 24.2.50; emacs --daemon broken in tty
Date: Thu, 18 Oct 2012 17:23:28 -0700
[Message part 1 (text/plain, inline)]
On 10/18/2012 4:56 PM, Ulrich Mueller wrote:
> [Sorry for the duplicate #12678, I had noticed too late that this bug
> was already open for the issue.]
> 
>>> We agreed above that we can't afford the right fix for the
>>> feature freeze.
> 
>> I assume you agree that some interim fix is necessary then?
> 
> Maybe r110444 could be reverted, until things are properly sorted out?

For the sake of one easy-to-fix-temporarily bug? I don't think that's the right
option.

The right fix for the feature freeze is to just set x-display-name the way we
did before. We'll be no worse off than we were in the last version.

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12647; Package emacs. (Fri, 19 Oct 2012 01:43:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Daniel Colascione <dancol <at> dancol.org>
Cc: 12647 <at> debbugs.gnu.org, Ulrich Mueller <ulm <at> gentoo.org>
Subject: Re: bug#12647: 24.2.50; emacs --daemon broken in tty
Date: Thu, 18 Oct 2012 21:40:38 -0400
> The right fix for the feature freeze is to just set x-display-name the way we
> did before. We'll be no worse off than we were in the last version.

Yes, could you do that, please?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12647; Package emacs. (Sat, 20 Oct 2012 03:48:02 GMT) Full text and rfc822 format available.

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

From: Daniel Colascione <dancol <at> dancol.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#12647: 24.2.50; emacs --daemon broken in tty
Date: Fri, 19 Oct 2012 20:45:48 -0700
[Message part 1 (text/plain, inline)]
On 10/18/2012 5:23 PM, Daniel Colascione wrote:
> On 10/18/2012 4:56 PM, Ulrich Mueller wrote:
>> [Sorry for the duplicate #12678, I had noticed too late that this bug
>> was already open for the issue.]
>>
>>>> We agreed above that we can't afford the right fix for the
>>>> feature freeze.
>>
>>> I assume you agree that some interim fix is necessary then?
>>
>> Maybe r110444 could be reverted, until things are properly sorted out?
> 
> For the sake of one easy-to-fix-temporarily bug? I don't think that's the right
> option.
> 
> The right fix for the feature freeze is to just set x-display-name the way we
> did before. We'll be no worse off than we were in the last version.
> 

I've installed a tweaked version of Glenn's patch. It appears to resolve the
problem.

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12647; Package emacs. (Sat, 20 Oct 2012 12:33:02 GMT) Full text and rfc822 format available.

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

From: Ulrich Mueller <ulm <at> gentoo.org>
To: Daniel Colascione <dancol <at> dancol.org>
Cc: 12647 <at> debbugs.gnu.org
Subject: Re: bug#12647: 24.2.50; emacs --daemon broken in tty
Date: Sat, 20 Oct 2012 14:30:56 +0200
>>>>> On Fri, 19 Oct 2012, Daniel Colascione wrote:

>> The right fix for the feature freeze is to just set x-display-name
>> the way we did before. We'll be no worse off than we were in the
>> last version.

> I've installed a tweaked version of Glenn's patch. It appears to
> resolve the problem.

Thank you. I can confirm that I don't see the problem any more in the
current version (110601) from bzr.




bug closed, send any further explanations to 12647 <at> debbugs.gnu.org and Toby Cubitt <toby-dated-1351439087.748fe4 <at> dr-qubit.org> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 20 Oct 2012 21:01:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 18 Nov 2012 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 170 days ago.

Previous Next


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