[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug report. MiNT 1.07.



Stephen Usher writes:

> Just a quick bug report, I've not time for anything more.
> 
> Machine:- TT030, 8MB RAM (4+4), standard TT Hard drive + ICD adaptor and
> 85MB seagate drive on ACSI bus.
> 
> (1) When opening serial ports modem2, serial1 and serial2, modem1 is opened.

 hmm haven't seen that one...  actually my uucico (taylor 1.03) just
received this mail over modem2, without any problems.  this is MiNT 1.09...
> 
> I noticed this the other day when I tried to use my own port of Kermit
> 5A(188).

 btw is it available for ftp/whatever? :)

> (2) When MiNT is rebooted after successfully exiting, system soft-crashes.

 if you mean exit MiNT -> desktop -> run MiNT again (i.e. without reset)
i think i just found the reason:  close on /dev/fasttext didn't fix
the cursor address to point into the original screen memory again...
and while i was at it i also made open work more than once and fixed a
`strangely' flashing cursor when it was on before the open.  (btw the
scr_usecnt is necessary because /dev/console and fasttext use the same
tty struct...)

 and after that i have a few patches for init, login, passwd etc :-)

Index: dosmem.c
--- dosmem.c_	Tue Aug 17 18:36:24 1993
+++ dosmem.c	Mon Aug 23 16:45:16 1993
@@ -1294,7 +1294,10 @@
 	sigmask = curproc->sigmask;
 	curproc->sigmask = ~((unsigned long)1 << SIGKILL);
 
+	{ short sr = spl7();
 	add_q(READY_Q, p);		/* put it on the ready queue */
+	spl(sr);
+	}
 	sleep(WAIT_Q, (long)p);			/* while we wait for it */
 	TRACE(("do_vfork: parent waking up"));
 
 (not sure if this was necessary, just in case...)

Index: fasttext.c
--- fasttext.c_	Tue Aug 17 11:11:16 1993
+++ fasttext.c	Wed Aug 25 17:06:24 1993
@@ -20,6 +20,7 @@
 #define CONDEV	(2)
 
 static SCREEN *current;
+static short scr_usecnt;
 
 static void paint P_((SCREEN *, int, char *)),
 	 paint8c P_((SCREEN *, int, char *)),
@@ -171,11 +172,13 @@
 		if (hardbase == 0) {
 			ALERT("Insufficient memory for hardware scrolling!");
 		} else {
+			v->curstimer = 0x7f;
 			quickmove(hardbase, base, scrnsize);
 			v->cursaddr = v->cursaddr + (hardbase - base);
 			oldbase = base;
 			base = hardbase;
 			Setscreen(hardbase, hardbase, -1);
+			v->curstimer = v->period;
 		}
 	}
 	hardline = 0;
@@ -214,7 +217,9 @@
 		v->flags &= ~CURS_FSTATE;
 
 	/* now turn the cursor on the way we like it */
+		v->curstimer = v->period;
 		v->hidecnt = 0;
+		v->flags |= CURS_ON;
 		curs_on(v);
 	} else {
 		(void)Cursconf(0,0);
@@ -1201,8 +1206,13 @@
 
 	if (!current) {
 		init();
-	} else
+	}
+#if 1
+	++scr_usecnt;
+#else
+	else
 		return EACCDN;		/* screen in use */
+#endif
 
 	f->flags |= O_TTY;
 	return 0;
@@ -1213,13 +1223,21 @@
 	FILEPTR *f;
 	int pid;
 {
+	SCREEN *v = current;
 	UNUSED(pid);
 
-	if (f->links <= 0) {
+#if 1
+	if (v && f->links <= 0 && !--scr_usecnt) {
+#else
+	if (v && f->links <= 0) {
+#endif
 		if (hardbase) {
+			v->curstimer = 0x7f;
+			v->cursaddr = v->cursaddr + (oldbase - base);
 			quickmove(oldbase, base, scrnsize);
 			base = oldbase;
 			Setscreen(oldbase, oldbase, -1);
+			v->curstimer = v->period;
 		}
 		current = 0;
 	}

-------end mint patches----

 this makes the tty always get the right pgrp:

Index: init/init.c
--- /i/tmp/init/init.c	Mon Aug  2 23:58:08 1993
+++ /f/msrc/ini11/init/init.c	Tue Aug 24 13:14:56 1993
@@ -44,6 +44,7 @@
 #include <sys/resource.h>
 
 #ifdef MINT
+#include <ioctl.h>
 #include <sys/dir.h>
 #include <mintbind.h>
 
@@ -493,12 +494,17 @@
 
 	if ((pid = vfork()) == 0)
 	{
-		setpgrp(getpid(), getpid());
+		long pgrp = setpgrp(getpid(), getpid());
 
 		tty = open(ttyname, O_RDWR);
 
 #ifdef MINT
+		if (tty == -1 || pgrp < 0) {
+			perror(ttyname);
+			_exit(0);
+		}
 		dup2(tty, -1);		/* set controlling terminal */
+		ioctl (-1, TIOCSPGRP, &pgrp);
 #endif
 		dup2(tty, 0);
 		dup2(tty, 1);

 i think the next ones are also the reason why login crashed for some
people...

Index: login/login.c
--- /i/tmp/login/login.c	Wed Aug  4 01:46:44 1993
+++ /f/msrc/ini11/login/login.c	Tue Aug 24 11:34:44 1993
@@ -384,7 +384,7 @@
 
 	if (i < argc)
 	{
-		if ((j = strlen(argv[i])) > 8)
+		if ((j = strlen(argv[i])+1) > 8)
 			j = 8;
 		strncpy(name, argv[i], j);
 		name[8] = '\0';
Index: login/passwd.c
--- /i/tmp/login/passwd.c	Mon Aug  2 23:58:08 1993
+++ /f/msrc/ini11/login/passwd.c	Tue Aug 24 11:28:32 1993
@@ -202,7 +202,7 @@
 
 	if (i < argc)
 	{
-		if ((j = strlen(argv[i])) > 8)
+		if ((j = strlen(argv[i])+1) > 8)
 			j = 8;
 		strncpy(name, argv[i], j);
 		name[8] = '\0';
Index: login/su.c
--- /i/tmp/login/su.c	Wed Aug  4 01:46:18 1993
+++ /f/msrc/ini11/login/su.c	Tue Aug 24 11:34:52 1993
@@ -298,7 +298,7 @@
 
 	if (i < argc)
 	{
-		if ((j = strlen(argv[i])) > 8)
+		if ((j = strlen(argv[i])+1) > 8)
 			j = 8;
 		strncpy(name, argv[i], j);
 		name[8] = '\0';

 and getty restores tty on some more signals:

Index: getty/getty.c
--- getty/getty.c_	Mon Aug  2 23:58:08 1993
+++ getty/getty.c	Thu Aug 26 22:10:02 1993
@@ -561,8 +561,12 @@
 	char *s = "Connection timed out.\r\n";
 
 	ioctl(0, TIOCSETP, &save_sgttyb);
-	write(0, s, strlen(s));
-	exit(1);
+	if (sig == SIGALRM) {
+		write(0, s, strlen(s));
+		exit(1);
+	}
+	signal (sig, SIG_DFL);
+	kill (getpid(), sig);
 }
 
 int
@@ -582,6 +586,10 @@
 
 	ioctl(0, TIOCGETP, &save_sgttyb);
 	signal(SIGALRM, do_alarm);
+	signal(SIGHUP, do_alarm);
+	signal(SIGINT, do_alarm);
+	signal(SIGQUIT, do_alarm);
+	signal(SIGTERM, do_alarm);
 
 #ifdef DEBUG
 	if ((dbgfp = fopen(DEBUGFILE, "w+")) == NULL)

 hope this helps some...  cheers,
	Juergen
-- 
J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
								...ohne Gewehr
PGP public key fingerprint =  8A 18 58 54 03 7B FC 12  1F 8B 63 C7 19 27 CF DA