Bug 52435 - XInitThreads causes japanese input method to hang
Summary: XInitThreads causes japanese input method to hang
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: XFree86
Version: 6.2
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Mike A. Harris
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-08-23 18:36 UTC by Dave Thomson
Modified: 2007-04-18 16:36 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2001-08-23 18:36:55 UTC
Embargoed:


Attachments (Terms of Use)

Description Dave Thomson 2001-08-23 18:36:51 UTC
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:
Always

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 
testcase
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;

  XInitThreads();
  XtToolkitThreadInitialize();
  XtToolkitInitialize();

  xContext = XtCreateApplicationContext();
  XtSetLanguageProc(xContext, NULL, NULL);
  xDisplay = XtOpenDisplay(xContext, NULL, NULL, NULL,  NULL, 0,  &argc, 
argv);
  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,
		 NULL);

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

  /* Make sure the text uses a font list with a font set */
  fontListEntry = XmFontListEntryLoad(xDisplay, "*", XmFONT_IS_FONTSET, 
XmFONTLIST_DEFAULT_TAG);
  fontList = XmFontListAppendEntry(NULL, fontListEntry);
  XmFontListEntryFree(&fontListEntry);
  XtVaSetValues (text, XmNfontList, fontList, NULL);
    
  XtManageChild(text);
  XtManageChild(rowcol);
XtRealizeWidget(toplevel);
    
  XtAppMainLoop(xContext);
}

	

Additional info:

Comment 1 Mike A. Harris 2001-08-28 11:39:44 UTC
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


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