Bug 25139 - UIM causes Firefox to crash
Summary: UIM causes Firefox to crash
Status: RESOLVED FIXED
Alias: None
Product: UIM
Classification: Unclassified
Component: bridge: GTK+ (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium major
Assignee: uim-bugs
QA Contact:
URL: http://crash-stats.mozilla.com/report...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-17 00:28 UTC by Dave M G
Modified: 2009-11-25 19:05 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch for 1.5.6 (870 bytes, patch)
2009-11-19 02:12 UTC, Etsushi Kato
Details | Splinter Review
Revised patch for 1.5.6 (842 bytes, patch)
2009-11-21 08:00 UTC, Etsushi Kato
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Dave M G 2009-11-17 00:28:26 UTC
(Please note that I guessed at the component, as suggested)

I do not fully understand the stack trace in the URL, however, the Firefox developers are convinced that UIM is responsible for causing Firefox to routinely crash on my system.

I got to this point because Firefox would crash within minutes every time I ran it. There was no predictor of exactly when and why it would crash, but it would definitely crash if given enough time, which wasn't very long.

So I first reported it to the Ubuntu developers, who suggested that I take it to the Firefox developers. They asked me to run some stack trace bug reports, like the one linked to, and they were absolutely convinced that the stack traces showed clearly that UIM caused the crash. (Specifically im-uim.so)

I had my doubts, but I have tried temporarily removing UIM from my system, and so far Firefox is now running okay again.

Please note that when Firefox crashes, it is not when I actually enter any text, or interact with UIM in any way that I know of. It seems that the mere presence of UIM on my system causes Firefox to be unstable.

I hope this bug can get resolved, because I much prefer to use UIM for inputting Japanese than other systems on Ubuntu.

Thank you, and I hope to hear from you soon.
Comment 1 Muneyuki Noguchi 2009-11-17 05:09:54 UTC
There is also a bug report on this issue in the GNOME Bugzilla.

https://bugzilla.gnome.org/show_bug.cgi?id=597372
Comment 2 Dave M G 2009-11-17 06:55:11 UTC
(In reply to comment #1)

In the Gnome bug report you link to, it says:
"Reverting this commit causes firefox to function correctly. Verified with
gtk+-2.18.0 and 2.18.3."

I don't understand the terminology, but is "reverting" the "commit" something I can do on my system to prevent the bug from happening, or is it something that needs to be fixed in the code?
Comment 3 Etsushi Kato 2009-11-17 08:37:00 UTC
For a workaround, please install nspluginwrapper.  It will prevent flashplayer from crashing even with uim's gtk+ imput method module.

As I don't have enough time to hack these days, the real fix will take some time, perhaps.
Comment 4 Etsushi Kato 2009-11-17 09:24:05 UTC
For additional note, another workaround for the Firefox problem is to set IM_UIM_USE_SNOOPER 1 and IM_UIM_USE_TOPLEVEL 0 in gtk/gtk-im-uim.h and compile im-uim.so.
Comment 5 Dave M G 2009-11-17 14:11:32 UTC
(In reply to comment #4)

Unfortunately, installing nspluginwrapper does not seem to solve the problem for me.

I don't know how to compile im-uim.so, so I guess that means I will have to wait for a fix, however long that turns out to be.
Comment 6 Etsushi Kato 2009-11-17 15:18:42 UTC
(In reply to comment #5)
> Unfortunately, installing nspluginwrapper does not seem to solve the problem
> for me.

Oh, really.  I'll install ubuntu and check later.


> I don't know how to compile im-uim.so, so I guess that means I will have to
> wait for a fix, however long that turns out to be.

It's really easy.

$ tar zxvf uim-1.5.6.tar.gz
$ cd uim-1.5.6
$ ./configure --prefix=/usr  # assume you've already installed libtool and libgtk2.0-dev
$ gedit gtk/gtk-im-uim.h # edit line 54 and 55 in that file
$ make
$ cd gtk
$ sudo make install

That's it!
Comment 7 Etsushi Kato 2009-11-17 15:22:22 UTC
(In reply to comment #6)
> It's really easy.
> 
> $ tar zxvf uim-1.5.6.tar.gz
> $ cd uim-1.5.6
> $ ./configure --prefix=/usr  # assume you've already installed libtool and
> libgtk2.0-dev

Oops, intltool not libtool.

> $ gedit gtk/gtk-im-uim.h # edit line 54 and 55 in that file
> $ make
> $ cd gtk
> $ sudo make install
> 
> That's it!
Comment 8 Dave M G 2009-11-17 15:38:05 UTC
(In reply to comment #7)

Your instructions were as easy as promised.

I edited gtk/gtk-im-uim.h so that it had these lines:


/* select either of these two, or filter key event will be used */
define IM_UIM_USE_SNOOPER      1
define IM_UIM_USE_TOPLEVEL     0



I ran the build, make, and install instructions without any errors. I rebooted my machine afterward to make sure I was running the newly compiled UIM.

Unfortunately, it seems that has not solved the problem. Firefox still crashes.
Comment 9 Etsushi Kato 2009-11-17 16:09:17 UTC
(In reply to comment #8)
> 
> I ran the build, make, and install instructions without any errors. I rebooted
> my machine afterward to make sure I was running the newly compiled UIM.
> 
> Unfortunately, it seems that has not solved the problem. Firefox still crashes.


Hmm, that's interesting.

Anyway, about the nspluginwrapper workaround, I found you need to setup nspluginwrapper manually after installing it on Ubuntu.

$ sudo nspluginwrapper -i /usr/lib/flashplugin-installer/libflashplayer.so

I think you can see npwrapper.libflashplayer.so is used after restarting Firefox (by inputting "about:plugins" in the URL box).  Please let me know if it solves the crashes.

Comment 10 Dave M G 2009-11-17 18:53:37 UTC
(In reply to comment #9)

Thanks for helping to solve this bug.

I ran the following command:

sudo nspluginwrapper -i /usr/lib/flashplugin-installer/libflashplayer.so

And it returned without errors.

However, I don't know if it installed, because if I look at "about:plugins", I can't find any listing for npwrapper.libflashplayer.so, or any mention of npwrapper at all.

Firefox continues to crash.
Comment 11 Etsushi Kato 2009-11-17 19:58:36 UTC
(In reply to comment #10)

> I ran the following command:
> 
> sudo nspluginwrapper -i /usr/lib/flashplugin-installer/libflashplayer.so
> 
> And it returned without errors.
> 
> However, I don't know if it installed, because if I look at "about:plugins", I
> can't find any listing for npwrapper.libflashplayer.so, or any mention of
> npwrapper at all.

OK.  On Ubuntu, it seems another two additional operation is needed to activate the npwrapper for flashplugin (I'm new to Ubuntu/Debian, so I'm not sure this is a proper way though).

$ sudo nspluginwrapper -i /usr/lib/flashplugin-installer/libflashplayer.so
$ cd /usr/lib/xulrunner-addons/plugins
$ sudo rm flashplugin-alternative.so
$ cd /usr/share/ubufox/plugins
$ sudo rm libflashplayer.so

Then restart Firefox and check whether wrapper is working.

I tested Ubuntu 9.10 on VMWare, and both of my two workaround seems to prevent Firefox crashing.
Comment 12 Dave M G 2009-11-18 07:48:45 UTC
(In reply to comment #11)
I ran the following commands, which returned no errors:

> $ sudo nspluginwrapper -i /usr/lib/flashplugin-installer/libflashplayer.so
> $ cd /usr/lib/xulrunner-addons/plugins
> $ sudo rm flashplugin-alternative.so
> $ cd /usr/share/ubufox/plugins
> $ sudo rm libflashplayer.so

I restarted Firefox and ensured that the change took place by finding nspluginwrapper was listed in "about:plugins".

However, there is a problem.

The good news: Firefox seems to be more stable, and has not crashed since running the above commands.

The bad news: Videos no longer play in Firefox. If I go to Youtube, or any site with embedded video, the space where the video should be is completely black, and there is no sound, and no controls. The video is completely dead.

Comment 13 Etsushi Kato 2009-11-18 08:55:00 UTC
(In reply to comment #12)

> The bad news: Videos no longer play in Firefox. If I go to Youtube, or any site
> with embedded video, the space where the video should be is completely black,
> and there is no sound, and no controls. The video is completely dead.

Hmm, that's too bad.  I recommend to revert the situation.

$ sudo apt-get remove nspluginwrapper
$ sudo apt-get remove flashplugin-installer
$ sudo apt-get install flashplugin-installer


I think either of my two workaround should work as far as I can say. But YMMV.
Good luck!
Comment 14 Dave M G 2009-11-18 09:12:49 UTC
(In reply to comment #13)
> (In reply to comment #12)

> Hmm, that's too bad.  I recommend to revert the situation.
> $ sudo apt-get remove nspluginwrapper
> $ sudo apt-get remove flashplugin-installer
> $ sudo apt-get install flashplugin-installer

Well, I reverted the situation as described above.

Now video plays, but Firefox crashes.

Is there no way to get video and stable Firefox if I have UIM installed...?
Comment 15 Etsushi Kato 2009-11-18 18:09:41 UTC
(In reply to comment #14)
> Well, I reverted the situation as described above.
> 
> Now video plays, but Firefox crashes.
> 
> Is there no way to get video and stable Firefox if I have UIM installed...?

As I noted above, there are two workaround approaches.  Both of them works for me on Ubuntu 9.10 i386.

1) Use modified im-uim.so, which uses IM_UIM_USE_SNOOPER instead of IM_UIM_USE_TOPLEVEL.  Please make sure /usr/lib/gtk-2.0/2.10.0/immodules/im-uim.so is installed properly.


2) Use original im-uim.so with nspluginwrapper.  I'm not sure how to setup properly on Ubuntu.  Please consult Ubuntu expert.


Comment 16 Dave M G 2009-11-18 23:12:26 UTC
(In reply to comment #15)
> (In reply to comment #14)

I am going to try to use a modified im-uim.so file again.

Do I have to uninstall a particular UIM package using apt-get before using the "make install" command, or will "make install" overwrite any existing installation?
Comment 17 Etsushi Kato 2009-11-19 02:12:55 UTC
Created attachment 31304 [details] [review]
patch for 1.5.6
Comment 18 Etsushi Kato 2009-11-19 02:15:03 UTC
(In reply to comment #16)
> I am going to try to use a modified im-uim.so file again.
> 
> Do I have to uninstall a particular UIM package using apt-get before using the
> "make install" command, or will "make install" overwrite any existing
> installation?

Please make sure to do "make install" in the uim-1.5.6/gtk directory.  You don't have to remove any component of uim package from Ubuntu, I think.  One caveat is that don't do "make install" on the toplevel uim-1.5.6/ directory.  It may break some components of uim which was provided by Ubuntu.

Also I've finally conducted the real fix for the bug.  I think it is preferable to use the patch instead of modifying gtk-im-uim.h.  Please use the attached patch.

The change is already committed in the repository.
Comment 19 Dave M G 2009-11-19 02:35:05 UTC
(In reply to comment #18)
> (In reply to comment #16)

> The change is already committed in the repository.

If it's going to be available in the repository, I will wait until it becomes available (I just checked but no update was registered for UIM ). I'm assuming it takes time for repository changes to propegate.

I just feel it's safer to stick with repository versions instead of my amateur manhandling of source files.

When I've verified the update, I will report back if it seems to have fixed the problem.
Comment 20 Etsushi Kato 2009-11-21 07:59:28 UTC
Please use a revised patch as old one causes another problem (see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=557341).  And uim 1.5.7 will use new patch.

Sorry for the inconvenience, and thanks for all who reported the problem.
Comment 21 Etsushi Kato 2009-11-21 08:00:21 UTC
Created attachment 31369 [details] [review]
Revised patch for 1.5.6
Comment 22 Dave M G 2009-11-25 19:05:51 UTC
(In reply to comment #21)

Fix confirmed!!

I was able to download the new UIM fix through a PPA repository offered by an Ubuntu developer, and I have been torture testing Firefox for the last hour or so. There was one freeze (probably because of the web site), but no crashes.

I ran Firefox from the command line, and there was no output whatsoever indicating any errors, which is completely different than what I was experiencing before.

I am confident enough in Firefox's performance now to say that for me the bug seems to be fixed, and Firefox is no longer unstable.

Thank you to everyone who helped to diagnose and fix the problem. Your hard work is much appreciated.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.