Discussion:
emacsclient crashing after patch-589
Dan Nicolaescu
2006-12-08 08:02:32 UTC
Permalink
Hi,

After the latest round of patches "emacsclient -t" crashes after a
suspend(C-z) followed by a resume (fg %emacsclient)

Is anybody else seing this? I have not had a chance yet to try to
debug this.

--dan
Han Boetes
2006-12-08 18:02:21 UTC
Permalink
Post by Dan Nicolaescu
After the latest round of patches "emacsclient -t" crashes after a
suspend(C-z) followed by a resume (fg %emacsclient)
Is anybody else seing this? I have not had a chance yet to try to
debug this.
This is very repeatable indeed.


# Han
--
_ I have had my television aerials removed. It's the moral
_V.-o equivalent of a prostate operation. -- Malcolm Muggeridge
/ |`-'
(7_\\
Dan Nicolaescu
2006-12-13 10:26:30 UTC
Permalink
Post by Dan Nicolaescu
Hi,
After the latest round of patches "emacsclient -t" crashes after a
suspend(C-z) followed by a resume (fg %emacsclient)
There are 2 problems in emacsclient. One is that the "in" and "out"
FILE* are not initialized anymore. The other is a typo in handling
commands.

Please apply this patch:

--- emacsclient.c~ 2006-12-13 02:17:07.356752000 -0800
+++ emacsclient.c 2006-12-13 01:57:57.866389000 -0800
@@ -1173,6 +1173,26 @@
if ((s = set_socket ()) == INVALID_SOCKET)
fail ();

+ /* We use the stream OUT to send our commands to the server. */
+ if ((out = fdopen (s, "r+")) == NULL)
+ {
+ fprintf (stderr, "%s: ", argv[0]);
+ perror ("fdopen");
+ fail ();
+ }
+
+ /* We use the stream IN to read the responses.
+ We used to use just one stream for both output and input
+ on the socket, but reversing direction works nonportably:
+ on some systems, the output appears as the first input;
+ on other systems it does not. */
+ if ((in = fdopen (s, "r+")) == NULL)
+ {
+ fprintf (stderr, "%s: ", argv[0]);
+ perror ("fdopen");
+ fail ();
+ }
+

cwd = get_current_dir_name ();
if (cwd == 0)
@@ -1400,7 +1420,7 @@
fprintf (stderr, "*ERROR*: %s", str);
needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
}
- else if (strprefix ("-suspend ", str))
+ else if (strprefix ("-suspend ", string))
{
/* -suspend: Suspend this terminal, i.e., stop the process. */
if (needlf)

Loading...