Merge lp:~jamesodhunt/ubuntu/quantal/debconf/bug-1060249 into lp:ubuntu/raring/debconf

Proposed by James Hunt
Status: Merged
Merged at revision: 67
Proposed branch: lp:~jamesodhunt/ubuntu/quantal/debconf/bug-1060249
Merge into: lp:ubuntu/raring/debconf
Diff against target: 69 lines (+32/-7)
2 files modified
Debconf/FrontEnd/Gnome.pm (+24/-7)
debian/changelog (+8/-0)
To merge this branch: bzr merge lp:~jamesodhunt/ubuntu/quantal/debconf/bug-1060249
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+136260@code.launchpad.net

Description of the change

* Debconf/Frontend/Gnome.pm:init(): Only 'use Gtk2;' once it has been
  proven to be safe to avoid rogue Perl module behaviour from crashing
  debconf (#LP: 1060249).

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

This has been merged upstream. I'm working on a different problem before preparing a release, and then I think it will be fine to just merge that into raring.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Debconf/FrontEnd/Gnome.pm'
2--- Debconf/FrontEnd/Gnome.pm 2011-06-23 06:52:13 +0000
3+++ Debconf/FrontEnd/Gnome.pm 2012-11-26 20:29:20 +0000
4@@ -14,13 +14,6 @@
5 use Debconf::Encoding qw(to_Unicode);
6 use base qw{Debconf::FrontEnd};
7
8-# Catch this so as not to confuse the poor users if Gtk or Gnome are not
9-# installed.
10-eval q{
11- use Gtk2;
12-};
13-die "Unable to load Gtk -- is libgtk2-perl installed?\n" if $@;
14-
15 =head1 DESCRIPTION
16
17 This FrontEnd is a Gnome UI for Debconf.
18@@ -121,11 +114,35 @@
19 }
20 }
21 else {
22+ # Catch scenario where Gtk/Gnome are not installed.
23+ use Gtk2;
24+
25 @ARGV=@ARGV_for_gnome; # temporary change at first
26 Gtk2->init;
27+
28+ # Create a window, but don't show it.
29+ #
30+ # This has the effect of exercising gtk a bit in an
31+ # attempt to force an error either in the gtk bindings
32+ # themselves, but hopefully also in
33+ # gtk/glib/gsettings/etc. There is no guarantee that
34+ # this alone will provoke an error, but it's a
35+ # relatively safe and reasonable operation to perform
36+ # and further reduces the chance of the parent debconf
37+ # process ending up in an unrecoverable state.
38+ my $window = Gtk2::Window->new('toplevel');
39+
40 exit(0); # success
41 }
42
43+ # Only load Gtk after the child has successfully proved it can do
44+ # the same. This avoids the problem where a module calls into a
45+ # native library and causes the perl interpreter to crash. When
46+ # we get to here, we know that the child didn't crash, so it
47+ # should be safe for us to attempt it.
48+ eval q{use Gtk2;};
49+ die "Unable to load Gtk -- is libgtk2-perl installed?\n" if $@;
50+
51 my @gnome_sucks=@ARGV;
52 @ARGV=@ARGV_for_gnome;
53 Gtk2->init;
54
55=== modified file 'debian/changelog'
56--- debian/changelog 2012-08-16 17:37:10 +0000
57+++ debian/changelog 2012-11-26 20:29:20 +0000
58@@ -1,3 +1,11 @@
59+debconf (1.5.46ubuntu2) UNRELEASED; urgency=low
60+
61+ * Debconf/Frontend/Gnome.pm:init(): Only 'use Gtk2;' once it has been
62+ proven to be safe to avoid rogue Perl module behaviour from crashing
63+ debconf (#LP: 1060249).
64+
65+ -- James Hunt <james.hunt@ubuntu.com> Wed, 17 Oct 2012 13:46:47 +0100
66+
67 debconf (1.5.46ubuntu1) quantal; urgency=low
68
69 * Resynchronise with Debian. Remaining changes:

Subscribers

People subscribed via source and target branches

to all changes: