Search This Blog

2013-05-10

Apper hang on openSUSE 12.3

Env:
openSUSE 12.3 x86_64, KDE 4.10

--
Problem:
I'm a newbie to openSUSE, I've enabled tumbleweed repositories. I suffered an update problem today: apper updates hang on installing libpango-1_0, it just show "waiting for service to start" on the title bar.

--
Solution steps:
  1. stop apper
    • Open "System Activity" (shortcut Ctrl+Esc), search "apper" and end process.
  2. > sudo zypper dup --from Tumbleweed
    • It may hang on pango-querymodules-64, end this process, look the details section for more info.

Notice:
"zypper dup" cost much time, try following 3 commands first, it may work.
> sudo zypper verify
    Check whether dependencies of installed packages are satisfied. In case that any dependency problems are found, zypper suggests packages to install or remove to fix them.
> sudo zypper patch
> sudo zypper update

It seems apper list is the same as "zypper list-patches" + "zypper list-updates", but i prefer to use zypper to do update later, apper will be used as notification.

--
Some details of the process:
I restarted computer, apper installed some more packages, and then hang on installing libpango-1_0 again.
I cost several hours to dig and solve it, following is the process, it may be useful for another openSUSE newbie.

> ps -ef | grep libpango
root      1918  1828  0 13:47 ?        00:00:00 rpm --root / --dbpath /var/lib/rpm -U --percent --force --nodeps -- /var/cache/zypp/packages/Tumbleweed/x86_64/libpango-1_0-0-1.34.0-2.1.x86_64.rpm
# what is process 1918 doing?

> man rpm
rpm {-U|--upgrade} [install-options] PACKAGE_FILE ...
# process 1918 is doing upgrade.

show installed libpango packages:
> rpm -qa | grep libpango
libpango-1_0-0-1.32.5-3.4.2.x86_64
libpango-1_0-0-1.34.0-2.1.x86_64
libpango-1_0-0-32bit-1.32.5-3.4.2.x86_64
libpango-1_0-0-32bit-1.34.0-2.1.x86_64
# it's installed, and twice

show where process 1918 is blocked:
> sudo gstack 1918
root's password:
#0  0x00007ffa80fbdd9a in waitpid () from /lib64/libpthread.so.0
#1  0x00007ffa816897de in ?? () from /usr/lib64/librpm.so.3
#2  0x00007ffa81670864 in ?? () from /usr/lib64/librpm.so.3
#3  0x00007ffa816709e0 in ?? () from /usr/lib64/librpm.so.3
#4  0x00007ffa81670fc5 in ?? () from /usr/lib64/librpm.so.3
#5  0x00007ffa8167157c in ?? () from /usr/lib64/librpm.so.3
#6  0x00007ffa8167211b in ?? () from /usr/lib64/librpm.so.3
#7  0x00007ffa816815b2 in ?? () from /usr/lib64/librpm.so.3
#8  0x00007ffa81687e2c in rpmtsRun () from /usr/lib64/librpm.so.3
#9  0x00007ffa8167b260 in ?? () from /usr/lib64/librpm.so.3
#10 0x00007ffa8167c2cc in rpmInstall () from /usr/lib64/librpm.so.3
#11 0x00000000004019ed in ?? ()
#12 0x00007ffa80c23a15 in __libc_start_main () from /lib64/libc.so.6
#13 0x0000000000401dc9 in ?? ()

> man waitpid
wait, waitpid, waitid - wait for process to change state
All of these system calls are used to wait for state changes in a child of the calling process, and obtain information about the child whose state has changed. A state change is considered to be: the child terminated; the child was stopped by a signal; or the child was resumed by a signal.
# process 1918 is waiting for child process to finish.

show process 1918 child process:
> ps -ef | less
/1918
root      1919  1918  0 13:47 ?        00:00:00 /bin/sh /var/tmp/rpm-tmp.TzEesv 2
root      1921  1919  0 13:47 ?        00:00:00 /usr/bin/pango-querymodules-64 --update-cache
/1921
# process 1918 hang on process 1921 (/usr/bin/pango-querymodules-64 --update-cache).

show what process 1921 is doing:
> sudo gstack 1921
root's password:
#0  0x00007fcb14ff3964 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007fcb1528bcef in g_cond_wait () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fcb1527249b in g_once_init_enter () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fcb1597bf70 in pango_script_get_type () from /usr/lib64/libpango-1.0.so.0
#4  0x0000000000401abd in ?? ()
#5  0x0000000000401601 in ?? ()
#6  0x00007fcb14c5ca15 in __libc_start_main () from /lib64/libc.so.6
#7  0x00000000004016ed in ?? ()
# dead lock?

> man pango-querymodules
pango-querymodules collects information about loadable modules for Pango and writes it to stdout.
--update-cache
  Update the Pango module cache file directly, instead of writing the information to stdout.

let it write to stdout.
> pango-querymodules-64
(pango-querymodules-64:3037): GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init()
(pango-querymodules-64:3037): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed
(pango-querymodules-64:3037): GLib-GObject-WARNING **: cannot retrieve class for invalid (unclassed) type `<invalid>'
(pango-querymodules-64:3037): GLib-GObject-CRITICAL **: g_enum_get_value: assertion `G_IS_ENUM_CLASS (enum_class)' failed
(pango-querymodules-64:3037): Pango-WARNING **: Engine reported invalid script value 10
# no idea, i restarted computer again, apper installed all left packages, but Input Method Panel hang, YaST hang.

> ls -l /var/cache/zypp/packages/Tumbleweed/x86_64/
total 520
-rw-r--r-- 1 root root  69724 Apr 26 12:27 libgnome-desktop-3_0-common-3.8.1-2.1.x86_64.rpm
-rw-r--r-- 1 root root 274786 Apr 26 12:28 libpango-1_0-0-1.34.0-2.1.x86_64.rpm
-rw-r--r-- 1 root root 178397 Apr 26 12:27 libpango-1_0-0-32bit-1.34.0-2.1.x86_64.rpm
# 3 packages were left, updates should be failed.

i wanted to do downgrade, zypper will analyze and do it. i'm not familiar to zypper, dup is the only one i've used before.
> sudo zypper dup --from Tumbleweed
2 Problems:
Problem: problem with installed package kernel-desktop-3.8.6-2.1.x86_64
Problem: avahi-autoipd-0.6.31-2.1.x86_64 conflicts with avahi <= 0.6.31-9.2 provided by avahi-0.6.31-2.1.x86_64
...
  replacement of kernel-desktop-3.8.6-2.1.x86_64 with kernel-desktop-3.8.8-3.1.x86_64
  deinstallation of kernel-desktop-3.8.6-2.1.x86_64
  deinstallation of avahi-0.6.31-10.2.1.x86_64
  deinstallation of nss-mdns-0.10-58.1.1.x86_64
  deinstallation of nss-mdns-32bit-0.10-58.1.1.x86_64
The following packages are going to be REMOVED:
  avahi libpango-1_0-0 libpango-1_0-0-32bit nss-mdns nss-mdns-32bit 
180 packages to upgrade, 27 to downgrade, 21 new, 5 to remove.

it should work now. but,
it hang on "Installing: kernel-desktop-3.8.8-3.1", <100%>[/]

> man ps | less
/tree

> ps axjf | less
/zypper
 PPID   PID  PGID   SID TTY      TPGID STAT   UID   TIME COMMAND
    1  2170  1874  1874 ?           -1 Sl    1000   0:26 kdeinit4: konsole [kdeinit]                    
 2170  2173  2173  2173 pts/3     2694 Ss    1000   0:00  \_ /bin/bash
 2173  2694  2694  2173 pts/3     2694 S+       0   0:00  |   \_ sudo zypper dup --from Tumbleweed
 2694  2695  2694  2173 pts/3     2694 S+       0   0:22  |       \_ zypper dup --from Tumbleweed
 2695  4513  2694  2173 pts/3     2694 S+       0   0:03  |           \_ rpm --root / --dbpath /var/lib/rpm -i --percent --force --nodeps -- /var/cache/zypp/packages/Tumbleweed/x86_64/kernel-desktop-3.8.8-3.1.x86_64.rpm
 4513  4515  2694  2173 pts/3     2694 S+       0   0:00  |               \_ /bin/sh /var/tmp/rpm-tmp.dwImZ5 1
 4515  4521  2694  2173 pts/3     2694 S+       0   0:00  |                   \_ /bin/bash -hB /usr/lib/module-init-tools/weak-modules2 --add-kernel 3.8.8-3-desktop
 4521  4532  2694  2173 pts/3     2694 S+       0   0:00  |                       \_ /bin/bash -hB /usr/lib/module-init-tools/weak-modules2 --add-kernel 3.8.8-3-desktop
 4532  4535  2694  2173 pts/3     2694 S+       0   0:00  |                           \_ /bin/bash /sbin/mkinitrd -k /boot/vmlinuz-3.8.8-3-desktop -i /boot/initrd-3.8.8-3-desktop
 4535  4573  2694  2173 pts/3     2694 S+       0   0:00  |                               \_ /bin/bash /sbin/mkinitrd -k /boot/vmlinuz-3.8.8-3-desktop -i /boot/initrd-3.8.8-3-desktop
 4573  4843  2694  2173 pts/3     2694 S+       0   0:00  |                                   \_ /bin/bash /sbin/mkinitrd -k /boot/vmlinuz-3.8.8-3-desktop -i /boot/initrd-3.8.8-3-desktop
 4843  4844  2694  2173 pts/3     2694 S+       0   0:00  |                                       \_ pango-querymodules-64
 4843  4845  2694  2173 pts/3     2694 S+       0   0:00  |                                       \_ grep ModulesPath
 4843  4846  2694  2173 pts/3     2694 S+       0   0:00  |                                       \_ awk {print $4}

There's pango-querymodules-64 again, I ended process pango-querymodules-64, upgrade continued. After restarting computer, it works, fcitx, yast, and also pango-querymodules-64.

--
References:
pstack(1): print stack trace of running process - linux.die.net
libpango update stuck - forums.opensuse.org
    another guy suffered the same problem, and he shared something here, i wanted to post something too, but the registered account still doesn't work today (i registered an account several days ago)

=Revisions=

20130426 simple record
20130429 make text clear to read
20130510 change it to html

No comments:

Post a Comment