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: Always Steps to Reproduce: Here are the steps to reproduce it: 1) Compile the enclosed C code in a machine with XPrinting installed. 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; printf("start\n"); XInitThreads(); XtToolkitThreadInitialize(); XtToolkitInitialize(); 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"); } XtDestroyApplicationContext(xPrinterContext); printf("end\n"); } Additional info:
The Xprint extension is broken, and totally unsupported.