Skip site navigation (1)Skip section navigation (2)
Date:      Fri,  1 Mar 2002 10:50:13 +0100 (CET)
From:      Stefan Farfeleder <e0026813@stud3.tuwien.ac.at>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   i386/35449: [PATCH] another small fix for doscmd
Message-ID:  <20020301095013.C3F4CEA1B@stefan.fafoe>

next in thread | raw e-mail | index | archive | help

>Number:         35449
>Category:       i386
>Synopsis:       [PATCH] another small fix for doscmd
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 01 02:00:02 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Stefan Farfeleder
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
>Environment:
System: FreeBSD stefan.fafoe 4.5-STABLE FreeBSD 4.5-STABLE #8: Tue Feb 26 21:34:20 CET 2002 root@stefan.fafoe:/usr/obj/usr/src/sys/MORDOR i386


	
>Description:
HandleIO() wants to pass a pointer to a regcontext_t (which is a union of a
mcontext_t and a registers_t) to a handler but fails to do so because it casts
the address of the whole ucontext_t instead of its member uc_mcontext (there is
a sigset_t uc_sigmask in at the beginning of a ucontext_t).

>How-To-Repeat:
It is rather hard to see any failure at all since the most handlers
(video_async_event, _kbd_event and com_async) do not use the parameter REGS. I
found the bug when I was adding some code for a mouse callback routine to
video_event and the eax register changed in the sigframe though I changed R_CS.
>Fix:

Index: AsyncIO.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/doscmd/AsyncIO.c,v
retrieving revision 1.7
diff -u -r1.7 AsyncIO.c
--- AsyncIO.c	2 Oct 2001 11:28:59 -0000	1.7
+++ AsyncIO.c	1 Mar 2002 09:00:01 -0000
@@ -246,7 +246,7 @@
 		 */
 		if (as->func) {
 			(*handlers[fd].func)(fd, cond, handlers[fd].arg, 
-			    (regcontext_t*)&sf->sf_uc);
+			    (regcontext_t*)&sf->sf_uc.uc_mcontext);
 		} else {
 			/*
 			 * Otherwise deregister this guy.
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020301095013.C3F4CEA1B>