FS#18867 - [xmobar] 0.9.2-2 crashes when used with Midori

Attached to Project: Community Packages
Opened by Randy Heydon (Tempel) - Sunday, 28 March 2010, 22:21 GMT
Last edited by Sergej Pupykin (sergej) - Tuesday, 18 May 2010, 11:23 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
With yesterday's package update (0.9.2-1 -> 0.9.2-2), xmobar fails in one of several interesting ways whenever the web browser Midori (version 0.2.4-1) is given focus. This has been observed when used with window manager Xmonad (config file xmonad.hs attached), but has not been tested within other window managers. This problem has not been observed in conjunction with any program besides Midori. This never occurred before yesterday's update.

Sometimes, after focusing on Midori, xmobar will run satisfactorily for several minutes before locking up; sometimes this lock up occurs as soon as Midori is given focus. Either way, xmobar will have its output stuck at whatever it happened to be at that moment. Workspace, window title, system stats, and time (everything included in my attached .xmobarrc) stay exactly as they are. This is accompanied by absolutely no debugging output in the terminal.

Other times, as soon as Midori is given focus, xmobar will crash entirely; where it once was, nothing is visible, its process ends, and a line is output to terminal saying "xmobar: Enum.toEnum{Word8}: tag (8234) is outside of bounds (0,255)", which is followed by "<file descriptor: 4>: hPutChar: resource vanished (Broken pipe)", appearing once each time the window title would change.

I haven't figured out exactly what triggers one failure mode or the other. I have found that changing window focus to Midori within a single workspace (Mod-tab) will trigger an instant lock-up, but changing workspaces to land on Midori (Mod-<workspace #>) will trigger a crash. Restarting Xmonad (Mod-q) will fix xmobar regardless of failure mode, but restarting while focused on Midori will cause xmobar to crash immediately.

I hope this has been informative, and I hope it's not too much of a pain to fix. I don't like the thought of switching back to Firefox.
This task depends upon

Closed by  Sergej Pupykin (sergej)
Tuesday, 18 May 2010, 11:23 GMT
Reason for closing:  Fixed
Additional comments about closing:  xmobar was updated to 0.11.1
Comment by Eugene (h0rr0rr_drag0n) - Monday, 29 March 2010, 19:11 GMT
I got a similar problem with the browser Chromium and I also did some tests and found that xmobar crashes when we open any frame with Cyrillic letters in window name (for example: we open "gvim проба.txt" in current layout and xmobar chrashes).

Temporary solution: run xmobar with without StdinReader but this is so ugly and not usable.
Comment by Randy Heydon (Tempel) - Monday, 29 March 2010, 20:44 GMT
In that case, this might be related to a bug reported upstream that xmobar crashes on receiving UTF-8 characters in the StdinReader ( http://code.google.com/p/xmobar/issues/detail?id=21 ). But if this is an upstream bug, why did it not appear in the previous Arch package?
Comment by Wei (roy_hu) - Saturday, 03 April 2010, 01:56 GMT
The previous Arch package may have been built by ghc-6.10. According to http://code.google.com/p/xmobar/issues/detail?id=17, the bug only occurs with ghc-6.12.
Comment by Fazlul Shahriar (fhs) - Saturday, 03 April 2010, 08:21 GMT
Yes, this is a utf8 related bug. See http://code.google.com/p/xmobar/issues/detail?id=17
It's fixed in the latest darcs rev. However, if you don't want to use the development version (like me), you can disable uft8 for now:

# Contributor: Arch Haskell Team <arch-haskell@haskell.org>
# Package generated by cabal2arch 0.4
pkgname=xmobar
pkgver=0.9.2
pkgrel=2
pkgdesc="A Minimalistic Text Based Status Bar"
url="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/xmobar"
license=('custom:BSD3')
arch=('i686' 'x86_64')
makedepends=('ghc' 'haskell-x11>=1.3.0' 'haskell-stm' 'haskell-parsec' 'haskell-mtl')
depends=('gmp' 'libxinerama')
options=('strip')
source=(http://hackage.haskell.org/packages/archive/xmobar/$pkgver/xmobar-$pkgver.tar.gz)
md5sums=('1177eef9f032256ccf370239a0703eab')

build() {
cd $startdir/src/xmobar-$pkgver
runhaskell Setup configure --disable-optimization --prefix=/usr --constraint="base<4" --flags="-with_xft -with_utf8"|| return 1
runhaskell Setup build || return 1
runhaskell Setup copy --destdir=$startdir/pkg || return 1
install -D -m644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/LICENSE || return 1
}
Comment by orbisvicis (orbisvicis) - Sunday, 11 April 2010, 08:42 GMT
I uploaded several test cases on dpaste a while back, here they are. To be clear, xmobar crashing is not the most frequent symptom since my ppSep and several other status character are UTF8.

The trick I found to work is forcing the IO handle to UTF8 mode, "hSetEncoding xmobar utf8" and using System.IO.hPutStrLn (not System.IO.UTF8 which is now deprecated). All of which is a bit weird.

Other stuff about 6.12.1 @ http://ghcmutterings.wordpress.com/2009/09/30/heads-up-what-you-need-to-know-about-unicode-io-in-ghc-6-12-1/

hope it helps
   utf.hs (1.8 KiB)
Comment by orbisvicis (orbisvicis) - Sunday, 11 April 2010, 08:45 GMT
good to know the fix exists upstream :)

Loading...