unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Possible bug when running with --daemon on 24.3.92.3?
@ 2014-07-08  7:30 Alexis
  2014-07-08  8:30 ` Stephen J. Turnbull
  2014-07-09  7:23 ` Peder O. Klingenberg
  0 siblings, 2 replies; 13+ messages in thread
From: Alexis @ 2014-07-08  7:30 UTC (permalink / raw)
  To: emacs-devel


Hi all,

i've just compiled and installed 24.3.92.3 on 64-bit Debian Wheezy
(7.5). i start Emacs from URxvt with the `--daemon` option, and then
open a new frame with `emacsclient -c`. That works fine. However, when i
exit the client using C-x C-c, the server process is shut down as
well. i've tried recompiling with:

    --with-x-toolkit=lucid
    --with-x-toolkit=gtk2
    --with-x-toolkit=gtk3

but that makes no difference.

Summary of steps to reproduce:

1. emacs -q --daemon
2. emacsclient -c
3. C-x C-c
4. The `emacs --daemon` process is no longer running.


Alexis.



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

* Possible bug when running with --daemon on 24.3.92.3?
  2014-07-08  7:30 Alexis
@ 2014-07-08  8:30 ` Stephen J. Turnbull
  2014-07-08  8:53   ` Andreas Schwab
                     ` (2 more replies)
  2014-07-09  7:23 ` Peder O. Klingenberg
  1 sibling, 3 replies; 13+ messages in thread
From: Stephen J. Turnbull @ 2014-07-08  8:30 UTC (permalink / raw)
  To: Alexis; +Cc: emacs-devel

Alexis writes:

 > i've just compiled and installed 24.3.92.3 on 64-bit Debian Wheezy
 > (7.5). i start Emacs from URxvt with the `--daemon` option, and
 > then open a new frame with `emacsclient -c`. That works
 > fine. However, when i exit the client using C-x C-c, the server
 > process is shut down as well.

You're not exiting the client; there is no client to exit.

In principle, the client simply sends a message to the server to open
a window for you, then exits.  (I forget what can happen in case of a
TTY client -- it may have to remain to keep a pipe open, but that's
all it does.  The principle is the same: you're editing in the server,
not in the client.)  I.e., C-x C-c is supposed to shut down the server
process.

You should be able to close the frame with C-x 5 0 or via the window
manager.




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

* Re: Possible bug when running with --daemon on 24.3.92.3?
  2014-07-08  8:30 ` Stephen J. Turnbull
@ 2014-07-08  8:53   ` Andreas Schwab
  2014-07-08  9:33   ` Alexis
  2014-07-08 14:57   ` Eli Zaretskii
  2 siblings, 0 replies; 13+ messages in thread
From: Andreas Schwab @ 2014-07-08  8:53 UTC (permalink / raw)
  To: Stephen J. Turnbull; +Cc: Alexis, emacs-devel

"Stephen J. Turnbull" <stephen@xemacs.org> writes:

> In principle, the client simply sends a message to the server to open
> a window for you, then exits.

Only if you pass --no-wait.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



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

* Re: Possible bug when running with --daemon on 24.3.92.3?
  2014-07-08  8:30 ` Stephen J. Turnbull
  2014-07-08  8:53   ` Andreas Schwab
@ 2014-07-08  9:33   ` Alexis
  2014-07-08 17:28     ` David Kastrup
  2014-07-08 14:57   ` Eli Zaretskii
  2 siblings, 1 reply; 13+ messages in thread
From: Alexis @ 2014-07-08  9:33 UTC (permalink / raw)
  To: emacs-devel


Stephen J. Turnbull writes:

> You should be able to close the frame with C-x 5 0 or via the window
> manager.

Huh. Well, in the past i've been using C-x C-c to quit the frame without
quitting the server. i gather i must have been doing something else
differently also ....

In any case, i just tried C-x 5 0: that also quit both the frame and
server.


Alexis.






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

* Re: Possible bug when running with --daemon on 24.3.92.3?
  2014-07-08  8:30 ` Stephen J. Turnbull
  2014-07-08  8:53   ` Andreas Schwab
  2014-07-08  9:33   ` Alexis
@ 2014-07-08 14:57   ` Eli Zaretskii
  2 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2014-07-08 14:57 UTC (permalink / raw)
  To: Stephen J. Turnbull; +Cc: flexibeast, emacs-devel

> From: "Stephen J. Turnbull" <stephen@xemacs.org>
> Date: Tue, 08 Jul 2014 17:30:46 +0900
> Cc: emacs-devel <emacs-devel@gnu.org>
> 
> I.e., C-x C-c is supposed to shut down the server process.

That's not true, not in Emacs.  "C-x C-c" in client frames does not
kill Emacs (a.k.a. "shut down the server"), it only closes the client
frame.



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

* Re: Possible bug when running with --daemon on 24.3.92.3?
  2014-07-08  9:33   ` Alexis
@ 2014-07-08 17:28     ` David Kastrup
  2014-07-09  1:11       ` Alexis
  0 siblings, 1 reply; 13+ messages in thread
From: David Kastrup @ 2014-07-08 17:28 UTC (permalink / raw)
  To: emacs-devel

Alexis <flexibeast@gmail.com> writes:

> Stephen J. Turnbull writes:
>
>> You should be able to close the frame with C-x 5 0 or via the window
>> manager.
>
> Huh. Well, in the past i've been using C-x C-c to quit the frame without
> quitting the server. i gather i must have been doing something else
> differently also ....
>
> In any case, i just tried C-x 5 0: that also quit both the frame and
> server.

Sure that it did not _quit_ the frame and _crash_ the server?  I seem to
remember that only some basic toolkits (like Lucid) were capable of
detaching reliably from a graphic terminal.

-- 
David Kastrup




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

* Re: Possible bug when running with --daemon on 24.3.92.3?
  2014-07-08 17:28     ` David Kastrup
@ 2014-07-09  1:11       ` Alexis
  0 siblings, 0 replies; 13+ messages in thread
From: Alexis @ 2014-07-09  1:11 UTC (permalink / raw)
  To: emacs-devel


David Kastrup writes:

> Sure that it did not _quit_ the frame and _crash_ the server?  I seem
> to remember that only some basic toolkits (like Lucid) were capable of
> detaching reliably from a graphic terminal.

Fair point. i'd only tried C-x C-c with multiple toolkits, not C-x 5
0. So i've just done some testing which uses both approaches.

Each time Emacs was run with `emacs -q --daemon`, followed by
`emacsclient -c`.

--with-x-toolkit=lucid

C-x 5 0: no server
C-x C-c: no server

--with-x-toolkit=gtk2

C-x 5 0: no server
C-x C-c: no server

--with-x-toolkit=gtk3

C-x 5 0: no server
C-x C-c: no server


Alexis.



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

* Re: Possible bug when running with --daemon on 24.3.92.3?
  2014-07-08  7:30 Alexis
  2014-07-08  8:30 ` Stephen J. Turnbull
@ 2014-07-09  7:23 ` Peder O. Klingenberg
  2014-07-10  7:41   ` Alexis
  2014-07-10 20:59   ` Michael Mattie
  1 sibling, 2 replies; 13+ messages in thread
From: Peder O. Klingenberg @ 2014-07-09  7:23 UTC (permalink / raw)
  To: emacs-devel

On Tue, Jul 08 2014 at 09:30, Alexis wrote:

> Summary of steps to reproduce:
>
> 1. emacs -q --daemon
> 2. emacsclient -c
> 3. C-x C-c
> 4. The `emacs --daemon` process is no longer running.

The symptoms seem similar to something I saw a couple of months back.
Reported as bug #17125.  That apparently had something to do with my
fonts.

Try attaching gdb to the emacs process before starting the emacsclient,
and see if you catch a signal as you exit emacsclient?

I haven't had time to pursue that bug any further.  Dmitry Antipov
provided a patch that worked for me, but apparently had some
deficiencies.

...Peder...
-- 
I wish a new life awaited _me_ in some off-world colony.





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

* Re: Possible bug when running with --daemon on 24.3.92.3?
       [not found] <mailman.76031.1404815592.1146.emacs-devel@gnu.org>
@ 2014-07-09 12:12 ` Kelvin White
  0 siblings, 0 replies; 13+ messages in thread
From: Kelvin White @ 2014-07-09 12:12 UTC (permalink / raw)
  To: Stephen J. Turnbull; +Cc: Alexis, emacs-devel


> In principle, the client simply sends a message to the server to open
> a window for you, then exits.  (I forget what can happen in case of a
> TTY client -- it may have to remain to keep a pipe open, but that's
> all it does.  The principle is the same: you're editing in the server,
> not in the client.)  I.e., C-x C-c is supposed to shut down the server
> process.

I use emacsclient -t to connect to emacs server and C-x C-c has the
same behavior as C-x 5 0. close the client in the terminal, but does
not kill the server.



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

* Re: Possible bug when running with --daemon on 24.3.92.3?
  2014-07-09  7:23 ` Peder O. Klingenberg
@ 2014-07-10  7:41   ` Alexis
  2014-07-10 11:16     ` Peder O. Klingenberg
  2014-07-10 20:59   ` Michael Mattie
  1 sibling, 1 reply; 13+ messages in thread
From: Alexis @ 2014-07-10  7:41 UTC (permalink / raw)
  To: emacs-devel


Peder O. Klingenberg writes:

> Try attaching gdb to the emacs process before starting the
> emacsclient, and see if you catch a signal as you exit emacsclient?

When i enter C-x 5 0 in emacsclient, gdb reports:

    Program received signal SIGSEGV, Segmentation fault.
    PSEUDOVECTORP (code=15, a=536871013) at lisp.h:2436
    2436          return PSEUDOVECTOR_TYPEP (h, code);


Alexis.



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

* Re: Possible bug when running with --daemon on 24.3.92.3?
  2014-07-10  7:41   ` Alexis
@ 2014-07-10 11:16     ` Peder O. Klingenberg
  0 siblings, 0 replies; 13+ messages in thread
From: Peder O. Klingenberg @ 2014-07-10 11:16 UTC (permalink / raw)
  To: emacs-devel

On Thu, Jul 10 2014 at 09:41, Alexis wrote:

> Peder O. Klingenberg writes:
>
>> Try attaching gdb to the emacs process before starting the
>> emacsclient, and see if you catch a signal as you exit emacsclient?
>
> When i enter C-x 5 0 in emacsclient, gdb reports:
>
>     Program received signal SIGSEGV, Segmentation fault.
>     PSEUDOVECTORP (code=15, a=536871013) at lisp.h:2436
>     2436          return PSEUDOVECTOR_TYPEP (h, code);

So your emacs dies with a segfault, same as mine did.  But not on the
same line (or perhaps there's been code changes in that area since
march, I haven't checked).  WRT the Subject of this thread, I'd say
definitely a bug.

The next steps would be to get a backtrace, and perhaps look at some
variables, to figure out the context in which it dies.  Take a look at
etc/DEBUG in the emacs sources for tips and hints.  And then file a bug,
and either hope for the guidance of those more knowledgeable in the ways
of the source, or dig in yourself.  Wonderful learning opportunity :)


...Peder...
-- 
This must be Thursday.  I never could get the hang of Thursdays.




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

* Re: Possible bug when running with --daemon on 24.3.92.3?
  2014-07-09  7:23 ` Peder O. Klingenberg
  2014-07-10  7:41   ` Alexis
@ 2014-07-10 20:59   ` Michael Mattie
  2014-07-11  1:22     ` Alexis
  1 sibling, 1 reply; 13+ messages in thread
From: Michael Mattie @ 2014-07-10 20:59 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1885 bytes --]

On Wednesday, July 09, 2014 09:23:10 Peder O. Klingenberg wrote:
> On Tue, Jul 08 2014 at 09:30, Alexis wrote:
> > Summary of steps to reproduce:
> > 
> > 1. emacs -q --daemon
> > 2. emacsclient -c
> > 3. C-x C-c
> > 4. The `emacs --daemon` process is no longer running.
> 
> The symptoms seem similar to something I saw a couple of months back.
> Reported as bug #17125.  That apparently had something to do with my
> fonts.
> 
> Try attaching gdb to the emacs process before starting the emacsclient,
> and see if you catch a signal as you exit emacsclient?
> 
> I haven't had time to pursue that bug any further.  Dmitry Antipov
> provided a patch that worked for me, but apparently had some
> deficiencies.
> 
> ...Peder...

I can't speak to resolve the issue proper, but I have run into many issues 
with emacs in --daemon mode dissappearing when trying to open a X frame as
seems to be occuring here.

I resolved them permanently by taking all the stuff that was X specific in the
init such as font and color and ran the .el file off a before-make-frame hook.

I set a simple binary sentinal to make sure that it only ran once.

Never had a problem since. In my thoughts if --daemon has not gathered any 
information on the X environment which makes sense then deferring execution
of configuring X stuff seems to be the only way out for now.

Here is the relevant part of my config in gitweb. Ignore my grail decorations,
the control block is quite simple and explanatory.

http://lispblivet.sx/git/?p=emacs.git;a=blob;f=emacs/grail.el;h=85e7adb6495d04a50ab6d1cd0661cd7c93e572af;hb=HEAD#l320

It might be useful in that if the workaround succeeds for the initial poster
it could narrow down the specific bits of information that emacs lacks
in --daemon mode.

How to solve it correctly is a bit beyond me, I just have a work-around to
what I think is the problem.

Mike Mattie



[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: Possible bug when running with --daemon on 24.3.92.3?
  2014-07-10 20:59   ` Michael Mattie
@ 2014-07-11  1:22     ` Alexis
  0 siblings, 0 replies; 13+ messages in thread
From: Alexis @ 2014-07-11  1:22 UTC (permalink / raw)
  To: emacs-devel


Michael Mattie writes:

> I can't speak to resolve the issue proper, but I have run into many
> issues with emacs in --daemon mode dissappearing when trying to open a
> X frame as seems to be occuring here.

Sorry, i'm not sure i follow; in my case, the new frame opens
successfully and rapidly, and i can confirm the server process is still
running whilst emacsclient is running. Has that not been the case for
you?


Alexis.



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

end of thread, other threads:[~2014-07-11  1:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.76031.1404815592.1146.emacs-devel@gnu.org>
2014-07-09 12:12 ` Possible bug when running with --daemon on 24.3.92.3? Kelvin White
2014-07-08  7:30 Alexis
2014-07-08  8:30 ` Stephen J. Turnbull
2014-07-08  8:53   ` Andreas Schwab
2014-07-08  9:33   ` Alexis
2014-07-08 17:28     ` David Kastrup
2014-07-09  1:11       ` Alexis
2014-07-08 14:57   ` Eli Zaretskii
2014-07-09  7:23 ` Peder O. Klingenberg
2014-07-10  7:41   ` Alexis
2014-07-10 11:16     ` Peder O. Klingenberg
2014-07-10 20:59   ` Michael Mattie
2014-07-11  1:22     ` Alexis

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).