Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HUU92-0004lR-Ud for qemu-devel@nongnu.org; Thu, 22 Mar 2007 16:44:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HUU91-0004lE-JG for qemu-devel@nongnu.org; Thu, 22 Mar 2007 16:44:23 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HUU91-0004lB-CI for qemu-devel@nongnu.org; Thu, 22 Mar 2007 15:44:23 -0500 Received: from moutng.kundenserver.de ([212.227.126.187]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HUU7B-0007aJ-AU for qemu-devel@nongnu.org; Thu, 22 Mar 2007 16:42:29 -0400 Received: from localhost ([127.0.0.1]) by localhost.localdomain with esmtp (Exim 4.63) (envelope-from ) id 1HUU78-0001Ov-2j for qemu-devel@nongnu.org; Thu, 22 Mar 2007 21:42:26 +0100 Message-ID: <4602EA31.1010009@weilnetz.de> Date: Thu, 22 Mar 2007 21:42:25 +0100 From: Stefan Weil MIME-Version: 1.0 Subject: [Qemu-devel] [Bug] Timer bugs in hw/m48t59.c? Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers Hi, could SPARC or PPC users please check whether the timer code in hw/m48t59.c is really correct? I expect a crash in qemu_mod_timer after wd_timer = NULL and a call to qemu_mod_timer with this NULL value. The same applies to alrm_timer. I wrote a quick-and-dirty patch, but think that even more old code could be removed. Stefan diff -u -b -B -r1.8 m48t59.c --- hw/m48t59.c 14 Jun 2006 12:41:34 -0000 1.8 +++ hw/m48t59.c 22 Mar 2007 20:29:15 -0000 @@ -155,7 +155,6 @@ NVRAM->alarm = mktime(tm); if (NVRAM->alrm_timer != NULL) { qemu_del_timer(NVRAM->alrm_timer); - NVRAM->alrm_timer = NULL; } if (NVRAM->alarm - time(NULL) > 0) qemu_mod_timer(NVRAM->alrm_timer, NVRAM->alarm * 1000); @@ -184,7 +183,6 @@ if (NVRAM->wd_timer != NULL) { qemu_del_timer(NVRAM->wd_timer); - NVRAM->wd_timer = NULL; } NVRAM->buffer[0x1FF0] &= ~0x80; if (value != 0) {