ports/74981: [PATCH] x11/xorg-clients: luit has synchronization problem with tty setting
Rong-En Fan
rafan at infor.org
Sun Dec 12 12:20:24 UTC 2004
>Number: 74981
>Category: ports
>Synopsis: [PATCH] x11/xorg-clients: luit has synchronization problem with tty setting
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Dec 12 12:20:23 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator: Rong-En Fan
>Release: FreeBSD 5.3-BETA5 i386
>Organization:
NTU CSIE
>Environment:
System: FreeBSD svm.csie.ntu.edu.tw 5.3-BETA5 FreeBSD 5.3-BETA5 #13: Mon Sep 20 02:31:32 CST 2004 root at svm.csie.ntu.edu.tw:/usr/obj/usr/src/sys/SVM i386
>Description:
luit has synchronization problem with tty settings
which results in segmentation fault.
please see following 2 urls:
https://bugs.freedesktop.org/show_bug.cgi?id=1400
http://bugs.xfree86.org/show_bug.cgi?id=867
>How-To-Repeat:
>Fix:
original patch-luit.c was introduced here:
http://www.freebsd.org/cgi/cvsweb.cgi/ports/x11/XFree86-4-libraries/files/patch-luit#rev1.3
It's an workaround, the real problem is that parent
and child didn't sync well. This patch is from
Kuang-che Wu <kcwu _at_ csie.org> and has been submitted
to XFree86 / X.org.
XFree86 has committed this however X.org guys didn't
respond to this bug report.
Since they haven't fix this yet, this is not in X.org
6.8.1. I think put this in ports is ok.
diff -ruN xorg-clients/files/patch-luit.c /usr/ports/x11/xorg-clients/files/patch-luit.c
--- xorg-clients/files/patch-luit.c Sun Dec 12 19:23:55 2004
+++ /usr/ports/x11/xorg-clients/files/patch-luit.c Thu Sep 2 11:15:01 2004
@@ -1,80 +1,14 @@
---- programs/luit/luit.c Fri Mar 5 01:48:51 2004
-+++ programs/luit/luit.c Sun Jul 18 09:01:22 2004
-@@ -45,6 +45,8 @@
- #include "charset.h"
- #include "iso2022.h"
+--- programs/luit/luit.c.orig Thu Apr 8 05:14:16 2004
++++ programs/luit/luit.c Thu Apr 8 05:20:18 2004
+@@ -545,9 +545,11 @@
+ #endif
+ installHandler(SIGCHLD, sigchldHandler);
+
++/* Disabled, appears to break luit.
+ rc = copyTermios(0, pty);
+ if(rc < 0)
+ FatalError("Couldn't copy terminal settings\n");
++*/
-+static int p2c_waitpipe[2];
-+static int c2p_waitpipe[2];
- static Iso2022Ptr inputState = NULL, outputState = NULL;
-
- static char *child_argv0 = NULL;
-@@ -462,6 +464,8 @@
- exit(1);
- }
-
-+ pipe(p2c_waitpipe);
-+ pipe(c2p_waitpipe);
- pid = fork();
- if(pid < 0) {
- perror("Couldn't fork");
-@@ -470,8 +474,12 @@
-
- if(pid == 0) {
- close(pty);
-+ close(p2c_waitpipe[1]);
-+ close(c2p_waitpipe[0]);
- child(line, path, child_argv);
- } else {
-+ close(p2c_waitpipe[0]);
-+ close(c2p_waitpipe[1]);
- free(child_argv);
- free(path);
- free(line);
-@@ -486,6 +494,7 @@
- {
- int tty;
- int pgrp;
-+ char tmp[10];
-
- close(0);
- close(1);
-@@ -501,6 +510,7 @@
- kill(getppid(), SIGABRT);
- exit(1);
- }
-+ write(c2p_waitpipe[1],"1",1);
-
- if(tty != 0)
- dup2(tty, 0);
-@@ -512,6 +522,9 @@
- if(tty > 2)
- close(tty);
-
-+ read(p2c_waitpipe[0],tmp,1);
-+ close(c2p_waitpipe[1]);
-+ close(p2c_waitpipe[0]);
- execvp(path, argv);
- perror("Couldn't exec");
- exit(1);
-@@ -535,7 +548,9 @@
- int i;
- int val;
- int rc;
-+ char tmp[10];
-
-+ read(c2p_waitpipe[0],tmp,1);
- if(verbose) {
- reportIso2022(outputState);
- }
-@@ -564,6 +579,9 @@
-
- setWindowSize(0, pty);
-
-+ write(p2c_waitpipe[1],"1",1);
-+ close(c2p_waitpipe[0]);
-+ close(p2c_waitpipe[1]);
- for(;;) {
- rc = waitForInput(0, pty);
-
-
+ rc = setRawTermios();
+ if(rc < 0)
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list