** Description changed:

- When creating a child process from a python script that uses pygtk 2.21,
- such subprocess.check_call(), 100% of the CPU  is used (technically,
- 100% of the core the python interpreter is using).
+ == Impact ==
+ 
+ pygtk apps which handle signals busy-loop in the glib main loop
+ dispatch, causing 100% CPU usage after a signal is received.  This
+ commonly occurs when spawned child processes exit.
+ 
+ == TEST CASE ==
+ 
+ A simple testcase (pygtk-signal-testcase.py) is attached.  To trigger
+ the bug, run the testcase and send the process SIGCHLD.  When run with
+ pygtk 2.22-0ubuntu1 the test process will now consume 100% CPU.
+ 
+ == Regression Potential ==
+ 
+ PyGTK is core infrastructure, so the potential impact of a regression is
+ high.  However, the patch is small and clearly correct, and the file
+ descriptor being read from is nonblocking, so it should not cause
+ application hangs even if it tries to read more bytes than are there.
+ 
+ 
+ Original bugreport follows:
+ When creating a child process from a python script that uses pygtk 2.21, such 
subprocess.check_call(), 100% of the CPU  is used (technically, 100% of the 
core the python interpreter is using).
  
  If the creation of the child processes are removed, the script runs as
  expected.
  
  According to user exarkun on the #python IRC channel, the problem may be
  manifesting when the child process exits. It may be related to a bug
  that was fixed in 9.10, but broken in 9.04. If that is the case, this is
  the relevant bug report:
  https://bugzilla.gnome.org/show_bug.cgi?id=481569
  
  The code in which I noticed this problem is in the videometadata.py
  module of Rapid Photo Downloader:
  
http://bazaar.launchpad.net/~dlynch3/rapid/trunk/annotate/head%3A/rapid/videometadata.py#L189
  
  ProblemType: Bug
  DistroRelease: Ubuntu 10.10
  Package: python-gtk2 2.21.0-0ubuntu1
  ProcVersionSignature: Ubuntu 2.6.35-22.35-generic 2.6.35.4
  Uname: Linux 2.6.35-22-generic x86_64
  Architecture: amd64
  Date: Thu Oct 21 22:51:42 2010
  InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
  ProcEnviron:
-  PATH=(custom, user)
-  LANG=en_US.utf8
-  SHELL=/bin/bash
+  PATH=(custom, user)
+  LANG=en_US.utf8
+  SHELL=/bin/bash
  SourcePackage: pygtk

** Attachment added: "Simple testcase"
   
https://bugs.launchpad.net/ubuntu/+source/pygtk/+bug/664920/+attachment/2089709/+files/pygtk-signal-testcase.py

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to pygtk in Ubuntu.
https://bugs.launchpad.net/bugs/664920

Title:
  SRU: 100% CPU usage when calling a child process from a python script

-- 
desktop-bugs mailing list
desktop-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

Reply via email to