<br><br><div class="gmail_quote">On Sun, Jan 17, 2010 at 10:24 AM, Deepayan Sarkar <span dir="ltr"><<a href="mailto:deepayan.sarkar@gmail.com">deepayan.sarkar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Sun, Jan 17, 2010 at 7:32 AM, Michael Lawrence<br>
<div class="im"><<a href="mailto:lawrence.michael@gene.com">lawrence.michael@gene.com</a>> wrote:<br>
</div><div class="im">> Unfortunately, I can't seem to reproduce the error, only the segfault. Btw,<br>
> your test code is off by 1 (so the error is happening on the first<br>
> iteration). It's also weird how the segfault is so predictable (it crashes<br>
> somewhere between 400 and 500 on my machine too).<br>
<br>
</div>Yes, the segfault is quite predictable (although not quite 100%), and<br>
happens much earlier if I include a gc() call. Here's a variation:<br>
<br>
----Code:<br>
<div class="im">library(qtbase)<br>
i <- 1L<br>
while (TRUE) {<br>
</div> gc()<br>
pen <- Qt$QPen(Qt$QColor(10L, 20L, 10L))<br>
message(i, "\t", capture.output(print(pen))[1], "\t", class(pen)[1])<br>
i <- i + 1L<br>
}<br>
----Typical output:<br>
1 <environment: 0x141e530> QPen<br>
2 <environment: 0x1f75788> QColor<br>
3 <environment: 0x1f758d8> QPen<br>
4 <environment: 0x1f75868> QColor<br>
5 <environment: 0x1f757f8> QColor<br>
6 <environment: 0x1f75868> QColor<br>
7 <environment: 0x1f757f8> QColor<br>
<div class="im"><br></div></blockquote><div><br>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.<br>
<br>Michael<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
*** caught segfault ***<br>
address (nil), cause 'unknown'<br>
aborting ...<br>
Segmentation fault<br>
</div>----<br>
Note the wrongly reported QColor. Taking the diff() of the pointer<br>
addresses is interesting:<br>
<br>
> diff(c(0x141e530, 0x1f75788, 0x1f758d8, 0x1f75868, 0x1f757f8, 0x1f75868, 0x1f757f8))<br>
[1] 11891288 336 -112 -112 112 -112<br>
<br>
The numbers 336 and 112 recur.<br>
<div class="im"><br>
> Are you saying that this is a regression? I can't install the old version,<br>
> because it's broken for Qt 4.6.<br>
<br>
</div>I had thought so, but it's not. I get similar behavior with an older version.<br>
<br>
Somehow the QColor seems important. If I just use<br>
<br>
pen <- Qt$QPen()<br>
<br>
then things seem stabler (it doesn't segfault, though it sometimes<br>
gives an error).<br>
<font color="#888888"><br>
-Deepayan<br>
</font></blockquote></div><br>