Sunday, March 31, 2013

Eclipse and WebKit on Ubuntu 64


Yes, Eclipse does crash sometimes, but we still love it, for some reason :)

If your crash report says something like:

# C  [libwebkitgtk-1.0.so.0+0x426915]  webkitWebViewRegisterForIconNotification+0xb5

then today is your lucky day. I have a solution for you.

First of all, about the problem

Looks like Eclipse does not play nice with libwebkitgtk-1.0, it wants libwebkitgtk-3. At least on Ubuntu 64. Most probably, you do have both of them installed, but for some reason Eclipse picks version 1 instead of version 3.

Solution

Well, first solution is quite obvious - remove bloody libwebkitgtk-1.0. Easy shortcut to happy place without any crashes. However, there is a small issue with that approach. If you do have  package installed, then probably there is a reason and you would have to remove some other packages that depend on libwebkitgtk-1.0. In my case, Gimp was the cornerstone. It does not work with libwebkitgtk-3.Too bad.

Second solution is a bit more sophisticated. It is the reason why I like Ubuntu and at the same time reason for many jokes and criticisms from other OS users. If something does not work the way we want - let's recompile it :D

If you take a look at WebKit source, you will notice that webkitWebViewRegisterForIconNotification is called only #if ENABLE(ICONDATABASE). What?! I'm getting crashes because of some icons?! I hardly care if I have those icons in my main browser, not speaking about browser integrated in Eclipse or Gimp. Let's kill icons!

I will not describe in details how to recompile the package, there are lot's of materials on that topic. When you get WebKit source, search Debian configuration files for keys that disable icon database. Unfortunately, there is trick. Looks like disabling of icon database was not tested by developers. There are some places in code that do not have correct compile instructions and will complain about missing methods. I suppose if you got to that point, then surrounding some lines of code with compiler instructions is not a problem for you :)

If it sounds too scary for you, here is my version of package.

Now you just have to install it: 

dpkg --install libwebkitgtk-1.0-0_1.10.0-0ubuntu1.1_amd64.deb

There is one issue with my package. I did not change version. When you install it, synaptic will show that there is an update available. Next time when you will install a bunch of updates - it will be replaced with the one from repository. Best solution is to use "lock version" in synaptic or something similar, but if custom package version is the same as version in repository - it will not help. This means that you would have to check the list of updates that you update manager is going to install and make sure that WebKit will not be updated. Ugly, but works, as a temporary solution. If you will compile own package - don't make my mistake - change version.

13 comments:

  1. But isn't there a way of telling Eclipse to pick libwebkitgtk-3 instead?

    ReplyDelete
    Replies
    1. Hi, you can check this bug report https://bugs.eclipse.org/bugs/show_bug.cgi?id=392967. By the way, it says that bug is fixed already.

      Delete
  2. wow this work for me, thanks very much guy :)

    ReplyDelete
  3. Since Eclipse Kepler (4.3), you can tell SWT to load libwebkitgtk-3.0 by defining the SWT_GTK3 environment variable

    export SWT_GTK3=1

    This will eliminate most causes of crash that were experienced with 'libwebkitgtk-1.0' versions.

    In 4.3 SWT_GTK3 can take any value (only test is on existence). In 4.4 it is possible that the only meaningful value might be "1".

    ReplyDelete
  4. Great post . It takes me almost half an hour to read the whole post. Definitely this one of the informative and useful post to me. Thanks for the share and plz visit my site Programming 21st and century provide offshore outsourcing service, freelance service, personal assistant,web development, customer service, marketing services.






    ReplyDelete
  5. Great post . Will test it and update blogpost.
    SEO

    ReplyDelete

  6. Great. It is good to constantly coming up with creative ideas. Provides much needed knowledge. goal oriented blog posts and always tried to find creative ways to meet goals.

    Thanks
    Online affiliates

    ReplyDelete
  7. Hack Netflix account. now use Neflix account free for always.click to follow simple steps
    Guaranteed Success.
    Hack Netflix Account

    ReplyDelete
  8. SSbizconsulting offers project management services and IT consulting in Sydney. We help companies reach their organizational goals by providing comprehensive project management HR, Payroll and Workforce Management Systems. We have the best HR Payroll consultant in Australia that helps to implement or improve any key function of human resources.

    ReplyDelete
  9. This article interested me very much. You described it great.
    Industrial radial fans

    ReplyDelete
  10. MEGA88 Casino Resort New Mexico, New Mexico | Mapyro
    Find hotels and 포천 출장안마 motels near MEGA88 Casino Resort 양산 출장샵 in 제천 출장마사지 New Mexico. Trip.com uses cookies to improve 속초 출장마사지 your experience by 강원도 출장샵 visiting our website.

    ReplyDelete