[RQt-devel] recent smoke update

Michael Lawrence lawrence.michael at gene.com
Sun Jan 17 19:41:22 CET 2010


On Sun, Jan 17, 2010 at 10:24 AM, Deepayan Sarkar <deepayan.sarkar at gmail.com
> wrote:

> On Sun, Jan 17, 2010 at 7:32 AM, Michael Lawrence
> <lawrence.michael at gene.com> wrote:
> > Unfortunately, I can't seem to reproduce the error, only the segfault.
> Btw,
> > your test code is off by 1 (so the error is happening on the first
> > iteration). It's also weird how the segfault is so predictable (it
> crashes
> > somewhere between 400 and 500 on my machine too).
>
> Yes, the segfault is quite predictable (although not quite 100%), and
> happens much earlier if I include a gc() call. Here's a variation:
>
> ----Code:
> library(qtbase)
> i <- 1L
> while (TRUE) {
>     gc()
>    pen <- Qt$QPen(Qt$QColor(10L, 20L, 10L))
>    message(i, "\t", capture.output(print(pen))[1], "\t", class(pen)[1])
>    i <- i + 1L
> }
> ----Typical output:
> 1       <environment: 0x141e530>        QPen
> 2       <environment: 0x1f75788>        QColor
> 3       <environment: 0x1f758d8>        QPen
> 4       <environment: 0x1f75868>        QColor
> 5       <environment: 0x1f757f8>        QColor
> 6       <environment: 0x1f75868>        QColor
> 7       <environment: 0x1f757f8>        QColor
>
>
Ok, this looks interesting. After we fix this bug though, I think we need to
make qtbase convert QColor to the high-level integer matrix as returned by
qcolor(). And QPen might belong as an R list, as I think you were doing
before. In general, I think the value types like QColor, QMatrix, etc,
should be converted to native R structures, instead of opaque external
pointers. The functions already exist for this; they just need to integrated
better into the smoke stuff.

Michael

 *** caught segfault ***
> address (nil), cause 'unknown'
> aborting ...
> Segmentation fault
> ----
> Note the wrongly reported QColor. Taking the diff() of the pointer
> addresses is interesting:
>
> > diff(c(0x141e530, 0x1f75788, 0x1f758d8, 0x1f75868, 0x1f757f8, 0x1f75868,
> 0x1f757f8))
> [1] 11891288      336     -112     -112      112     -112
>
> The numbers 336 and 112 recur.
>
> > Are you saying that this is a regression? I can't install the old
> version,
> > because it's broken for Qt 4.6.
>
> I had thought so, but it's not. I get similar behavior with an older
> version.
>
> Somehow the QColor seems important. If I just use
>
> pen <- Qt$QPen()
>
> then things seem stabler (it doesn't segfault, though it sometimes
> gives an error).
>
> -Deepayan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.r-forge.r-project.org/pipermail/qtinterfaces-devel/attachments/20100117/a8a1768a/attachment.htm 


More information about the Qtinterfaces-devel mailing list