[Rd] Crash when embedding R X11 windows

From: Thomas Friedrichsmeier <thomas.friedrichsmeier_at_ruhr-uni-bochum.de>
Date: Tue 07 Nov 2006 - 14:26:52 GMT

Dear R developers,

I've been experimenting with embedding R X11 windows into another application using KDE's QXEmbed on linux. Attempting to do so will crash R (with R 2.4.0, trunk, and I know the bug has been around in prior versions). I used to think this was related to bug #848, but I'm not sure, if / how the solution suggested there still applies to current versions of R.

After debugging, I came up with the following patch (in src/modules/X11):

Index: devX11.c

I'll have to admit, that I'm mostly clueless as far as X11-programming is concerned, so the patch may not be entirely correct. It does fix the crash, however, and should be along the right lines. The rationale is, that apparently calls to XFindContext() may fail in the context of embedding the X11 window. The patch simply checks the return value of XFindContext() for a non-zero (i.e. error) value, and in that case drops out of the function.

Does this seem like a valid fix? Should I provide more info?

Thomas Friedrichsmeier

R-devel@r-project.org mailing list
Received on Wed Nov 08 01:34:56 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 30 Nov 2006 - 03:30:56 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.