From owner-freebsd-bugs@FreeBSD.ORG Thu Aug 12 19:30:09 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B67171065694 for ; Thu, 12 Aug 2010 19:30:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7914D8FC1A for ; Thu, 12 Aug 2010 19:30:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o7CJU9uf039819 for ; Thu, 12 Aug 2010 19:30:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o7CJU9Td039809; Thu, 12 Aug 2010 19:30:09 GMT (envelope-from gnats) Resent-Date: Thu, 12 Aug 2010 19:30:09 GMT Resent-Message-Id: <201008121930.o7CJU9Td039809@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, John Giacomoni Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 406BD106564A for ; Thu, 12 Aug 2010 19:28:45 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 3001A8FC14 for ; Thu, 12 Aug 2010 19:28:45 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o7CJSj53043213 for ; Thu, 12 Aug 2010 19:28:45 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o7CJSiOE043212; Thu, 12 Aug 2010 19:28:44 GMT (envelope-from nobody) Message-Id: <201008121928.o7CJSiOE043212@www.freebsd.org> Date: Thu, 12 Aug 2010 19:28:44 GMT From: John Giacomoni To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/149591: struct callout:c_flags should be volatile X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Aug 2010 19:30:09 -0000 >Number: 149591 >Category: kern >Synopsis: struct callout:c_flags should be volatile >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 12 19:30:09 UTC 2010 >Closed-Date: >Last-Modified: >Originator: John Giacomoni >Release: 7.3/8.1 >Organization: LineRate Systems >Environment: >Description: The following code sequence can result in an infinite loop (even if the callout invokes callout_deactivate() while(callout_active()) DELAY(); The problem is that callout_active checks c_flags to check if a callout timer is active. However, unless c_flags are volatile, the compiler can cache the value of c_flags in a register and thus fail to notice a change in state when repeatedly called from within a single scope. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: