Re: [Rd] (PR#10379) Re: x11(....) kills R without DISPLAY

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Mon, 29 Oct 2007 20:12:44 +0100

Hin-Tak Leung wrote:
> Peter Dalgaard wrote:
> <snipped>
>> You need x11() with a valid display to trigger the bug:
>>
>> [pd_at_titmouse2 BUILD]$ ssh -Y 192.168.1.10
>> pd_at_192.168.1.10's password:
>> Last login: Sat Oct 27 02:40:16 2007 from 192.168.1.11
>> [pd_at_janus ~]$ echo $DISPLAY
>> localhost:10.0
>> [pd_at_janus ~]$ DISPLAY= R -q
>> > x11("localhost:10.0")
>> Error: Couldn't find per display information
>> [pd_at_janus ~]$ uname -a
>> Linux janus 2.6.22.9-91.fc7 #1 SMP Thu Sep 27 20:47:39 EDT 2007
>> x86_64 x86_64 x86_64 GNU/Linux
>> [pd_at_janus ~]$ cat /etc/issue
>> Fedora release 7 (Moonshine)
>> Kernel \r on an \m
>
> Agh, sorry. Yes, x11() (with or without $DISPLAY set) doesn't
> die catatrophically, x11("validinfo") does.
>
> HTL
The culprit would seem to be this bit of devX11.c

1302                    xtdpy = XtOpenDisplay(app_con, NULL, "r_x11", 
"R_x11",
1303                                          NULL, 0, &zero, NULL);
1304                    toplevel = XtAppCreateShell(NULL, "R_x11",

The 2nd arg to XtOpenDisplay is listed as display_string, so passing a NULL here seems like trouble when the default ways of finding the display do not work.

Looks like a fix is to insert p instead of NULL. (Tested rudimentarily.)

-- 
   O__  ---- Peter Dalgaard             Ĝster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard_at_biostat.ku.dk)                  FAX: (+45) 35327907

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Mon 29 Oct 2007 - 19:36:52 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 30 Oct 2007 - 03:46:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.