libgtk-3-0:<arch>.postinst erase IM cache file, that breaks GTK-3 apps IM environment.

Bug #908801 reported by Fumihito YOSHIDA
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gtk+3.0 (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
High
Unassigned

Bug Description

/var/lib/dpkg/info/libgtk-3-0:<arch>.postinst breaks InputMethod(IM) cache file(immodules.cache), so that breaks IM environment for GTK-3 based applications.

[How to reproduce]

1) install precise
2) sudo apt-get update && sudo apt-get upgrade libgtk-3-0=3.3.4-0ubuntu2
3) open gnome-terminal
4) Type ctrl-space(or your IM invoke key)

[Actual results]

IM(e.g. ibus) does not invoked. But, non GTK-3 application (such as Firefox) could use ibus.

[Expect results]

IM invoked.

[Root cause/Background]

In many IM stacks, that use /usr/lib/<arch>/gtk-3.0/3.0.0/immodules.cache file for invoking.
If that file has exists && empty, IM stacks could not start on GTK-3 applications.

in GTK-3 postinst scriptlet(e.g. /var/lib/dpkg/info/libgtk-3-0:i386.postinst), that uses shell-globs with unsafe way. If glob files does not exist, gtk-query-immodules-3.0 command does not output anything. So, /usr/lib/i386-linux-gnu/gtk-3.0/3.0.0/immodules.cache file xed out by redirectiton.

if [ "$1" = triggered ]; then
    for trigger in $2; do
        if ! [ -d $trigger ]; then
            continue
        fi
        case $trigger in
          /usr/lib/i386-linux-gnu/gtk-3.0/3.0.0/immodules|/usr/lib/gtk-3.0/3.0.0/immodules)
            # This is triggered everytime an application installs a
            # GTK immodule loader
            /usr/lib/i386-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0 /usr/lib/i386-linux-gnu/gtk-3.0/3.0.0/immodules/*.so /usr/lib/gtk-3.0/3.0.0/immodules/*.so > /usr/lib/i386-linux-gnu/gtk-3.0/3.0.0/immodules.cache || true
            ;;
        esac
    done
    exit 0
fi

e.g.:
# /usr/lib/i386-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0 /usr/lib/i386-linux-gnu/gtk-3.0/3.0.0/immodules/*.so /usr/lib/gtk-3.0/3.0.0/immodules/*.so
/usr/lib/i386-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0 /usr/lib/i386-linux-gnu/gtk-3.0/3.0.0/immodules/*.so /usr/lib/gtk-3.0/3.0.0/immodules/*.so
Cannot load module /usr/lib/gtk-3.0/3.0.0/immodules/*.so: /usr/lib/gtk-3.0/3.0.0/immodules/*.so: cannot open shared object file: No such file or directory
/usr/lib/gtk-3.0/3.0.0/immodules/*.so does not export GTK+ IM module API: /usr/lib/gtk-3.0/3.0.0/immodules/*.so: cannot open shared object file: No such file or directory

----------------------------------------------------------------

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: libgtk-3-0 3.3.4-0ubuntu2
ProcVersionSignature: Ubuntu 3.0.0-13.22-generic-pae 3.0.6
Uname: Linux 3.0.0-13-generic-pae i686
ApportVersion: 1.90-0ubuntu1
Architecture: i386
Date: Tue Dec 27 00:45:22 2011
InstallationMedia: Ubuntu 11.10 "Oneiric" - Build i386 LIVE Binary 20111014-16:01
ProcEnviron:
 PATH=(custom, user)
 LANG=ja_JP.utf8
 SHELL=/bin/zsh
SourcePackage: gtk+3.0
UpgradeStatus: Upgraded to precise on 2011-12-13 (12 days ago)

Revision history for this message
Fumihito YOSHIDA (hito) wrote :
Fumihito YOSHIDA (hito)
summary: - /var/lib/dpkg/info/libgtk-3-0:<arch>.postinst breaks IM
+ libgtk-3-0:<arch>.postinst erase IM cache file, that breaks GTK-3 apps
+ IM environment.
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report.

I can confirm that /usr/lib/<arch>-linux-gnu/gtk-3.0/3.0.0/immodules.cache is empty on Precise and is filed with available IM modules if gtk-query-immodules-3.0 is run with existing paths as argument.

affects: gtk+3.0 (Ubuntu) → ubuntu
Changed in ubuntu:
importance: Undecided → High
status: New → Triaged
affects: ubuntu → gtk+3.0 (Ubuntu)
Changed in gtk+3.0 (Ubuntu):
assignee: nobody → Canonical Desktop Team (canonical-desktop-team)
tags: added: rls-mgr-p-tracking
Martin Pitt (pitti)
Changed in gtk+3.0 (Ubuntu Precise):
assignee: Canonical Desktop Team (canonical-desktop-team) → Sebastien Bacher (seb128)
Changed in gtk+3.0 (Ubuntu Precise):
assignee: Sebastien Bacher (seb128) → nobody
Changed in gtk+3.0 (Ubuntu Precise):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gtk+3.0 - 3.3.6-0ubuntu1

---------------
gtk+3.0 (3.3.6-0ubuntu1) precise; urgency=low

  * New upstream version, dropped the patches backported from git:
    - trap XIQueryDevice errors to avoid sessions errors issues after suspend
      (lp: #882956)
    - don't grab mouse input when the menu bar or the resize-grip are clicked
      (lp: #878859)
  * debian/control.in:
    - updated glib requirement
  * debian/libgtk-3-0.postinst.in, debian/rules:
    - don't list the old non-multi-arch ims directory, everything using gtk3
      should be updated and it breaks the update when the directory is empty
      (lp: #908801)
  * debian/libgtk-3-0.symbols:
    - new version update
  * debian/patches/003_gdk.pc_privates.patch:
    - dropped, upstream did similar changes in the new version
  * debian/patches/042_treeview_single-focus.patch:
    - comment that debian change, it has no comment explaining what it's
      supposed to do and needs to be updating if still needed.
  * debian/rules:
    - updated shlibs version
 -- Sebastien Bacher <email address hidden> Tue, 03 Jan 2012 22:35:24 +0100

Changed in gtk+3.0 (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.