Bug 2832

Summary: Broken implementation of XIMStringConversionCallback in libX11.
Product: xorg Reporter: James Su <suzhe>
Component: Lib/XlibAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED INVALID QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: high CC: choe.hwanjin, eich, hramrach, ienup.sung, jeremyhu, mat, prabhat.hedge, roland.mainz
Version: 6.8.2Keywords: i18n, patch
Hardware: All   
OS: All   
Whiteboard: 2011BRB_Reviewed
i915 platform: i915 features:
Attachments:
Description Flags
fix string conversion implementation
none
implemetation for XIMValuesList
none
XIM string conversion implementation none

Description James Su 2005-03-26 21:06:21 UTC
Hi,
  Recently I'm investigating how to implement surrounding text support in SCIM
XIM server. I found that XIMStringConversionCallback API in XIM can be used to
do such job. But laterly I found that the implementation of this API in libX11
is broken.
  You may read the source file lib/X11/imCallbk.c line 285-365
_XimStrConversionCallback function. The implementation of this function is
completely broken, for example, it doesn't handle null pointer exceptions,
wide_char and multibyte string issue and doesn't do memory free, etc.

  I'll try to fix the implementation, but I'm not a X11 expert, so I'll very
apperciate if you can fix it or give me some hint on how to fix it.

ps. surrounding text support very important for some CTL languages.
Comment 1 Egbert Eich 2005-03-29 00:48:45 UTC
>  I'll try to fix the implementation, but I'm not a X11 expert, so I'll very
> apperciate if you can fix it or give me some hint on how to fix it.

I don't think anybody alive in X.Org today is a XIM expert and therefore hell
will freeze over before anybody will fix this.
Therefore if you want to see this fixed please submit a patch.
In my opinion XIM is a broken implementation of a broken design and should be
deprecated as there are more viable replacements for it today.
Comment 2 James Su 2005-03-29 04:20:43 UTC
But nowadays, XIM is still widely used, especially many legacy applications and
KDE/QT apps.

However, I'll try to fix this issue.
Comment 3 Egbert Eich 2005-03-29 08:42:43 UTC
You're welcome to fix this. 

I know too little about XIM to be able to judge, but maybe there is a way to
keep the XIM ABI with a different IM backend to support legacy apps in the future.
This is partly the goal of your work to interface to SCIM. But it is also to
goal of this work to keep XIM around to retain all its functionalities -
including the ABI for BE IM servers.
The question is if this stuff is still required of if the interface can be made
a lot 'thinner'.
We need to have a word with the KDE/Qt people about this issue. There may still
be a lot of unresolved issues with XIM and multithreading lingering in the
background which will be a major obstacle for KDE to make apps multi threaded.

Convincing maintianed toolkits that XIM is crap is easy. The hard part is what
to do about legacy apps.
Comment 4 Daniel Stone 2007-02-27 01:25:58 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 5 Stefan Dirsch 2007-11-04 09:05:15 UTC
Egbert, what should we do abou this? James, is this still an issue?
Comment 6 Stefan Dirsch 2008-11-22 13:25:55 UTC
No update on this one since more than 3 years. Closing as WONTFIX.
Comment 7 Choe Hwanjin 2008-11-22 15:22:20 UTC
I'd like to fix it. I've made a patch on libx11-1.1.5.
Please review my patch.
Comment 8 Choe Hwanjin 2008-11-22 15:23:25 UTC
Created attachment 20513 [details] [review]
fix string conversion implementation
Comment 9 Choe Hwanjin 2008-11-23 01:38:10 UTC
Before using string conversion feature, xim client should query XIMValuesList first.
But libx11 doesn't have any routine to deal with XIMValuesList.
I also made a patch for it.
Comment 10 Choe Hwanjin 2008-11-23 01:39:52 UTC
Created attachment 20519 [details] [review]
implemetation for XIMValuesList
Comment 11 Stefan Dirsch 2008-11-23 03:10:26 UTC
I'm afraid I'm not the right person to review these patches. :-(
Comment 12 Choe Hwanjin 2008-12-18 05:35:01 UTC
Created attachment 21275 [details] [review]
XIM string conversion implementation

XIM string conversion implementation patch.
Comment 13 Jeremy Huddleston Sequoia 2011-10-03 19:20:32 UTC
Choe, can you please send these patches to xorg-devel?  That will reach a wider 
audience in order to get a proper review of these changes.

Thanks.
Comment 14 Choe Hwanjin 2011-10-07 07:05:05 UTC
(In reply to comment #13)
> Choe, can you please send these patches to xorg-devel?  That will reach a wider 
> audience in order to get a proper review of these changes.
> 
> Thanks.

Ok, I will make new patches against recent git master HEAD,
and then send them to xorg-devel.
Comment 15 Adam Jackson 2018-06-12 19:06:48 UTC
Mass closure: This bug has been untouched for more than six years, and is not
obviously still valid. Please reopen this bug or file a new report if you continue to experience issues with current releases.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.