I have made the following changes intended for :
  CE:MW:Shared / meegotouch-applauncherd

Please review and accept or decline.
BOSS has already run some checks on this request.
See the "Messages from BOSS" section below.

https://build.pub.meego.com//request/show/6756

Thank You,
John Brooks

[This message was auto-generated]

---

Request # 6756:

Messages from BOSS:

State: review at 2012-09-19T16:57:16 by bossbot

Reviews:
       accepted by bossbot : Prechecks succeeded.
       new for CE-maintainers : Please replace this text with a review and 
approve/reject the review (not the SR). BOSS will take care of the rest

Changes:
  submit: home:special:branches:CE:MW:Shared / meegotouch-applauncherd -> 
CE:MW:Shared / meegotouch-applauncherd
  
changes files:
--------------
--- meegotouch-applauncherd.changes
+++ meegotouch-applauncherd.changes
@@ -0,0 +1,3 @@
+* Wed Sep 19 2012 John Brooks <[email protected]> - 3.0.3
+- Added 0001-Fix-invoker-infinite-loop-after-receiving-signals.patch
+

new:
----
  0001-Fix-invoker-infinite-loop-after-receiving-signals.patch

spec files:
-----------
--- meegotouch-applauncherd.spec
+++ meegotouch-applauncherd.spec
@@ -1,11 +1,13 @@
 # 
 # Do NOT Edit the Auto-generated Part!
-# Generated by: spectacle version 0.23
+# Generated by: spectacle version 0.25
 # 
+
+Name:       meegotouch-applauncherd
+
 # >> macros
 # << macros
 
-Name:       meegotouch-applauncherd
 Summary:    Application launcher for fast startup
 Version:    3.0.3
 Release:    1
@@ -19,6 +21,7 @@
 Patch2:     meegotouch-applauncherd-2.0.14-add-missing-libs-for-linking.patch
 Patch3:     0001-Use-MeeGo-stuff-even-with-Mer.patch
 Patch4:     0001-Do-not-hardcode-python-version-to-cmd-s.patch
+Patch5:     0001-Fix-invoker-infinite-loop-after-receiving-signals.patch
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 BuildRequires:  pkgconfig(QtCore)
@@ -32,14 +35,12 @@
 BuildRequires:  python
 BuildRequires:  desktop-file-utils
 
-
 %description
 Application invoker and launcher daemon that speed up
 application startup time and share memory. Provides also
 functionality to launch applications as single instances.
 
 
-
 %package devel
 Summary:    Development files for launchable applications
 Group:      Development/Tools
@@ -92,6 +93,8 @@
 %patch3 -p1
 # 0001-Do-not-hardcode-python-version-to-cmd-s.patch
 %patch4 -p1
+# 0001-Fix-invoker-infinite-loop-after-receiving-signals.patch
+%patch5 -p1
 # >> setup
 # << setup
 
@@ -107,6 +110,7 @@
 
 # >> build post
 # << build post
+
 %install
 rm -rf %{buildroot}
 # >> install pre
@@ -119,29 +123,15 @@
 mv %{buildroot}/usr/share/applauncherd-tests %{buildroot}/usr/lib
 (cd %{buildroot}/usr/share; ln -s ../lib/applauncherd-tests)
 # << install post
+
 desktop-file-install --delete-original       \
   --dir %{buildroot}%{_datadir}/applications             \
    %{buildroot}%{_datadir}/applications/*.desktop
 
-
-
 %post -p /sbin/ldconfig
 
 %postun -p /sbin/ldconfig
 
-
-
-
-
-
-
-
-
-
-
-
-
-
 %files
 %defattr(-,root,root,-)
 %{_bindir}/invoker
@@ -160,7 +150,6 @@
 # >> files
 # << files
 
-
 %files devel
 %defattr(-,root,root,-)
 %{_libdir}/pkgconfig/meegotouch-boostable.pc
@@ -289,4 +278,3 @@
 %{_datadir}/dbus-1/services/com.nokia.fala_wol.service
 # >> files tests
 # << files tests
-

other changes:
--------------

++++++ 0001-Fix-invoker-infinite-loop-after-receiving-signals.patch (new)
--- 0001-Fix-invoker-infinite-loop-after-receiving-signals.patch
+++ 0001-Fix-invoker-infinite-loop-after-receiving-signals.patch
@@ -0,0 +1,49 @@
+From 0c47b7c3af63dfec0f1249accaa7852856f86afc Mon Sep 17 00:00:00 2001
+From: John Brooks <[email protected]>
+Date: Wed, 19 Sep 2012 09:52:33 -0600
+Subject: [PATCH] Fix invoker infinite loop after receiving signals
+
+After receiving a signal, a pipe is written, which is polled by select.
+As of ac1ed61, that pipe is never read, causing the select() to
+repeatedly trigger and use 100% CPU after receiving any signal that
+doesn't cause the process to terminate.
+
+Partial revert of ac1ed61, plus a one-line fix for the select() fd set
+---
+ src/invoker/invoker.c |   13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/src/invoker/invoker.c b/src/invoker/invoker.c
+index 0b7fe33..d8561da 100644
+--- a/src/invoker/invoker.c
++++ b/src/invoker/invoker.c
+@@ -532,7 +532,7 @@ static int wait_for_launched_process_to_exit(int 
socket_fd, bool wait_term)
+             // sig_forwarder() handles signals.
+             // We only have to receive those here.
+             FD_SET(g_signal_pipe[0], &readfds);
+-            ndfs = (socket_fd > ndfs) ? socket_fd : ndfs;
++            ndfs = (g_signal_pipe[0] > ndfs) ? g_signal_pipe[0] : ndfs;
+ 
+             // Wait for something appearing in the pipes.
+             if (select(ndfs + 1, &readfds, NULL, NULL, NULL) > 0)
+@@ -574,6 +574,17 @@ static int wait_for_launched_process_to_exit(int 
socket_fd, bool wait_term)
+                     }
+                     break;
+                 }
++                // Check if we got a UNIX signal.
++                else if (FD_ISSET(g_signal_pipe[0], &readfds))
++                {
++                    // Clean up the pipe
++                    char signal_id;
++                    read(g_signal_pipe[0], &signal_id, sizeof(signal_id));
++
++                    // Set signals forwarding to the invoked process again
++                    // (they were reset by the signal forwarder).
++                    sigs_init();
++                }
+             }
+         }
+ 
+-- 
+1.7.9.5
+

++++++ meegotouch-applauncherd.yaml
--- meegotouch-applauncherd.yaml
+++ meegotouch-applauncherd.yaml
@@ -13,6 +13,7 @@
     - meegotouch-applauncherd-2.0.14-add-missing-libs-for-linking.patch
     - 0001-Use-MeeGo-stuff-even-with-Mer.patch
     - 0001-Do-not-hardcode-python-version-to-cmd-s.patch
+    - 0001-Fix-invoker-infinite-loop-after-receiving-signals.patch
 Description: |
     Application invoker and launcher daemon that speed up
     application startup time and share memory. Provides also



Reply via email to