NetBSD Problem Report #45448

From www@NetBSD.org  Sun Oct  9 23:42:22 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 6B11263D4DF
	for <gnats-bugs@gnats.NetBSD.org>; Sun,  9 Oct 2011 23:42:22 +0000 (UTC)
Message-Id: <20111009234221.4188E63B955@www.NetBSD.org>
Date: Sun,  9 Oct 2011 23:42:21 +0000 (UTC)
From: joseyluis@gmail.com
Reply-To: joseyluis@gmail.com
To: gnats-bugs@NetBSD.org
Subject: xfce4-terminal-0.4.2nb5 causes 100% usage of CPU in X server
X-Send-Pr-Version: www-1.0

>Number:         45448
>Category:       pkg
>Synopsis:       xfce4-terminal-0.4.2nb5 causes 100% usage of CPU in X server
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 09 23:45:00 +0000 2011
>Closed-Date:    Sat Jan 12 04:15:19 +0000 2013
>Last-Modified:  Sat Jan 12 04:15:19 +0000 2013
>Originator:     Jose Luis Rodriguez Garcia
>Release:        NetBSD 5.1
>Organization:
>Environment:
NetBSD pc2 5.1 NetBSD 5.1 (GENERIC) #1: Sun Jul 31 16:36:52 CEST 2011  root@:/usr/src/sys/arch/i386/compile/GENERIC i386
>Description:
When opening a xfce4-terminal, the cpu usage of X server goes up to 100%.

It seems the problem described in: https://bugzilla.xfce.org/show_bug.cgi?id=6921 Reading the description of the bug, it seems that
this problem has been trigered by an update of gtk2.

I have backported the patch described in the bugzilla of xfce website, to the version xfce4-terminal-0.4.2nb5 and it has resolved the problem
>How-To-Repeat:
Start a xfce4-terminal
>Fix:
$NetBSD$

--- terminal/terminal-screen.c.orig	2011-10-09 09:22:44.000000000 +0000
+++ terminal/terminal-screen.c
@@ -87,6 +87,7 @@ static gboolean   terminal_screen_get_ch
                                                                  GError               **error);
 static gchar    **terminal_screen_get_child_environment         (TerminalScreen        *screen);
 static void       terminal_screen_update_background             (TerminalScreen        *screen);
+static void       terminal_screen_update_background_fast        (TerminalScreen        *screen);
 static void       terminal_screen_update_binding_backspace      (TerminalScreen        *screen);
 static void       terminal_screen_update_binding_delete         (TerminalScreen        *screen);
 static void       terminal_screen_update_colors                 (TerminalScreen        *screen);
@@ -132,6 +133,8 @@ struct _TerminalScreen
   GtkWidget           *scrollbar;
   GtkWidget           *tab_label;

+  gulong               background_signal_id;
+
   GPid                 pid;
   gchar               *working_directory;

@@ -231,7 +234,6 @@ terminal_screen_init (TerminalScreen *sc
                     "signal::context-menu", G_CALLBACK (terminal_screen_vte_get_context_menu), screen,
                     "signal::selection-changed", G_CALLBACK (terminal_screen_vte_selection_changed), screen,
                     "signal::window-title-changed", G_CALLBACK (terminal_screen_vte_window_title_changed), screen,
-                    "swapped-signal::size-allocate", G_CALLBACK (terminal_screen_timer_background), screen,
                     "swapped-signal::style-set", G_CALLBACK (terminal_screen_update_colors), screen,
                     NULL);
   gtk_box_pack_start (GTK_BOX (screen), screen->terminal, TRUE, TRUE, 0);
@@ -573,6 +575,18 @@ terminal_screen_get_child_environment (T


 static void
+terminal_screen_update_background_fast (TerminalScreen *screen)
+{
+  if (G_UNLIKELY (screen->background_timer_id == 0))
+    {
+      screen->background_timer_id = g_idle_add_full (G_PRIORITY_LOW, terminal_screen_timer_background,
+                                                     screen, terminal_screen_timer_background_destroy);
+    }
+}
+
+
+
+static void
 terminal_screen_update_background (TerminalScreen *screen)
 {
   if (G_UNLIKELY (screen->background_timer_id != 0))
@@ -1015,9 +1029,25 @@ terminal_screen_timer_background (gpoint
       if (G_LIKELY (image != NULL))
         g_object_unref (G_OBJECT (image));
       g_object_unref (G_OBJECT (loader));
+      
+            /* refresh background on size changes */
+            if (screen->background_signal_id == 0)
+              {
+                screen->background_signal_id =
+                   g_signal_connect_swapped (G_OBJECT (screen->terminal), "size-allocate",
+                                             G_CALLBACK (terminal_screen_update_background_fast), screen);
+              }
     }
   else
     {
+          /* stop updating on size changes */
+          if (screen->background_signal_id != 0)
+            {
+              g_signal_handler_disconnect (G_OBJECT (screen->terminal), screen->background_signal_id);
+              screen->background_signal_id = 0;
+            }
+    
+          /* WARNING: the causes a resize too! */
       vte_terminal_set_background_image (VTE_TERMINAL (screen->terminal), NULL);
     }


>Release-Note:

>Audit-Trail:
From: Jose Luis Rodriguez Garcia <joseyluis@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/45448: xfce4-terminal-0.4.2nb5 causes 100% usage of CPU in X server
Date: Mon, 10 Oct 2011 01:58:24 +0200

 --0016e64ea22a24438304aee673fd
 Content-Type: text/plain; charset=ISO-8859-1

 It have tested it with pkgsrc-2011Q3. I suppose it will be the same with
 trunk, because it is the same version

 On Mon, Oct 10, 2011 at 1:45 AM, <gnats-admin@netbsd.org> wrote:

 > Thank you very much for your problem report.
 > It has the internal identification `pkg/45448'.
 > The individual assigned to look at your
 > report is: pkg-manager.
 >
 > >Category:       pkg
 > >Responsible:    pkg-manager
 > >Synopsis:       xfce4-terminal-0.4.2nb5 causes 100% usage of CPU in X
 > server
 > >Arrival-Date:   Sun Oct 09 23:45:00 +0000 2011
 >
 >

 --0016e64ea22a24438304aee673fd
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable

 It have tested it with pkgsrc-2011Q3. I suppose it will be the same with tr=
 unk, because it is the same version<br><br><div class=3D"gmail_quote">On Mo=
 n, Oct 10, 2011 at 1:45 AM,  <span dir=3D"ltr">&lt;<a href=3D"mailto:gnats-=
 admin@netbsd.org">gnats-admin@netbsd.org</a>&gt;</span> wrote:<br>
 <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
 x #ccc solid;padding-left:1ex;">Thank you very much for your problem report=
 .<br>
 It has the internal identification `pkg/45448&#39;.<br>
 The individual assigned to look at your<br>
 report is: pkg-manager.<br>
 <br>
 &gt;Category: =A0 =A0 =A0 pkg<br>
 &gt;Responsible: =A0 =A0pkg-manager<br>
 &gt;Synopsis: =A0 =A0 =A0 xfce4-terminal-0.4.2nb5 causes 100% usage of CPU =
 in X server<br>
 &gt;Arrival-Date: =A0 Sun Oct 09 23:45:00 +0000 2011<br>
 <br>
 </blockquote></div><br>

 --0016e64ea22a24438304aee673fd--

From: "John Marino" <marino@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45448 CVS commit: pkgsrc/x11/xfce4-terminal
Date: Tue, 8 Jan 2013 01:23:19 +0000

 Module Name:	pkgsrc
 Committed By:	marino
 Date:		Tue Jan  8 01:23:19 UTC 2013

 Modified Files:
 	pkgsrc/x11/xfce4-terminal: Makefile distinfo
 Added Files:
 	pkgsrc/x11/xfce4-terminal/patches: patch-terminal_terminal-screen.c

 Log Message:
 x11/xfce4-terminal: PR#46926 PR#45448 Fix 100% CPU usage

 Patch provided by Dave Tyson has multiple confirmations that it fixes
 the issue of 100% CPU usage simply from opening terminal window.


 To generate a diff of this commit:
 cvs rdiff -u -r1.27 -r1.28 pkgsrc/x11/xfce4-terminal/Makefile
 cvs rdiff -u -r1.6 -r1.7 pkgsrc/x11/xfce4-terminal/distinfo
 cvs rdiff -u -r0 -r1.1 \
     pkgsrc/x11/xfce4-terminal/patches/patch-terminal_terminal-screen.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Matthias Scheler" <tron@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45448 CVS commit: [pkgsrc-2012Q4] pkgsrc/x11/xfce4-terminal
Date: Wed, 9 Jan 2013 10:13:38 +0000

 Module Name:	pkgsrc
 Committed By:	tron
 Date:		Wed Jan  9 10:13:38 UTC 2013

 Modified Files:
 	pkgsrc/x11/xfce4-terminal [pkgsrc-2012Q4]: Makefile distinfo
 Added Files:
 	pkgsrc/x11/xfce4-terminal/patches [pkgsrc-2012Q4]:
 	    patch-terminal_terminal-screen.c

 Log Message:
 Pullup ticket #4005 - requested by marino
 x11/xfce4-terminal: bug fix patch

 Revisions pulled up:
 - x11/xfce4-terminal/Makefile                                   1.28
 - x11/xfce4-terminal/distinfo                                   1.7
 - x11/xfce4-terminal/patches/patch-terminal_terminal-screen.c   1.1

 ---
    Module Name:	pkgsrc
    Committed By:	marino
    Date:		Tue Jan  8 01:23:19 UTC 2013

    Modified Files:
    	pkgsrc/x11/xfce4-terminal: Makefile distinfo
    Added Files:
    	pkgsrc/x11/xfce4-terminal/patches: patch-terminal_terminal-screen.c

    Log Message:
    x11/xfce4-terminal: PR#46926 PR#45448 Fix 100% CPU usage

    Patch provided by Dave Tyson has multiple confirmations that it fixes
    the issue of 100% CPU usage simply from opening terminal window.


 To generate a diff of this commit:
 cvs rdiff -u -r1.27 -r1.27.2.1 pkgsrc/x11/xfce4-terminal/Makefile
 cvs rdiff -u -r1.6 -r1.6.26.1 pkgsrc/x11/xfce4-terminal/distinfo
 cvs rdiff -u -r0 -r1.1.2.2 \
     pkgsrc/x11/xfce4-terminal/patches/patch-terminal_terminal-screen.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 12 Jan 2013 04:15:19 +0000
State-Changed-Why:
Patch has been committed and is in 2012Q4, thanks.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.