11.03.2011

Trouble with chromium and an easy-to-install PDF reader plugin (ambiguity inteded)

I recently switched from Firefox to Chromium due to it's speed. I was really happy with my choice until today, when Chromium stopped working out of the blue.
I installed some updates in the background, was working on a project where I had a website opened and when I closed and reopened Chromium... nothing!
Chromium couldn't load any web site. My first thought was of course "there must be something wrong with the network connection or settings". There wasn't. The really nasty thing was that Chromium did not only stop loading web pages - it couldn't even display its own preferences, downloads and the bookmark manager!
My second thought - Google's Your friend! There were a lot of people complaining about issues just similar to the one I saw. The problem was, they all used windows. Their best solution ("run an anti-virus-scan") was kind of the wrong approach for me and the debug log neither told me anything useful. All seemed lost and I had already accepted my fate of having to use Firefox until a new update for Chromium came out, when suddenly a miracle happened.
I could have sworn this would never happen, yet it did. A crash saved the day! Now here's something off topic: Ever since I started using Ubuntu's home directory encryption feature, it broke from time to time. Nothing big, though. While using the system just normally, the encrypted file system would somehow be unmounted, leaving me with an empty home directory. My desktop background disappeared, my shells started taking me to the root directory and I had to log out and back in. This time, I wanted to know what went wrong, so I called dmesg with a surprising result...
Code:
chromium-browse[<PID>]: segfault at 4 ip 00000004 sp bfa74c2c error 14 in libpdf.so[b1e85000+118a000]
Turns out, my PDF reader plugin was incompatible with my new chromium version. Deleting the libpdf.so from /usr/lib/chromium-browser/ solved the problem.

And this is part 2 of the article.
One of Chromium's disadvantages with Google Chrome is the lack of a PDF plugin. Luckily, both programs are easily available for linux. And more luckily, it's pretty easy to steal Chrome's PDF plugin and install it for Chromium. Here's how You do it (make sure to update the plugin every time You update Chromium to avoid the mess I wrote about above!):
  1. Get the latest version of Chrome for Your architecture as a Debian package from http://www.google.com/chrome (make sure to open the site with Linux!).
  2. Open the package with the archive program (example for i386):
    Code:
    $ file-roller google-chrome-stable_current_i386.deb
  3. Extract the file opt/google/chrome/libpdf.so to some location
  4. Put the file into the chromium directory
    Code:
    $ sudo mv libpdf.so /usr/lib/chromium-browser/
    $ sudo chown root:root /usr/lib/chromium-browser/libpdf.so
That's it! You're done!