Re: [R] R-2.12.0 hangs while loading RGtk2 on FreeBSD

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [R] R-2.12.0 hangs while loading RGtk2 on FreeBSD

Rainer Hurling
[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?

> 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 ...

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: [R] R-2.12.0 hangs while loading RGtk2 on FreeBSD

Michael Lawrence-3
On Thu, Oct 21, 2010 at 9:42 AM, Rainer Hurling <[hidden email]> 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.

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 ...
>>>
>>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: [R] R-2.12.0 hangs while loading RGtk2 on FreeBSD

Rainer Hurling
On 22.10.2010 14:57 (UTC+1), Michael Lawrence wrote:

>
>
> On Thu, Oct 21, 2010 at 9:42 AM, Rainer Hurling <[hidden email]
> <mailto:[hidden email]>> 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.

Obviously there is some wrong with my try?

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 ...

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: [R] R-2.12.0 hangs while loading RGtk2 on FreeBSD

Rainer Hurling
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 <[hidden email]
>> <mailto:[hidden email]>> 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?


> 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 ...
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R-2.12.0 hangs while loading RGtk2 on FreeBSD

Rainer Hurling
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 <[hidden email]
>>> <mailto:[hidden email]>> 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 ...

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R-2.12.0 hangs while loading RGtk2 on FreeBSD

Michael Lawrence-3
On Sat, Oct 23, 2010 at 2:49 AM, Rainer Hurling <[hidden email]> wrote:

> 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 <[hidden email]
>>>> <mailto:[hidden email]>> 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 for looking into this. It looks like the g_thread_create line is
hanging. I wonder if your version of GTK+/GLib is not built with threading
support? But if that were the case, g_thread_init() should have aborted. You
could try breaking on the R_gtk_timerThreadFunc just to see if the thread is
executed at all or where it is hanging.

Thanks again for taking the time to work on this. Sorry I have been
non-responsive.

Michael


>  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 ...
>>>>
>>>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R-2.12.0 hangs while loading RGtk2 on FreeBSD

Rainer Hurling
On 27.10.2010 15:07 (UTC+1), Michael Lawrence wrote:

> On Sat, Oct 23, 2010 at 2:49 AM, Rainer Hurling <[hidden email]
> <mailto:[hidden email]>> wrote:
>     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
>                 <[hidden email] <mailto:[hidden email]>
>                 <mailto:[hidden email] <mailto:[hidden email]>>> 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 for looking into this. It looks like the g_thread_create line is
> hanging. I wonder if your version of GTK+/GLib is not built with
> threading support? But if that were the case, g_thread_init() should
> have aborted. You could try breaking on the R_gtk_timerThreadFunc just
> to see if the thread is executed at all or where it is hanging.


Michael, I have to thank you :-)  I set a break at
'R_gtk_timerThreadFunc'. It seems this function does not return:


[..see above..]
library(RGtk2)
[New LWP 100172]
Breakpoint 2 at 0x458bd5c0: file Rgtk.c, line 78.
Pending breakpoint "R_gtk_timerThreadFunc" resolved
[New Thread 4322ef00 (LWP 100172)]
[..hanging from here on..]


Next I tried a new run with break at 'g_main_context_new' (line 79),
which steps into glib-2.0.so.0, before it hangs:


library(RGtk2)
[New LWP 100195]
Breakpoint 2 at 0x47c7c660
Pending breakpoint "g_main_context_new" resolved
[New Thread 4322ef00 (LWP 100195)]
[Switching to Thread 4322ef00 (LWP 100195)]
Breakpoint 2, 0x0000000047c7c660 in g_main_context_new () from
/usr/local/lib/libglib-2.0.so.0
(gdb) n
Single stepping until exit from function g_main_context_new,
which has no line number information.
0x0000000047c7aed0 in g_source_set_priority () from
/usr/local/lib/libglib-2.0.so.0
(gdb) n
Single stepping until exit from function g_source_set_priority,
which has no line number information.
0x0000000047c7ac70 in g_main_loop_quit () from
/usr/local/lib/libglib-2.0.so.0
(gdb) n
Single stepping until exit from function g_main_loop_quit,
which has no line number information.
0x0000000047c7a280 in g_source_get_context () from
/usr/local/lib/libglib-2.0.so.0
(gdb) n
Single stepping until exit from function g_source_get_context,
which has no line number information.
0x0000000047c7c6f3 in g_main_context_new () from
/usr/local/lib/libglib-2.0.so.0
(gdb) p ctx
No symbol "ctx" in current context.
(gdb) p data
No symbol "data" in current context.
(gdb) n
Single stepping until exit from function g_main_context_new,
which has no line number information.
0x0000000047c7c8b2 in g_main_context_default () from
/usr/local/lib/libglib-2.0.so.0
(gdb) n
Single stepping until exit from function g_main_context_default,
which has no line number information.
0x0000000047c7dea5 in g_source_attach () from
/usr/local/lib/libglib-2.0.so.0
(gdb) n
Single stepping until exit from function g_source_attach,
which has no line number information.
0x0000000047c79c50 in g_list_remove_link () from
/usr/local/lib/libglib-2.0.so.0
(gdb) n
Single stepping until exit from function g_list_remove_link,
which has no line number information.
0x0000000047c7dde6 in g_source_attach () from
/usr/local/lib/libglib-2.0.so.0
(gdb) n
Single stepping until exit from function g_source_attach,
which has no line number information.
0x0000000047c7ac70 in g_main_loop_quit () from
/usr/local/lib/libglib-2.0.so.0
(gdb) n
Single stepping until exit from function g_main_loop_quit,
which has no line number information.
0x0000000047c7a280 in g_source_get_context () from
/usr/local/lib/libglib-2.0.so.0
(gdb) n
Single stepping until exit from function g_source_get_context,
which has no line number information.
0x0000000047c7de00 in g_source_attach () from
/usr/local/lib/libglib-2.0.so.0
(gdb) n
Single stepping until exit from function g_source_attach,
which has no line number information.
0x0000000047c7a280 in g_source_get_context () from
/usr/local/lib/libglib-2.0.so.0
(gdb) n
Single stepping until exit from function g_source_get_context,
which has no line number information.
0x0000000047c7de11 in g_source_attach () from
/usr/local/lib/libglib-2.0.so.0
(gdb) n
Single stepping until exit from function g_source_attach,
which has no line number information.
0x000000004608eec8 in gdk_add_client_message_filter () from
/usr/local/lib/libgdk-x11-2.0.so.0
(gdb) n
Single stepping until exit from function gdk_add_client_message_filter,
which has no line number information.
[..hanging from here on..]


Is there an easy way to find out if GTK+/GLib is built with threading
support?

Thanks, Rainer


> Thanks again for taking the time to work on this. Sorry I have been
> non-responsive.
>
> Michael

[..mail deleted from here on..]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R-2.12.0 hangs while loading RGtk2 on FreeBSD

Michael Lawrence-3
On Wed, Oct 27, 2010 at 12:09 PM, Rainer Hurling <[hidden email]> wrote:

> On 27.10.2010 15:07 (UTC+1), Michael Lawrence wrote:
>
>> On Sat, Oct 23, 2010 at 2:49 AM, Rainer Hurling <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>    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
>>                <[hidden email] <mailto:[hidden email]>
>>                <mailto:[hidden email] <mailto:[hidden email]>>> 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 for looking into this. It looks like the g_thread_create line is
>> hanging. I wonder if your version of GTK+/GLib is not built with
>> threading support? But if that were the case, g_thread_init() should
>> have aborted. You could try breaking on the R_gtk_timerThreadFunc just
>> to see if the thread is executed at all or where it is hanging.
>>
>
>
> Michael, I have to thank you :-)  I set a break at 'R_gtk_timerThreadFunc'.
> It seems this function does not return:
>
>
> [..see above..]
> library(RGtk2)
> [New LWP 100172]
> Breakpoint 2 at 0x458bd5c0: file Rgtk.c, line 78.
> Pending breakpoint "R_gtk_timerThreadFunc" resolved
> [New Thread 4322ef00 (LWP 100172)]
> [..hanging from here on..]
>
>
> Next I tried a new run with break at 'g_main_context_new' (line 79), which
> steps into glib-2.0.so.0, before it hangs:
>
>
> library(RGtk2)
> [New LWP 100195]
> Breakpoint 2 at 0x47c7c660
> Pending breakpoint "g_main_context_new" resolved
> [New Thread 4322ef00 (LWP 100195)]
> [Switching to Thread 4322ef00 (LWP 100195)]
> Breakpoint 2, 0x0000000047c7c660 in g_main_context_new () from
> /usr/local/lib/libglib-2.0.so.0
> (gdb) n
> Single stepping until exit from function g_main_context_new,
> which has no line number information.
> 0x0000000047c7aed0 in g_source_set_priority () from
> /usr/local/lib/libglib-2.0.so.0
> (gdb) n
> Single stepping until exit from function g_source_set_priority,
> which has no line number information.
> 0x0000000047c7ac70 in g_main_loop_quit () from
> /usr/local/lib/libglib-2.0.so.0
> (gdb) n
> Single stepping until exit from function g_main_loop_quit,
> which has no line number information.
> 0x0000000047c7a280 in g_source_get_context () from
> /usr/local/lib/libglib-2.0.so.0
> (gdb) n
> Single stepping until exit from function g_source_get_context,
> which has no line number information.
> 0x0000000047c7c6f3 in g_main_context_new () from
> /usr/local/lib/libglib-2.0.so.0
> (gdb) p ctx
> No symbol "ctx" in current context.
> (gdb) p data
> No symbol "data" in current context.
> (gdb) n
> Single stepping until exit from function g_main_context_new,
> which has no line number information.
> 0x0000000047c7c8b2 in g_main_context_default () from
> /usr/local/lib/libglib-2.0.so.0
> (gdb) n
> Single stepping until exit from function g_main_context_default,
> which has no line number information.
> 0x0000000047c7dea5 in g_source_attach () from
> /usr/local/lib/libglib-2.0.so.0
> (gdb) n
> Single stepping until exit from function g_source_attach,
> which has no line number information.
> 0x0000000047c79c50 in g_list_remove_link () from
> /usr/local/lib/libglib-2.0.so.0
> (gdb) n
> Single stepping until exit from function g_list_remove_link,
> which has no line number information.
> 0x0000000047c7dde6 in g_source_attach () from
> /usr/local/lib/libglib-2.0.so.0
> (gdb) n
> Single stepping until exit from function g_source_attach,
> which has no line number information.
> 0x0000000047c7ac70 in g_main_loop_quit () from
> /usr/local/lib/libglib-2.0.so.0
> (gdb) n
> Single stepping until exit from function g_main_loop_quit,
> which has no line number information.
> 0x0000000047c7a280 in g_source_get_context () from
> /usr/local/lib/libglib-2.0.so.0
> (gdb) n
> Single stepping until exit from function g_source_get_context,
> which has no line number information.
> 0x0000000047c7de00 in g_source_attach () from
> /usr/local/lib/libglib-2.0.so.0
> (gdb) n
> Single stepping until exit from function g_source_attach,
> which has no line number information.
> 0x0000000047c7a280 in g_source_get_context () from
> /usr/local/lib/libglib-2.0.so.0
> (gdb) n
> Single stepping until exit from function g_source_get_context,
> which has no line number information.
> 0x0000000047c7de11 in g_source_attach () from
> /usr/local/lib/libglib-2.0.so.0
> (gdb) n
> Single stepping until exit from function g_source_attach,
> which has no line number information.
> 0x000000004608eec8 in gdk_add_client_message_filter () from
> /usr/local/lib/libgdk-x11-2.0.so.0
> (gdb) n
> Single stepping until exit from function gdk_add_client_message_filter,
> which has no line number information.
> [..hanging from here on..]
>
>
> Is there an easy way to find out if GTK+/GLib is built with threading
> support?
>
>
The g_thread_init() call should abort the program if there is no threading
support, so I'm assuming it's there. I'm not sure what's wrong here, but
maybe I'll just #ifdef out the threaded event handling for FreeBSD. A new
RGtk2 will be released in the next few days.

Michael


> Thanks, Rainer
>
>
>
>  Thanks again for taking the time to work on this. Sorry I have been
>> non-responsive.
>>
>> Michael
>>
>
> [..mail deleted from here on..]
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: R-2.12.0 hangs while loading RGtk2 on FreeBSD

Rainer Hurling
On 28.10.2010 20:07 (UTC+1), Michael Lawrence wrote:

> On Wed, Oct 27, 2010 at 12:09 PM, Rainer Hurling <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     On 27.10.2010 15:07 (UTC+1), Michael Lawrence wrote:
>
>         On Sat, Oct 23, 2010 at 2:49 AM, Rainer Hurling <[hidden email]
>         <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>             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
>         <[hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>
>         <mailto:[hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>>> 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 for looking into this. It looks like the g_thread_create
>         line is
>         hanging. I wonder if your version of GTK+/GLib is not built with
>         threading support? But if that were the case, g_thread_init() should
>         have aborted. You could try breaking on the
>         R_gtk_timerThreadFunc just
>         to see if the thread is executed at all or where it is hanging.
>
>
>
>     Michael, I have to thank you :-)  I set a break at
>     'R_gtk_timerThreadFunc'. It seems this function does not return:
>
>
>     [..see above..]
>     library(RGtk2)
>     [New LWP 100172]
>     Breakpoint 2 at 0x458bd5c0: file Rgtk.c, line 78.
>     Pending breakpoint "R_gtk_timerThreadFunc" resolved
>     [New Thread 4322ef00 (LWP 100172)]
>     [..hanging from here on..]
>
>
>     Next I tried a new run with break at 'g_main_context_new' (line 79),
>     which steps into glib-2.0.so.0, before it hangs:
>
>
>     library(RGtk2)
>     [New LWP 100195]
>     Breakpoint 2 at 0x47c7c660
>     Pending breakpoint "g_main_context_new" resolved
>     [New Thread 4322ef00 (LWP 100195)]
>     [Switching to Thread 4322ef00 (LWP 100195)]
>     Breakpoint 2, 0x0000000047c7c660 in g_main_context_new () from
>     /usr/local/lib/libglib-2.0.so.0
>     (gdb) n
>     Single stepping until exit from function g_main_context_new,
>     which has no line number information.
>     0x0000000047c7aed0 in g_source_set_priority () from
>     /usr/local/lib/libglib-2.0.so.0
>     (gdb) n
>     Single stepping until exit from function g_source_set_priority,
>     which has no line number information.
>     0x0000000047c7ac70 in g_main_loop_quit () from
>     /usr/local/lib/libglib-2.0.so.0
>     (gdb) n
>     Single stepping until exit from function g_main_loop_quit,
>     which has no line number information.
>     0x0000000047c7a280 in g_source_get_context () from
>     /usr/local/lib/libglib-2.0.so.0
>     (gdb) n
>     Single stepping until exit from function g_source_get_context,
>     which has no line number information.
>     0x0000000047c7c6f3 in g_main_context_new () from
>     /usr/local/lib/libglib-2.0.so.0
>     (gdb) p ctx
>     No symbol "ctx" in current context.
>     (gdb) p data
>     No symbol "data" in current context.
>     (gdb) n
>     Single stepping until exit from function g_main_context_new,
>     which has no line number information.
>     0x0000000047c7c8b2 in g_main_context_default () from
>     /usr/local/lib/libglib-2.0.so.0
>     (gdb) n
>     Single stepping until exit from function g_main_context_default,
>     which has no line number information.
>     0x0000000047c7dea5 in g_source_attach () from
>     /usr/local/lib/libglib-2.0.so.0
>     (gdb) n
>     Single stepping until exit from function g_source_attach,
>     which has no line number information.
>     0x0000000047c79c50 in g_list_remove_link () from
>     /usr/local/lib/libglib-2.0.so.0
>     (gdb) n
>     Single stepping until exit from function g_list_remove_link,
>     which has no line number information.
>     0x0000000047c7dde6 in g_source_attach () from
>     /usr/local/lib/libglib-2.0.so.0
>     (gdb) n
>     Single stepping until exit from function g_source_attach,
>     which has no line number information.
>     0x0000000047c7ac70 in g_main_loop_quit () from
>     /usr/local/lib/libglib-2.0.so.0
>     (gdb) n
>     Single stepping until exit from function g_main_loop_quit,
>     which has no line number information.
>     0x0000000047c7a280 in g_source_get_context () from
>     /usr/local/lib/libglib-2.0.so.0
>     (gdb) n
>     Single stepping until exit from function g_source_get_context,
>     which has no line number information.
>     0x0000000047c7de00 in g_source_attach () from
>     /usr/local/lib/libglib-2.0.so.0
>     (gdb) n
>     Single stepping until exit from function g_source_attach,
>     which has no line number information.
>     0x0000000047c7a280 in g_source_get_context () from
>     /usr/local/lib/libglib-2.0.so.0
>     (gdb) n
>     Single stepping until exit from function g_source_get_context,
>     which has no line number information.
>     0x0000000047c7de11 in g_source_attach () from
>     /usr/local/lib/libglib-2.0.so.0
>     (gdb) n
>     Single stepping until exit from function g_source_attach,
>     which has no line number information.
>     0x000000004608eec8 in gdk_add_client_message_filter () from
>     /usr/local/lib/libgdk-x11-2.0.so.0
>     (gdb) n
>     Single stepping until exit from function gdk_add_client_message_filter,
>     which has no line number information.
>     [..hanging from here on..]
>
>
>     Is there an easy way to find out if GTK+/GLib is built with
>     threading support?
>
>
> The g_thread_init() call should abort the program if there is no
> threading support, so I'm assuming it's there. I'm not sure what's wrong
> here, but maybe I'll just #ifdef out the threaded event handling for
> FreeBSD. A new RGtk2 will be released in the next few days.

Great news! I could test the unthreaded version before releasing if you
would like to. Thanks so far,

Rainer


> Michael
>
>     Thanks, Rainer
>
>
>
>         Thanks again for taking the time to work on this. Sorry I have been
>         non-responsive.
>
>         Michael
>
>
>     [..mail deleted from here on..]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel