hari@matrix.UUCP (T hariharan) (04/25/91)
There seems to be a bug in xv_init() which causes your program to crash.
The following minimal progam (see below) crashes if the following conditions
are satisfied:
1. The X server should NOT be running on the machine where you run the
program
2. You should NOT have the environment variable DISPLAY defined, and
you should NOT use the -diplay command line option
All you have to do is log into a machine's console and run the program
wihtout starting X. You can also rlogin into a machine where the X server
is not running.
If the X server IS running, the program does not crash, even if DISPLAY
is not defined and -display is not used on the command line.
Also, if the X server is NOT running, and DISPLAY is defined, you get
an error message (can't connect to server xxx) instead of a crash.
We would like to let xv_init() establish the connection with the server
without having to use XOpenDisplay() ourselves, and of course, not have
the program crash in the above case.
Any ideas for a workaround for this bug ?
Has anyone seen this bug before (I would expect someone to have) ?
Please email your responses to me. I'll summarize.
Thanks,
Hari
uunet!matrix!hari
Matrix Computer Systems, Inc.
1 Tara Boulevard
Nashua NH 03062
(603) 888 7790
========================================================================
Command to compile program:
cc -g -I/usr/openwin/include -L/usr/openwin/lib -o bug bug.c -lxview -lX
If you have openwin installed somewhere other than /usr/openwin, please
substitute your openwin directory for /usr/openwin.
Also, you may have to use "-lX11" instead of "-lX" above if libX.a is not
a link to libX11.a on your system.
========================================================================
Program:
/* Save from here to end in bug.c */
#include <stdio.h>
#include <sys/param.h>
#include <sys/types.h>
#include <xview/xview.h>
void
main(argc, argv)
int argc;
char **argv;
{
/*
* Initialize XView.
*/
xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, 0);
exit(0);
}