Bug 52435 - XInitThreads causes japanese input method to hang
XInitThreads causes japanese input method to hang
Product: Red Hat Linux
Classification: Retired
Component: XFree86 (Show other bugs)
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Mike A. Harris
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-08-23 14:36 EDT by Dave Thomson
Modified: 2007-04-18 12:36 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-08-23 14:36:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Dave Thomson 2001-08-23 14:36:51 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)

Description of problem:
On Linux RedHat 6.2 (2.2.14-5.0) Japanese, if you call XInitThreads and 
link with pthread, the program will hang when the input method is started.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Here are the steps to reproduce it:

1) Compile the attached C code. The Motif home needs to be
updated in the makefile. The testcase will fail when compiled
against Open Motif from Metrolink (openmotif-2_1_30-4_MLI_i386.rpm).
However, we believe the problem is in the Japanese Input Method which is 
part of the base X support.

2) Run the executable "test" in a japanese machine

3) When the window open, give focus to the text field

4) Start the japanese input method by pressing <Shift+Space>

5) Type some characters and press <Enter>.	 At this point, the 
will hang.

5) Comment the following line in the makefile

LIB_FLAGS += -lpthread

6) Recompile the tescase.

7) Run it again. It should not hang this time.

+++++++++++++++++++++++++ makefile ++++++++++++++++++++++++++++++++++++
MOTIF_HOME = /bluebird/teamswt/swt-builddir/motif21
CFLAGS = -I$(MOTIF_HOME)/include
LIB_FLAGS = -L/usr/X11R6/lib -L$(MOTIF_HOME)/lib -lXm -lXt -lX11
OBJS = ime_hang.o

# Comment this line and the test will not hang
#LIB_FLAGS += -lpthread

all: $(OBJS)
	cc -o test $(OBJS) $(LIB_FLAGS)

+++++++++++++++++++++++++ ime_hang.c ++++++++++++++++++++++++++++++++++++
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/IntrinsicP.h>
#include <X11/Intrinsic.h>
#include <Xm/XmAll.h>
#include <stdio.h>

main(int argc, char **argv)
  Widget toplevel, rowcol, text;
  XtAppContext xContext;
  Display *xDisplay;
  XmFontList fontList;
  XmFontListEntry fontListEntry;


  xContext = XtCreateApplicationContext();
  XtSetLanguageProc(xContext, NULL, NULL);
  xDisplay = XtOpenDisplay(xContext, NULL, NULL, NULL,  NULL, 0,  &argc, 
  toplevel = XtAppCreateShell(NULL, NULL, topLevelShellWidgetClass, 
xDisplay, NULL, 0);   

  rowcol = XtVaCreateWidget("rowcol", 
		 xmRowColumnWidgetClass, toplevel,
		 XmNpacking,             XmPACK_COLUMN,
		 XmNnumColumns,          10,
		 XmNorientation,         XmHORIZONTAL,
		 XmNentryAlignment,      XmALIGNMENT_END,
		 XmNisAligned,           True,

  text = XtVaCreateWidget( "text", xmTextWidgetClass,  rowcol, NULL);

  /* Make sure the text uses a font list with a font set */
  fontListEntry = XmFontListEntryLoad(xDisplay, "*", XmFONT_IS_FONTSET, 
  fontList = XmFontListAppendEntry(NULL, fontListEntry);
  XtVaSetValues (text, XmNfontList, fontList, NULL);


Additional info:
Comment 1 Mike A. Harris 2001-08-28 07:39:44 EDT
Please report this bug upstream to XFree86 developers, as it requires
a lot more expertise with the specific area of code.  I recommend first
trying a newer release of XFree86.

You can report upstream by emailing a bug report to: xfree86@xfree86.org

Note You need to log in before you can comment on or make changes to this bug.