Date: Fri, 5 Jul 2002 19:44:36 -0700 (PDT) From: David Xu <bsddiy@yahoo.com> To: Peter Wemm <peter@wemm.org> Cc: Julian Elischer <julian@elischer.org>, current@FreeBSD.ORG Subject: Re: status of KSE merge Message-ID: <20020706024436.40687.qmail@web20907.mail.yahoo.com>
next in thread | raw e-mail | index | archive | help
the following patch can fix the bug, but for KSE programs, it may not be a
best solution, KSE programs signal handling is on going...
--- kern_synch.c	Wed Jul  3 17:15:20 2002
+++ kern_synch.c.new	Sat Jul  6 10:36:22 2002
@@ -537,8 +537,7 @@
 		PROC_LOCK(p);
 		sig = cursig(td);
 		if (thread_suspend_check(1)) {
-			sig = EINTR;
-			rval = EINTR;
+			sig = SIGSTOP; 
 		}
 		mtx_lock_spin(&sched_lock);
 		PROC_UNLOCK(p);
-David Xu
----- Original Message ----- 
From: "Peter Wemm" <peter@wemm.org>
To: "Julian Elischer" <julian@elischer.org>
Cc: "FreeBSD current users" <current@FreeBSD.ORG>
Sent: Saturday, July 06, 2002 3:52 AM
Subject: Re: status of KSE merge 
> Julian Elischer wrote:
> 
> > At this time I have no information on any apps that fail to work (that did
> > work before KSE).
> > 
> > The signal flakiness is still present but at least people can get work
> > done. I will work on this next (though signal experts are welcome to
> > try their hand as well.. (in fact any beginners who want to jump inat the 
> > deep end of the pool can guarantee a near-drowning-experience by trying
> > to understand signals).
> 
> Some news:  syscall restart after signals is broken.  This is responsible
> for a lot of the ^Z/fg problems as well as some applications failing when
> their timer signals cause IO problems.
> 
> Test case:
> peter@overcee[12:49pm]~-125> cat restart.sh
> #! /tmp/44sh
> echo -n "Type something: "
> read foo
> echo "You typed: \"$foo\""
> peter@overcee[12:49pm]~-126> ./restart.sh 
> Type something: foo
> You typed: "foo"
> peter@overcee[12:49pm]~-127> ktrace ./restart.sh 
> Type something: ^Z
> [1]  + Suspended                     ktrace ./restart.sh
> peter@overcee[12:49pm]~-128> fg
> ktrace ./restart.sh
> You typed: ""
> peter@overcee[12:49pm]~-129> kdump -R
> [...]
>   1091 44sh     0.000061 CALL  write(0x1,0x80c4000,0x10)
>   1091 44sh     0.000029 GIO   fd 1 wrote 16 bytes
>        "Type something: "
>   1091 44sh     0.000198 RET   write 16/0x10
>   1091 44sh     0.000187 CALL  read(0,0xbfbff2f3,0x1)
>   1091 44sh     3.054434 RET   read -1 errno 4 Interrupted system call
>   1091 44sh     0.000695 CALL  write(0x1,0x80c4000,0xe)
>   1091 44sh     0.000025 GIO   fd 1 wrote 14 bytes
>        "You typed: ""
>        "
>   1091 44sh     0.000254 RET   write 14/0xe
> [..]
> 
> The errno 4 - interrupted system call should not happen.  read returns
> ERESTART internally on the signal catch, and the syscall() function in trap.c
> is supposed to back up the eip which causes the syscall to be rerun.
> 
> I have not looked at the code yet.  This is responsible for things like
> vipw failing after ^Z/fg (editor=vi), mergemaster failing on ^Z/fg etc.
> (it was mergemaster that tipped me off on this.)
> 
> Applications that use interval timers would be suffering from this pretty
> badly.
> 
> Cheers,
> -Peter
> --
> Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
> "All of this is for nothing if we don't go to the stars" - JMS/B5
__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020706024436.40687.qmail>
