Skip to content
  1. Mar 06, 2018
  2. Mar 04, 2018
  3. Feb 24, 2018
  4. Feb 09, 2018
  5. Jan 21, 2018
  6. Jan 19, 2018
  7. Jan 15, 2018
    • Thomas Haller's avatar
      Revert "service: keep reference to plugin while main loop is running" · a270a922
      Thomas Haller authored
      After leaving the main loop on SIGTERM, we want to tear down the
      NMVpnServicePlugin instance. This should also unexports the service on
      D-Bus and ensure that no more requests are accepted -- as we wouldn't
      handle them anyway.
      
      Note that afterwards we still want to iterate the main loop waiting for
      processes to terminate.
      
      This reverts commit 9f459770.
      The crash that 9f459770 tried to address is actually a bug
      in libnm, where NMVpnServicePlugin would not unexport the D-Bus
      service. This must be fixed by libnm instead [1]. Note that overall
      the crash is of limited priority, because we are already in the process
      of shutting down.
      
      [1] https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=929f36c56f3b22a917066c5cb7bfc938630f9e8c
      a270a922
    • Thomas Haller's avatar
      service: ensure proper termination when waiting for processes to exit · c303f0d1
      Thomas Haller authored
      - ensure that we started terminating the processes that we are
        waiting that they terminate. It's not clear that we already called
        pids_pending_send_sigterm() at this point. Also add a is_terminating
        variable, to initiate shutdown precisely once.
      
      - while pids_pending_send_sigterm() already schedules a 2 seconds
        timeout to send a SIGKILL if SIGTERM doesn't work, there is
        no guarantee that pids_pending_wait_for_processes() will always
        complete. Also schedule a 3 seconds timeout. If within that time
        the processes didn't all terminate, we don't wait any longer.
      
      - don't pass a GMainLoop to pids_pending_wait_for_processes().
        The entire mechanism uses g_timeout_add(), which can only work
        with the current main context. It cannot work to pass a loop
        for another context. Hence, we don't need the loop either.
      c303f0d1
    • Thomas Haller's avatar
      service: cleanup resources at the end of main loop · 66703d55
      Thomas Haller authored
      Don't just exit(), but just return from the main function.
      This way, we get a chance to cleanup all resources properly.
      66703d55
    • Beniamino Galvani's avatar
      service: keep reference to plugin while main loop is running · 9f459770
      Beniamino Galvani authored and Thomas Haller's avatar Thomas Haller committed
      pids_pending_wait_for_processes() runs the main loop, where queued
      D-Bus events could be processed. Ensure the plugin is still
      alive. Fixes the following:
      
       nm-openvpn-serv[7900]: g_dbus_method_invocation_take_error: assertion 'error != NULL' failed
       NetworkManager[4823]: nm-openvpn[7900] <info>  openvpn[7912]: send SIGKILL
      
       #0  nm_vpn_service_plugin_disconnect (plugin=0x91b8e0, err=err@entry=0x7ffce3dc80c8) at libnm/nm-vpn-service-plugin.c:236
       #1  0x00007fe1a361aae6 in impl_vpn_service_plugin_disconnect (plugin=<optimized out>, context=0x92f6c0, user_data=<optimized out>) at libnm/nm-vpn-service-plugin.c:857
       #2  0x00007fe1a01b8d1e in ffi_call_unix64 () from target:/lib64/libffi.so.6
       #3  0x00007fe1a01b868f in ffi_call () from target:/lib64/libffi.so.6
       #4  0x00007fe1a1570f39 in g_cclosure_marshal_generic () from target:/lib64/libgobject-2.0.so.0
       #5  0x00007fe1a35f59fe in _nm_dbus_method_meta_marshal (closure=<optimized out>, return_value=0x7ffce3dc84d0, n_param_values=<optimized out>, param_values=<optimized out>,
           invocation_hint=<optimized out>, marshal_data=<optimized out>) at libnm/nm-dbus-helpers.c:203
       #6  0x00007fe1a157073d in g_closure_invoke () from target:/lib64/libgobject-2.0.so.0
       #7  0x00007fe1a15834de in signal_emit_unlocked_R () from target:/lib64/libgobject-2.0.so.0
       #8  0x00007fe1a158b270 in g_signal_emitv () from target:/lib64/libgobject-2.0.so.0
       #9  0x00007fe1a3683034 in _nmdbus_vpn_plugin_skeleton_handle_method_call (connection=<optimized out>, sender=<optimized out>, object_path=<optimized out>,
           interface_name=0x7fe18c012b80 "org.freedesktop.NetworkManager.VPN.Plugin", method_name=0x7fe18c00f7b0 "Disconnect", parameters=<optimized out>, invocation=0x92f6c0, user_data=0x916e20)
           at introspection/org.freedesktop.NetworkManager.VPN.Plugin.c:2946
       #10 0x00007fe1a18890d7 in g_dbus_interface_method_dispatch_helper () from target:/lib64/libgio-2.0.so.0
       #11 0x00007fe1a18713dc in call_in_idle_cb () from target:/lib64/libgio-2.0.so.0
       #12 0x00007fe1a1294597 in g_idle_dispatch () from target:/lib64/libglib-2.0.so.0
       #13 0x00007fe1a1297bb7 in g_main_context_dispatch () from target:/lib64/libglib-2.0.so.0
       #14 0x00007fe1a1297f60 in g_main_context_iterate.isra () from target:/lib64/libglib-2.0.so.0
       #15 0x00007fe1a1297fec in g_main_context_iteration () from target:/lib64/libglib-2.0.so.0
       #16 0x0000000000403645 in pids_pending_wait_for_processes (main_loop=0x933470) at src/nm-openvpn-service.c:417
      
      https://bugzilla.gnome.org/show_bug.cgi?id=792252
      9f459770
  8. Jan 13, 2018
  9. Jan 09, 2018
  10. Jan 08, 2018
  11. Dec 20, 2017
  12. Dec 17, 2017
  13. Nov 26, 2017
  14. Nov 20, 2017