From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay1.UU.NET ([192.48.96.5]) by hawkwind.utcs.utoronto.ca with SMTP id <24125>; Thu, 1 Dec 1994 19:09:51 -0500 Received: from uucp5.UU.NET by relay1.UU.NET with SMTP id QQxsls17709; Thu, 1 Dec 1994 19:09:34 -0500 Date: Thu, 1 Dec 1994 19:09:33 -0500 From: plexus-sys!mdash@uunet.uu.net Message-Id: Received: from plexus-sys.UUCP by uucp5.UU.NET with UUCP/RMAIL ; Thu, 1 Dec 1994 19:09:51 -0500 To: sam-fans@hawkwind.utcs.toronto.edu Subject: 9term bug Content-Type: text Has anybody else seen this race in 9term? Here's an excerpt from sendrunes: if (p > s) while (write(comm_fd, s, p-s) < 0 && errno == EAGAIN) ; /* reinstate echo mode, if we disabled it above */ if (echo) { ttmode.c_lflag |= ECHO; IOSETATTR(slave_fd, &ttmode); } The IOSETATTR can race with the line discipline's processing of characters written on comm_fd. When the IOSETATTR beats the input processing, some suffix of the input is echoed an extra time. I've seen this only on some multiprocessors, but it seems theoretically possible in other settings. My workaround is nondeterministic, but it works on the hosts where I've tried it. if (echo) { tcdrain(comm_fd); ttmode.c_lflag |= ECHO; IOSETATTR(slave_fd, &ttmode); } Anybody got a better way to handle this? --Mike Scheer, 908-273-1885, mdash@plexus-sys.com