Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 52431 - XInitThreads causes X printing to hang
XInitThreads causes X printing to hang
Product: Red Hat Linux
Classification: Retired
Component: XFree86 (Show other bugs)
i386 Linux
high Severity high
: ---
: ---
Assigned To: Mike A. Harris
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-08-23 14:14 EDT by Dave Thomson
Modified: 2005-10-31 17:00 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-08-23 14:14:20 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:14:16 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)

Description of problem:
On Linux RedHat 7.0 , if you call XInitThreads and link with
pthread, the first Xp call will hang.

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

How reproducible:

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

1) Compile the enclosed C code in a machine with XPrinting

2) Setup a X printing server by running the following as root:

	Xprt :1 &

3) Run the executable "test". It should print out "start" and then hang.

4) Comment the following line in the makefile

LIB_FLAGS += -lpthread

5) Recompile the testcase.

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

++++++++++++++++++++++++ makefile ++++++++++++++++++++++++++++++++
LIB_FLAGS = -L/usr/X11R6/lib -lXt -lX11 -lXp -lXext
OBJS = print_hang.o

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

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

++++++++++++++++++++++++ print_hang.c +++++++++++++++++++++++++++++
#include <X11/Intrinsic.h>

#define PRINTER_NAME ":1"

int main(int argc, char **argv) {
  XtAppContext xPrinterContext;
  Display *xPrinter;
  short major, minor;

  xPrinterContext = XtCreateApplicationContext();
  xPrinter = XtOpenDisplay(xPrinterContext, PRINTER_NAME, NULL, NULL,  
NULL, 0,  &argc, argv);
  if (xPrinter != NULL) {
    XpQueryVersion(xPrinter, &major, &minor);
    printf("XpExtension %d.%d\n", major, minor);
  } else {
    printf("Failed to open printer\n");


Additional info:
Comment 1 Mike A. Harris 2001-08-23 14:21:42 EDT
The Xprint extension is broken, and totally unsupported.

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