[Merge] ~dbungert/update-notifier:lp-1821412-x11 into update-notifier:master

Dan Bungert daniel.bungert at canonical.com
Tue Jul 13 13:09:26 UTC 2021


Dan Bungert has proposed merging ~dbungert/update-notifier:lp-1821412-x11 into update-notifier:master.

Commit message:
Fix x11 early process exit when reporting a crash (LP: 1821412)                                                          
                                                                                                                         
Sometimes, pressing the Report button on the system crash dialog does                                                    
nothing helpful.                                                                                                         
                                                                                                                         
This mechanism works by using g_spawn_async to run the reporting                                                         
programs.  I found that the child processes were not being allowed to                                                    
run to completion.  Looking at the documentation for GSubprocess, this                                                   
appears to be expected behavior as it purposefully closes child                                                          
processes when the parent process exits to prevent zombies.  Sadly,                                                      
allowing the child processes to continue running is intended in this                                                     
case, and I did not locate a suitable mechanism to keep these child                                                      
processes running within glib & related libraries.                                                                       
(though fork/execv worked fine)                                                                                          
                                                                                                                         
Changing to g_spawn_sync does help the above problem.  However, it                                                       
exposes a new problem.  The usage here of gtk_dialog_run results in the                                                  
dialog staying on screen - the call to gtk_widget_destroy doesn't                                                        
actually make the dialog go away, and instead it goes away upon process                                                  
exit.  The combination of this behavior with needing to move to                                                          
g_spawn_sync and not immediatly exiting means that this dialog staying                                                   
on screen is a problem.                                                                                                  
                                                                                                                         
The core update-notifier binary doesn't seem to have this dialog                                                         
problem, presumably because it uses gtk_main to start an event loop                                                      
while system-crash does not.  It also doesn't want to immediately exit,                                                  
so we have time for async processes to do their thing.                                                                   
                                                                                                                         
Upon looking into gtk_dialog_run, however, I found that this call is no                                                  
longer present in gtk4.  This is one motivation among several to                                                         
encourage a more modern gtk usage.                                                                                       
                                                                                                                         
In summary, modernize gtk usage to allow dialogs to close when intended                                                  
so that we can run child processes and wait for them to exit.                                                            
                                                                                                                         
Also adapt the above to distro-cd-updater, since it has the same problem                                                 
signature (no gtk_main(), call to gtk_dialog_run(), use decision from                                                    
dialog to run subprocess with g_spawn_async() then immediately exit).                                                    

There is also a wayland version of this problem, which might be related                                                  
to the above but seems to have additional polkit problems, which I do                                                    
not expect to be resolved by this commit.                                                                                

Requested reviews:
  Ubuntu Core Development Team (ubuntu-core-dev)

For more details, see:
https://code.launchpad.net/~dbungert/update-notifier/+git/update-notifier/+merge/405628
-- 
Your team Ubuntu Core Development Team is requested to review the proposed merge of ~dbungert/update-notifier:lp-1821412-x11 into update-notifier:master.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: review-diff.txt
Type: text/x-diff
Size: 10553 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-reviews/attachments/20210713/ca005ef2/attachment.diff>


More information about the Ubuntu-reviews mailing list