星期一 十月 20, 2008

At first, install scim and your favorite input-method engines from pkg.opensolaris.org, you could list the available scim packages, by $ pkg list -a SUNWscim*. For nevada users, you need select the scim metacluster in installer.

Then, edit your $HOME/.profile to export the GTK_IM_MODULE to scim, and re-login

$ cat >> ~/.profile << EOF
> GTK_IM_MODULE=scim
> export GTK_IM_MODULE
> EOF

To switch back to iiim, you could simply comment out the above lines in your $HOME/.profile, and re-login.

星期五 九月 05, 2008

Just enjoy it :)

pkg:/SUNWscim-anthy@1.2.4,5.11-0.96:20080825T192330Z Info Manifest
pkg:/SUNWscim-chewing@0.3.1,5.11-0.96:20080825T192330Z Info Manifest
pkg:/SUNWscim-hangul@0.3.2,5.11-0.96:20080825T192331Z Info Manifest
pkg:/SUNWscim-pinyin@0.5.91,5.11-0.96:20080825T192331Z Info Manifest
pkg:/SUNWscim-sunpinyin@1.0,5.11-0.96:20080825T192335Z Info Manifest
pkg:/SUNWscim-tables-chinese@0.5.7,5.11-0.96:20080825T192355Z Info Manifest
pkg:/SUNWscim-tables-extra@0.5.7,5.11-0.96:20080825T192401Z Info Manifest
pkg:/SUNWscim-tables-india@0.5.7,5.11-0.96:20080825T192401Z Info Manifest
pkg:/SUNWscim-tables-japanese@0.5.7,5.11-0.96:20080825T192401Z Info Manifest
pkg:/SUNWscim-tables-korean@0.5.7,5.11-0.96:20080825T192402Z Info Manifest
pkg:/SUNWscim-tables@0.5.7,5.11-0.96:20080825T192354Z Info Manifest
pkg:/SUNWscim-thai@0.1.0,5.11-0.96:20080825T192402Z Info Manifest
pkg:/SUNWscim@1.4.7,5.11-0.96:20080825T192322Z Info Manifest

Our next plan is to integrate libm17n and scim-m17n. Stay tuned.

星期二 八月 12, 2008

In many application systems, shared objects are loaded as sub-modules via dlopen(3C). In case it's written by C++, you need to be careful about throwing exceptions. The client may try unload this module (by dlclose(3C)) in exception handling block, so that the application may crash when C++ runtime routines try to clean the exception (by calling its destructor) before leaving current catching function. In practice, exception class is usually defined in header file, so that its code body maybe included both in app and sub-module. Even in this case, linker or loader may choose the copy in sub-module. (E.g., the -Bdirect flag of ld(1)).

The conclusion is, do not unload a shared object when catching an exception thrown from it, or not to throw exceptions from a shared object. This is the root cause that SCIM x11 frontend would crash for the 2nd launching.

星期三 九月 26, 2007

Kov Chai is poring SunPinyin ime to SCIM platform, and made impressive progress just after 1 week. Here is his blog entry about this.


星期三 六月 20, 2007

When I build the scim-1.4.6 packages on Solaris Nevada build 66 with SunStudio 12 (or 11) and CBE 1.6. I found gtk-query-immodules-2.0 would core after loading im-scim.so. In dbx, it reports "no mapping at the fault address", as following:

signal SEGV (no mapping at the fault address) in __rwstd::__rb_tree<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::pair<const std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,__rwstd::__select1st<std::pair<const std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<const std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > >::begin at line 741 in file "tree"

It's really a nightmare to tell what's wrong from the error message :( I thought it's a STL problem at the beginning.

It took me 1 day to find the real reason, which is fairly simple: the static object instance initializations are not in proper order.

In im-scim.so, there is a static object instance, and it calls a global function in libscim-1.0.so, in that global function, it accesses another static object instance which is not initialized yet. I wrote a small test program, it just uses dlopen() to load im-scim.so. From the debugger, I could see, the static constructor in im-scim.so is called before the static constructor in libscim-1.0.so. Therefore, the test program cores. I don't know if it is a bug of libCrun or ld.so?

I also asked this question in SunStudio C++ forum as well as [osol-tools-linking]. Here is an workaround patch, please note, it leaves an un-finalized heap object,  __config_repository, so your configuration may not be saved.

P.S., when I am using snv_62, the shared objects works fine, but failed on snv_66.

This blog copyright 2009 by yongsun