[GNOME-ABRT PATCH] Recover from fork errors

Richard Marko rmarko at redhat.com
Tue Aug 13 11:55:08 UTC 2013


Pushed. Thanks!

On 08/13/2013 01:16 PM, Jakub Filak wrote:
> Closes rhbz#995868
>
> Signed-off-by: Jakub Filak <jfilak at redhat.com>
> ---
>  po/POTFILES.in                  |  1 +
>  src/gnome_abrt/controller.py.in | 13 ++++++++++++-
>  2 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/po/POTFILES.in b/po/POTFILES.in
> index 0a3555e..0f30622 100644
> --- a/po/POTFILES.in
> +++ b/po/POTFILES.in
> @@ -7,3 +7,4 @@ src/gnome_abrt/oops.glade
>  src/gnome_abrt/problems.py
>  src/gnome_abrt/tools.py
>  src/gnome_abrt/views.py
> +src/gnome_abrt/controller.py
> diff --git a/src/gnome_abrt/controller.py.in b/src/gnome_abrt/controller.py.in
> index 0dad426..969d6a8 100644
> --- a/src/gnome_abrt/controller.py.in
> +++ b/src/gnome_abrt/controller.py.in
> @@ -22,6 +22,7 @@ import traceback
>  
>  # gnome-abrt
>  from gnome_abrt import errors
> +from gnome_abrt.l10n import _
>  
>  class Controller(object):
>  
> @@ -68,7 +69,17 @@ class Controller(object):
>  
>      def _run_event_on_problem(self, event, problem):
>          if problem.assure_ownership():
> -            if os.fork() == 0:
> +            pid = -1
> +            try:
> +                pid = os.fork()
> +            except OSError as ex:
> +                logging.debug(traceback.format_exc())
> +                logging.error(
> +                        _("Failed to execute the requested action because of"
> +                          " an error in new process creation"))
> +                return
> +
> +            if pid == 0:
>                  exctbl = "@libexecdir@/abrt-handle-event"
>                  args = [exctbl, "-e", event, "--", problem.problem_id]
>                  try:


-- 
Richard Marko



More information about the Crash-catcher mailing list