[Rd] R-2.12.0 hangs while loading RGtk2 on FreeBSD

Rainer Hurling rhurlin at gwdg.de
Sat Oct 23 11:49:44 CEST 2010


On 22.10.2010 22:10 (UTC+1), Rainer Hurling wrote:
> On 22.10.2010 16:18 (UTC+2), Rainer Hurling wrote:
>> On 22.10.2010 14:57 (UTC+1), Michael Lawrence wrote:
>>>
>>>
>>> On Thu, Oct 21, 2010 at 9:42 AM, Rainer Hurling <rhurlin at gwdg.de
>>> <mailto:rhurlin at gwdg.de>> wrote:
>>>
>>> [moved from R-help]
>>>
>>> On 21.10.2010 18:09 (UTC+1), Prof Brian Ripley wrote:
>>>
>>> If you do R CMD INSTALL --no-test-load this will skip the part
>>> that is
>>> hanging and you can try loading in stages (e.g. dyn.load on the
>>> RGtk2.so).
>>>
>>>
>>> With '--no-test-load' it installs and ends normal. Loading per
>>> dyn.load("RGtk2.so") works, just as dyn.load("RGtk2.so",F) and
>>> dyn.load("RGtk2.so",,F). Unloading works, too.
>>>
>>> Normal loading over library(RGtk2) within R does not work. R than is
>>> hanging.
>>>
>>> It seems the problem is not with the library itself?
>>>
>>>
>>> It looks like something is happening when initializing GTK+ and the
>>> event loop. This happens in the function R_gtkInit in Rgtk.c. If you
>>> could run R -d gdb and break on that function, perhaps you could step
>>> through until it hangs.
>>
>> Michael, thank you for answering. As I wrote earlier (on R-help@),
>> unfortunately I have no experience with debugging (I am not a
>> programmer). So I would need some more assistence.
>>
>> Is there a difference between 'library(RGtk2)' and 'dyn.load(RGtk2)' in
>> initializing GTK+? I am able to dyn.load, but library does not work.
>>
>> After starting with 'R -d gdb' is the following right?
>>
>> (gdb) break R_gtkInit
>> Function "R_gtkInit" not defined.
>> Make breakpoint pending on future shared library load? (y or [n]) y
>> Breakpoint 1 (R_gtkInit) pending.
>>
>> When I try to proceed, it gives me the following message
>>
>> (gdb) run
>> Starting program: /usr/local/lib/R/bin/exec/R
>> /libexec/ld-elf.so.1: Shared object "libRblas.so" not found,
>> required by "R"
>> Program exited with code 01.
>
> Ok, I am one step further now:
>
>
> (gdb) run
> Starting program: /usr/local/lib/R/bin/exec/R
> [..SNIP..]
>  > library(RGtk2)
> [New LWP 100174]
> Breakpoint 2 at 0x318bd490: file Rgtk.c, line 104.
> Pending breakpoint "R_gtkInit" resolved
> [New Thread 2f408b00 (LWP 100174)]
> [Switching to Thread 2f408b00 (LWP 100174)]
>
> Breakpoint 2, R_gtkInit (rargc=0x30b11d10, rargv=0x30a98458,
> success=0x30afbad0) at Rgtk.c:104
> 104 Rgtk.c: No such file or directory.
> in Rgtk.c
> (gdb)
>
>
> What do you suggest I should do next?

Rgtk.c was not found from gdb because RGtk2 was not build with DEBUG=T 
and R_KEEP_PKG_SOURCE=yes.

So this is the next try. I can trace the code until it hangs:


library(RGtk2)
[New LWP 100250]
Breakpoint 2 at 0x458bd490: file Rgtk.c, line 104.
Pending breakpoint "R_gtkInit" resolved
[New Thread 4322ef00 (LWP 100250)]
[Switching to Thread 4322ef00 (LWP 100250)]

Breakpoint 2, R_gtkInit (rargc=0x446d0980, rargv=0x44698618, 
success=0x446d09e0) at Rgtk.c:104
104     {
(gdb) n
107       argc = (int) *rargc;
(gdb) n
104     {
(gdb) n
107       argc = (int) *rargc;
(gdb) n
109       if (!gdk_display_get_default()) {
(gdb) n
110         gtk_disable_setlocale();
(gdb) n
111         if (!gtk_init_check(&argc, &rargv)) {
(gdb) n
121         if (!GDK_DISPLAY()) {
(gdb) n
127         addInputHandler(R_InputHandlers, 
ConnectionNumber(GDK_DISPLAY()),
(gdb) n
132         if (!pipe(fds)) {
(gdb) n
133           ifd = fds[0];
(gdb) n
134           ofd = fds[1];
(gdb) n
135           addInputHandler(R_InputHandlers, ifd, 
R_gtk_timerInputHandler, 32);
(gdb) n
133           ifd = fds[0];
(gdb) n
134           ofd = fds[1];
(gdb) n
135           addInputHandler(R_InputHandlers, ifd, 
R_gtk_timerInputHandler, 32);
(gdb) n
136           if (!g_thread_supported ()) g_thread_init (NULL);
(gdb) n
137           g_thread_create(R_gtk_timerThreadFunc, NULL, FALSE, NULL);
(gdb) n

Line 138 (R_CStackLimit = -1;) is hanging. It seems there is something 
wrong with piping the file descriptor?


>> Thanks again,
>> Rainer
>>
>>
>>> Thanks,
>>> Michael
>>>
>>> I think this is rather technical for R-help, so maybe move to
>>> R-devel?
>>>
>>>
>>> I moved to R-devel.
>>>
>>> And can you check the RGtk2 version? A recent but not current
>>> version
>>> (2.12.17?) did hang initializing Gtk+ on some platforms and Michael
>>> Lawrence had to be involved.
>>>
>>>
>>> I am using RGtk2_2.12.18.tar.gz for month now.
>>>
>>>
>>> On Thu, 21 Oct 2010, Rainer Hurling wrote:
>>>
>>> Am 21.10.2010 16:12 (UTC+1) schrieb Prof Brian Ripley:
>>>
>>> On Thu, 21 Oct 2010, Rainer Hurling wrote:
>>>
>>> I am working with R-2.12.0 on FreeBSD 9.0-CURRENT
>>> for a while now. I
>>> successfully installed more than 300 packages (most
>>> as dependencies of
>>> others).
>>>
>>> There are two packages I am not able to install:
>>> RGtk2 and rggobi.
>>>
>>> For example rggobi builds fine and after that it
>>> wants to load:
>>>
>>> ------------------------------------------------------
>>> # R CMD INSTALL rggobi_2.1.16.tar.gz
>>> [..SNIP..]
>>> gcc -std=gnu99 -shared -L/usr/local/lib -o rggobi.so
>>> RSEval.o brush.o
>>> colorSchemes.o conversion.o data.o dataset.o
>>> display.o displays.o
>>> edges.o ggobi.o identify.o init.o io.o keyHandlers.o
>>> longitudinal.o
>>> modes.o plot.o plots.o plugins.o print.o session.o
>>> smooth.o ui.o
>>> utils.o -pthread -L/usr/local/lib -lggobi
>>> -lgtk-x11-2.0 -lxml2
>>> -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0
>>> -lpangocairo-1.0 -lXext
>>> -lXrender -lXinerama -lXi -lXrandr -lXcursor
>>> -lXcomposite -lXdamage
>>> -lpangoft2-1.0 -lgio-2.0 -lXfixes -lcairo -lX11
>>> -lpango-1.0 -lm
>>> -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0
>>> -lgthread-2.0
>>> -lglib-2.0
>>> installiert nach /usr/local/lib/R/library/rggobi/libs
>>> ** R
>>> ** data
>>> ** moving datasets to lazyload DB
>>> ** demo
>>> ** preparing package for lazy loading
>>> ------------------------------------------------------
>>>
>>> At this point the install process is hanging, R
>>> utilises no more CPU
>>> time. Same with package RGtk2.
>>>
>>> Is this a known error? Please let me know if I can
>>> give more
>>> information or try something different.
>>>
>>>
>>> Well, those are exactly the two packages using Gtk+.
>>>
>>> There is no known general problem, and as you could have
>>> checked from
>>> the CRAN check pages, those packages install without
>>> problems on several
>>> platforms. (Not Solaris, where ggobi does not install
>>> and RGtk2 requires
>>> gcc, and not x64 Windows where both need to be patched.)
>>>
>>> So it does look very like there is a problem with
>>> loading against the
>>> Gtk+ system libraries on your system.
>>>
>>>
>>> I think you are right. With previous versions of R (until
>>> R-2.10.x) I
>>> did not have this hanging when loading RGtk2 ... And I am
>>> pretty sure
>>> that I have no problems with gtk2 outside of R on my FreeBSD
>>> system.
>>>
>>> In the meantime I found out that the reported loading error
>>> of rggobi
>>> is a loading error of RGtk2, which fails (hangs). So there
>>> remains
>>> only a loading error with RGtk2. (Because of that I changed
>>> the subject.)
>>>
>>> After building/installing RGtk2, there are the following
>>> messages:
>>>
>>> ------------------------------------------------------
>>> [..SNIP..]
>>> gcc -std=gnu99 -shared -L/usr/local/lib -o RGtk2.so
>>> RGtkDataFrame.o
>>> Rgtk.o atkAccessors.o atkClasses.o atkConversion.o atkFuncs.o
>>> atkManuals.o atkUserFuncs.o cairo-enums.o cairoAccessors.o
>>> cairoConversion.o cairoFuncs.o cairoManuals.o cairoUserFuncs.o
>>> classes.o conversion.o eventLoop.o gdkAccessors.o gdkClasses.o
>>> gdkConversion.o gdkFuncs.o gdkManuals.o gdkUserFuncs.o glib.o
>>> gobject.o gtkAccessors.o gtkClasses.o gtkConversion.o gtkFuncs.o
>>> gtkManuals.o gtkUserFuncs.o libgladeAccessors.o libgladeFuncs.o
>>> libgladeManuals.o libgladeUserFuncs.o pangoAccessors.o
>>> pangoClasses.o
>>> pangoConversion.o pangoFuncs.o pangoManuals.o
>>> pangoUserFuncs.o utils.o
>>> zcompat.o -pthread -L/usr/local/lib -lglade-2.0
>>> -lgtk-x11-2.0 -lxml2
>>> -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lXext
>>> -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXcomposite
>>> -lXdamage
>>> -lpangoft2-1.0 -lgio-2.0 -lXfixes -lcairo -lX11 -lpango-1.0 -lm
>>> -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0
>>> -lgthread-2.0
>>> -lglib-2.0 -pthread -L/usr/local/lib -lgthread-2.0 -lglib-2.0
>>> installiert nach /usr/local/lib/R/library/RGtk2/libs
>>> ** R
>>> ** demo
>>> ** inst
>>> ** preparing package for lazy loading
>>> ** help
>>> *** installing help indices
>>> ** building package indices ...
>>> ** testing if installed package can be loaded [..hanging
>>> from here..]
>>> ------------------------------------------------------
>>>
>>> Is there a chance to find out what is wrong with loading
>>> RGtk2 on my
>>> system? Unfortunately I have almost no experience with real
>>> debugging
>>> methods on R. But of course I am willing to help and try out ...



More information about the R-devel mailing list