Re: [PATCH 0/4] um: Assorted console related fixes

Glenn Washburn
2022-03-10T18:22:10Z

On Wed, 9 Mar 2022 09:35:02 +0100 (CET)
Richard Weinberger <richard@nod.at> wrote:

> ----- Ursprüngliche Mail -----
> >> This series fixes the console exit code to make sure UML
> >> undoes everything it changed on the host side.
> >
> > I gave this a run hoping it would fix the issues I'm seeing with the console
> > getting messed up when UML exits via halt in the guest. Echo is turned off
> > and looks like carriage return doesn't work either. I'm using "reset" to get
> > the terminal back to its previous state. Unfortunately this patch series did
> > not fix this issue.
> >
> > I'm not saying that these aren't valid fixes. But it does appear that these
> > changes don't make sure that "everything" changed on the host side is undone.
>
> So when you compare "stty -a" before and after the damange you still see differences?
> Please also compare the flags of /proc/$$/fdinfo/{0,1,2}

Here's a diff of the before and after:
-- /tmp/uml-console.before.out 2022-03-10 18:12:54.049171650 +0000
+++ /tmp/uml-console.after.out 2022-03-10 18:13:20.711630281 +0000
@@ -3,20 +3,20 @@
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread -clocal -crtscts
--ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
+-ignbrk -brkint ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff
-iuclc -ixany imaxbel -iutf8
-opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig icanon -iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
+-opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
+-isig -icanon -iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke -flusho -extproc
/proc/3383323/fdinfo/0:1:pos: 0
-/proc/3383323/fdinfo/0:2:flags: 0120002
+/proc/3383323/fdinfo/0:2:flags: 0124002
/proc/3383323/fdinfo/0:3:mnt_id: 6104
/proc/3383323/fdinfo/0:4:ino: 24
/proc/3383323/fdinfo/1:1:pos: 0
-/proc/3383323/fdinfo/1:2:flags: 0120002
+/proc/3383323/fdinfo/1:2:flags: 0124002
/proc/3383323/fdinfo/1:3:mnt_id: 6104
/proc/3383323/fdinfo/1:4:ino: 24
/proc/3383323/fdinfo/2:1:pos: 0
-/proc/3383323/fdinfo/2:2:flags: 0120002
+/proc/3383323/fdinfo/2:2:flags: 0124002
/proc/3383323/fdinfo/2:3:mnt_id: 6104
/proc/3383323/fdinfo/2:4:ino: 24

It looks like these were not reset: brkin icrnl ixon opost isig icanon echo

Originally I was applying this patch series to 5.16.12 and seeing this issue.
But I this output is from applying the patch series to 5.17-rc7, if that matters. Thanks for looking t this.

Glenn

>
> Thanks,
> //richard