From patchwork Thu Jun 30 08:31:10 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wolfgang Rohdewald X-Patchwork-Id: 11927 Received: from natsmtp00.rzone.de ([81.169.145.165]) by www.linuxtv.org with esmtp (Exim 4.34) id 1DnuSE-0002Ql-Nc for vdr@linuxtv.org; Thu, 30 Jun 2005 10:31:26 +0200 Received: from wr.rohdewald.de (p548F8FAC.dip0.t-ipconnect.de [84.143.143.172]) (authenticated bits=0) by post.webmailer.de (8.13.1/8.13.1) with ESMTP id j5U8VJCr017091 for ; Thu, 30 Jun 2005 10:31:20 +0200 (MEST) Received: by wr.rohdewald.de (Postfix, from userid 107) id 4454D270022; Thu, 30 Jun 2005 10:31:19 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by wr.rohdewald.de (Postfix) with ESMTP id 95ACA27001E for ; Thu, 30 Jun 2005 10:31:11 +0200 (CEST) From: Wolfgang Rohdewald To: vdr@linuxtv.org Date: Thu, 30 Jun 2005 10:31:10 +0200 User-Agent: KMail/1.7.2 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200506301031.10756.wolfgang@rohdewald.de> X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on wr.rohdewald.de X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=ALL_TRUSTED,AWL autolearn=ham version=3.0.4 Subject: [vdr] [PATCH] fix segfault in cSkins::Message X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: wolfgang@rohdewald.de, Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2005 08:31:26 -0000 Status: O X-Status: X-Keywords: X-UID: 3310 this happens if the MENUTIMEOUT makes the OSD menu disappear while a message is displayed. Or if the driver/firmware is faulty and generates a timeout. That is how I found it, but I can also reproduce it without the driver timing out. maybe the access to cSkinDisplay::Current is not thread safe? What happens if it is deleted while executing SetMessage? vdr@mm:~/src$ diff -up skins.prev skins.c Breakpoint 1, ~cSkinDisplay (this=0x9ef49c8) at skins.c:28 28 isyslog("~cSkinDisplay"); (gdb) bt #0 ~cSkinDisplay (this=0x9ef49c8) at skins.c:28 #1 0x080ffceb in ~cSkinDisplayMenu (this=0x9ef49c8) at skinsttng.c:349 #2 0x080fb254 in ~cSkinClassicDisplayMenu (this=0x9ef49c8) at skinclassic.c:203 #3 0x080ddd2a in ~cOsdMenu (this=0x9ef75e8) at osdbase.c:97 #4 0x080d6d4c in ~cMenuMain (this=0x9ef75e8) at menu.c:124 #5 0x081235b5 in main (argc=14, argv=0xbfb8f9f4) at vdr.c:800 (gdb) c Continuing. cannot read /Musik//Deutsch/Reinhard_Mey/immer_weiter/12.Selig_sind_die_Verrückten.flac: No such file or directory Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 147463 (LWP 23498)] 0x080fec04 in cSkinClassicDisplayMessage::SetMessage (this=0x9ef4608, Type=mtInfo, Text=0xbe9ff734 "cannot read /Musik//Deutsch/Reinhard_Mey/immer_weiter/12.Selig_sind_die_Verrückten.flac: No such file or directory") at skinclassic.c:639 639 osd->DrawText(0, 0, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, Setup.OSDWidth, 0, taCenter); --- skins.prev 2005-06-30 10:17:20.000000000 +0200 +++ skins.c 2005-06-30 10:17:10.000000000 +0200 @@ -191,7 +191,8 @@ eKeys cSkins::Message(eMessageType Type, cStatus::MsgOsdClear(); } else { - cSkinDisplay::Current()->SetMessage(Type, NULL); + if (cSkinDisplay::Current()) + cSkinDisplay::Current()->SetMessage(Type, NULL); cStatus::MsgOsdStatusMessage(NULL); } }