Opened 10 years ago

Closed 10 years ago

#12172 closed defect (fixed)

R doctest starts X11 on OSX

Reported by: vbraun Owned by: mvngu
Priority: major Milestone: sage-5.0
Component: doctest coverage Keywords: R r-project graphics OSX X11
Cc: kcrisman, jason, jhpalmieri Merged in: sage-5.0.beta2
Authors: John Palmieri Reviewers: Karl-Dieter Crisman
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by jhpalmieri)

John Palmeri reports that, with the R package from #12057, this doctest is problematic (line 352):

    sage: s = r.eval('capabilities("png")') # Should be on Linux and Solaris

On his Mac OS X 10.6.8 box, doctesting this starts up the X server but does not display any actual graphics. This is new: it didn't do this in Sage 4.8.alpha3.

This does not happen on all OSX machines. The intented R configuration on OSX is without X11 support, and only Aqua capabilities.

It might be a bug or misconfiguration in the X installation that it opens up even though nobody is draw a window.

This can be avoided by unsetting DISPLAY in the R session, but then R does no longer report png output capabilities:

> Sys.unsetenv("DISPLAY") 
> capabilities("png")
  png 
FALSE 
> capabilities("aqua")
aqua 
TRUE 

Its unclear whether that would really be an issue in Sage.

Somebody with a Mac might want to trace where exactly R starts up the X server. The equivalent of strace on Linux seems to be http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/dtruss.1m.html

sage -sh
dtruss -f R

New spkg: http://sage.math.washington.edu/home/palmieri/SPKG/r-2.14.0.p2.spkg

Attachments (1)

trac_12172-r-spkg.patch (4.2 KB) - added by jhpalmieri 10 years ago.
for review only

Download all attachments as: .zip

Change History (16)

comment:1 Changed 10 years ago by vbraun

  • Cc kcrisman jason jhpalmeri added
  • Status changed from new to needs_info

comment:2 Changed 10 years ago by jhpalmieri

  • Cc jhpalmieri added; jhpalmeri removed

comment:3 follow-up: Changed 10 years ago by jhpalmieri

When I run "dtruss -f R", it exits immediately — it doesn't enter an interactive mode where I can give it commands.

Meanwhile, we could unconditionally disable X11 on Darwin in spkg-install. I can produce a new spkg if people think this is a reasonable solution.

comment:4 in reply to: ↑ 3 Changed 10 years ago by kcrisman

Meanwhile, we could unconditionally disable X11 on Darwin in spkg-install. I can produce a new spkg if people think this is a reasonable solution.

Yes, we should only need Aqua on Darwin for R graphics. We'd need to test this on a few systems - in particular yours! - but I don't see why this should cause trouble.

comment:5 Changed 10 years ago by jhpalmieri

  • Authors set to John Palmieri
  • Status changed from needs_info to needs_review

New spkg up, and I've also posted the patch applied to the spkg (for review purposes).

comment:6 Changed 10 years ago by jhpalmieri

  • Description modified (diff)

comment:7 Changed 10 years ago by jason

Just to be clear; the R package *can* still pop up a window with graphics, right? It'd just be an "aqua" window, rather than an X window, right?

comment:8 Changed 10 years ago by jhpalmieri

If you can tell me commands to pop open a window with graphics, I'll try it out on my OS X box with this new spkg. (It should work in theory, using "aqua" as you say.)

comment:9 Changed 10 years ago by jason

do sage -R, and then type demo(graphics). Hit return a bunch of times and a window should pop up with a bunch of graphics that cycle through it in the demo. Thanks.

comment:10 Changed 10 years ago by jhpalmieri

Yup, it works (for me, anyway).

comment:11 Changed 10 years ago by jdemeyer

  • Status changed from needs_review to needs_work

Please rebase to #12131...

comment:12 Changed 10 years ago by jhpalmieri

  • Description modified (diff)
  • Status changed from needs_work to needs_review

Okay, rebased spkg is up, and I've also updated the patch.

Changed 10 years ago by jhpalmieri

for review only

comment:13 Changed 10 years ago by kcrisman

  • Reviewers set to Karl-Dieter Crisman

The patch looks ok, modulo my usual having to look up shell syntax. (Trifle annoying that someone forgot to update the version number in the GPL listing, but I'm not going to mess with that since it wasn't done on the upgrade.)

The problem is that I can't test whether it fixes the problem, really. With Sage 4.8:

$./sage -t devel/sage/sage/interfaces/r.py 
sage -t  "devel/sage/sage/interfaces/r.py"                  
	 [9.7 s]
 
----------------------------------------------------------------------
All tests passed!
Total time for all tests: 9.7 seconds

Even though I have the offending file!

$ ls /usr/include/X11/
CallbackI.h	IntrinsicP.h	VarargsI.h	Xfuncproto.h	Xthreads.h
Composite.h	Object.h	Vendor.h	Xfuncs.h	Xtos.h
CompositeP.h	ObjectP.h	VendorP.h	Xlib.h		Xtrans
ConstrainP.h	PM		X.h		XlibConf.h	Xutil.h
Constraint.h	PassivGraI.h	X10.h		Xlibint.h	Xw32defs.h
ConvertI.h	RectObj.h	XF86keysym.h	Xlocale.h	Xwindows.h
Core.h		RectObjP.h	XKBlib.h	Xmd.h		Xwinsock.h
CoreP.h		ResConfigP.h	XWDFile.h	Xmu		ap_keysym.h
CreateI.h	ResourceI.h	Xalloca.h	Xos.h		bitmaps
DECkeysym.h	SM		Xarch.h		Xos_r.h		cursorfont.h
EventI.h	SelectionI.h	Xatom.h		Xosdefs.h	dri
HPkeysym.h	Shell.h		Xauth.h		Xpoll.h		extensions
HookObjI.h	ShellI.h	Xaw		XprintAppUtil	fonts
ICE		ShellP.h	Xcms.h		XprintUtil	keysym.h
ImUtil.h	StringDefs.h	Xcursor		Xproto.h	keysymdef.h
InitialI.h	Sunkeysym.h	Xdefs.h		Xprotostr.h	xpm.h
Intrinsic.h	ThreadsI.h	Xdmcp.h		Xregion.h
IntrinsicI.h	TranslateI.h	Xft		Xresource.h

So the best I can do is to say that it doesn't seem to break anything... Well, I'm going to see if I can break graphics by changing to this spkg. I'll report back momentarily.

comment:14 Changed 10 years ago by kcrisman

  • Status changed from needs_review to positive_review

Okay, graphics still work fine, as far as I can tell, in all places they should. We should have disabled this anyway, and I don't know why we didn't figure out that the logic for disabling on Darwin was incorrect. I'm going to give this positive review.

comment:15 Changed 10 years ago by jdemeyer

  • Merged in set to sage-5.0.beta2
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.