diff --git a/0001-pyhook-add-timetout-to-sockets-rhbz-808562.patch b/0001-pyhook-add-timetout-to-sockets-rhbz-808562.patch new file mode 100644 index 0000000..35184ed --- /dev/null +++ b/0001-pyhook-add-timetout-to-sockets-rhbz-808562.patch @@ -0,0 +1,70 @@ +From f7d7f594dcd5439bc05187361d55be720f07959e Mon Sep 17 00:00:00 2001 +Message-Id: +From: Jiri Moskovcak +Date: Wed, 11 Apr 2012 15:31:34 +0200 +Subject: [PATCH] pyhook: add timetout to sockets rhbz#808562 + +--- + src/hooks/abrt_exception_handler.py.in | 46 ++++++++++++++++++-------------- + 1 file changed, 26 insertions(+), 20 deletions(-) + +diff --git a/src/hooks/abrt_exception_handler.py.in b/src/hooks/abrt_exception_handler.py.in +index 9522a0f..cc00fc7 100644 +--- a/src/hooks/abrt_exception_handler.py.in ++++ b/src/hooks/abrt_exception_handler.py.in +@@ -37,26 +37,32 @@ def write_dump(tb): + try: + import socket + s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) +- s.connect(@VAR_RUN@ + "/abrt/abrt.socket") +- s.sendall("PUT / HTTP/1.1\r\n\r\n") +- s.sendall("PID=%s\0" % os.getpid()) +- s.sendall("EXECUTABLE=%s\0" % executable) +- s.sendall("ANALYZER=Python\0") +- s.sendall("BASENAME=pyhook\0") +- # This handler puts a short(er) crash descr in 1st line of the backtrace. +- # Example: +- # CCMainWindow.py:1::ZeroDivisionError: integer division or modulo by zero +- s.sendall("REASON=%s\0" % tb.splitlines()[0]) +- s.sendall("BACKTRACE=%s\0" % tb) +- s.shutdown(socket.SHUT_WR) +- +- # Read the response and log if there's anything wrong +- response = "" +- while True: +- buf = s.recv(256) +- if not buf: +- break; +- response += buf ++ s.settimeout(5) ++ try: ++ s.connect(@VAR_RUN@ + "/abrt/abrt.socket") ++ s.sendall("PUT / HTTP/1.1\r\n\r\n") ++ s.sendall("PID=%s\0" % os.getpid()) ++ s.sendall("EXECUTABLE=%s\0" % executable) ++ s.sendall("ANALYZER=Python\0") ++ s.sendall("BASENAME=pyhook\0") ++ # This handler puts a short(er) crash descr in 1st line of the backtrace. ++ # Example: ++ # CCMainWindow.py:1::ZeroDivisionError: integer division or modulo by zero ++ s.sendall("REASON=%s\0" % tb.splitlines()[0]) ++ s.sendall("BACKTRACE=%s\0" % tb) ++ s.shutdown(socket.SHUT_WR) ++ ++ ++ # Read the response and log if there's anything wrong ++ response = "" ++ while True: ++ buf = s.recv(256) ++ if not buf: ++ break ++ response += buf ++ except socket.timeout, ex: ++ import syslog ++ syslog.syslog("communication with ABRT daemon failed: %s" % str(ex)) + + s.close() + parts = response.split() +-- +1.7.10 + diff --git a/abrt.spec b/abrt.spec index 26ecac9..0d39398 100644 --- a/abrt.spec +++ b/abrt.spec @@ -16,7 +16,7 @@ Summary: Automatic bug detection and reporting tool Name: abrt Version: 2.0.7 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: Applications/System URL: https://fedorahosted.org/abrt/ @@ -31,6 +31,7 @@ Patch5: 0005-more-glib2.31-fixes.patch Patch6: 0006-missed-one-more-deprecated-g_io_channel_read.patch Patch7: 0007-abrt-action-install-debuginfo-do-not-use-scientific-.patch Patch8: 0008-abrt-cli-add-man-page.-Closes-rhbz-747624.patch +Patch9: 0001-pyhook-add-timetout-to-sockets-rhbz-808562.patch BuildRequires: dbus-devel BuildRequires: gtk2-devel @@ -200,6 +201,7 @@ Virtual package to make easy default installation on desktop environments. %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 %build autoconf @@ -529,6 +531,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %defattr(-,root,root,-) %changelog +* Wed Apr 18 2012 Jiri Moskovcak 2.0.7-3 +- fixed freeze in crashing python apps rhbz#808562 + * Thu Dec 08 2011 Jiri Moskovcak 2.0.7-2 - added man page - fixed weird number formatting