From owner-freebsd-bugs Fri Mar 1 2: 0:11 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 6CF9537B41C for ; Fri, 1 Mar 2002 02:00:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g21A02792043; Fri, 1 Mar 2002 02:00:02 -0800 (PST) (envelope-from gnats) Received: from fafoe.dyndns.org (chello212186121237.14.vie.surfer.at [212.186.121.237]) by hub.freebsd.org (Postfix) with ESMTP id 0D54637B405 for ; Fri, 1 Mar 2002 01:51:12 -0800 (PST) Received: by stefan.fafoe (Postfix, from userid 1001) id C3F4CEA1B; Fri, 1 Mar 2002 10:50:13 +0100 (CET) Message-Id: <20020301095013.C3F4CEA1B@stefan.fafoe> Date: Fri, 1 Mar 2002 10:50:13 +0100 (CET) From: Stefan Farfeleder Reply-To: Stefan Farfeleder To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: i386/35449: [PATCH] another small fix for doscmd Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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