This should be fixed...<br><br><div class="gmail_quote">On Thu, Nov 11, 2010 at 3:26 PM, Tengfei Yin <span dir="ltr"><<a href="mailto:yintengfei@gmail.com">yintengfei@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Same thing happens on my laptop, when I resize it.<div><br><div><div>*** caught segfault ***</div><div>address 0xffffffff00000008, cause 'memory not mapped'</div><div><br></div><div>Traceback:</div><div> 1: .Call("qt_qdrawText_Painter", p, as.character(text), as.numeric(x), as.numeric(y), as.integer(hflag + vflag), as.numeric(rot), .normArgStroke(p, color, m))</div>
<div> 2: drawText(text)</div><div> 3: qdrawText(painter, c("aaa\nbbb\ncdg\nqwer", "qwer"), 4, c(1, 5), halign = "right", valign = "center")</div><div> 4: function (layer, painter) { for (x in c(0, 3, 5, 8, 10)) { qdrawText(painter, paste("x =", x), x, 5) } qdrawText(painter, c("aaa\nbbb\ncdg\nqwer", "qwer"), 4, c(1, 5), halign = "right", valign = "center")}(<environment>, <pointer: 0x47b0490>)</div>
<div><br></div><div>Possible actions:</div><div>1: abort (with core dump, if enabled)</div><div>2: normal R exit</div><div>3: exit R without saving workspace</div><div>4: exit R saving workspace</div><div>Selection: </div>
<div><div></div><div class="h5">
<div><br></div><br><div class="gmail_quote">On Thu, Nov 11, 2010 at 4:48 PM, Yihui Xie <span dir="ltr"><<a href="mailto:xieyihui@gmail.com" target="_blank">xieyihui@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
I was trying to draw y-axis tick labels with qdrawText() and found<br>
qdrawText() can crash R when '\n' is present in the texts. A<br>
reproducible example is below:<br>
<br>
library(qtpaint)<br>
s <- qscene()<br>
test_layer <- qlayer(s, function(layer, painter) {<br>
for(x in c(0,3,5,8,10)) {<br>
qdrawText(painter, paste('x =',x), x, 5)<br>
}<br>
## qdrawText(painter, 'asdf', 1,1)<br>
qdrawText(painter, c('aaa\nbbb\ncdg\nqwer','qwer'), 4, c(1,5),<br>
halign='right', valign='center')<br>
}, limits=qrect(0,0,10,10))<br>
qplotView(s)<br>
<br>
<br>
Whenever I ran this code, R will crash. When I was lucky that R did<br>
not crash immediately, I could minimize the window to crash R again.<br>
Any ideas?<br>
<br>
Thanks!<br>
<br>
> *** glibc detected *** /usr/local/lib64/R/bin/exec/R: double free or corruption (!prev): 0x00000000043d31e0 ***<br>
======= Backtrace: =========<br>
/lib/libc.so.6(+0x774b6)[0x7f46415634b6]<br>
/lib/libc.so.6(cfree+0x73)[0x7f4641569c83]<br>
/usr/lib/nvidia-current/libGL.so.1(+0x992ff)[0x7f46388472ff]<br>
======= Memory map: ========<br>
00400000-00401000 r-xp 00000000 08:01 131789<br>
/usr/local/lib64/R/bin/exec/R<br>
00600000-00601000 r--p 00000000 08:01 131789<br>
/usr/local/lib64/R/bin/exec/R<br>
00601000-00602000 rw-p 00001000 08:01 131789<br>
/usr/local/lib64/R/bin/exec/R<br>
022aa000-04576000 rw-p 00000000 00:00 0 [heap]<br>
40ec6000-40ec8000 r-xs 00000000 08:01 1502<br>
/tmp/gl2W9m0B (deleted)<br>
414cd000-414cf000 r-xs 00000000 08:01 1442<br>
/tmp/glyRl1a3 (deleted)<br>
416ea000-41750000 rw-p 00000000 00:05 4639<br>
/dev/zero<br>
41a8b000-41a8d000 r-xs 00000000 08:01 62<br>
/tmp/glKpwGlu (deleted)<br>
41ae4000-41ae6000 r-xs 00000000 08:01 2682<br>
/tmp/glM3OJPa (deleted)<br>
7f4623c00000-7f4624000000 rw-s 3b757000 00:05 7852<br>
/dev/nvidia0<br>
7f4624000000-7f4624021000 rw-p 00000000 00:00 0<br>
7f4624021000-7f4628000000 ---p 00000000 00:00 0<br>
7f4628110000-7f462811c000 rw-p 00000000 00:00 0<br>
7f462811c000-7f462816a000 r--p 00000000 08:01 5512012<br>
/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-R.ttf<br>
7f4628172000-7f4628272000 rw-s 12a46000 00:05 7852<br>
/dev/nvidia0<br>
7f4628272000-7f46282b2000 rw-s 18c3a000 00:05 7852<br>
/dev/nvidia0<br>
7f46282b2000-7f46282d2000 rw-s 2f79e000 00:05 7852<br>
/dev/nvidia0<br>
7f46282d2000-7f4628346000 r-xp 00000000 08:01 1706123<br>
/home/yihui/R/x86_64-unknown-linux-gnu-library/2.12/qtpaint/libs/qtpaint.so<br>
7f4628346000-7f4628545000 ---p 00074000 08:01 1706123<br>
/home/yihui/R/x86_64-unknown-linux-gnu-library/2.12/qtpaint/libs/qtpaint.so<br>
7f4628545000-7f4628548000 r--p 00073000 08:01 1706123<br>
/home/yihui/R/x86_64-unknown-linux-gnu-library/2.12/qtpaint/libs/qtpaint.so<br>
7f4628548000-7f462854e000 rw-p 00076000 08:01 1706123<br>
/home/yihui/R/x86_64-unknown-linux-gnu-library/2.12/qtpaint/libs/qtpaint.so<br>
7f462854e000-7f462854f000 ---p 00000000 00:00 0<br>
7f462854f000-7f4628d9f000 rw-p 00000000 00:00 0<br>
7f4628d9f000-7f4628db1000 r-xp 00000000 08:01 665470<br>
/usr/lib/gtk-2.0/2.10.0/immodules/im-scim-bridge.so<br>
7f4628db1000-7f4628fb1000 ---p 00012000 08:01 665470<br>
/usr/lib/gtk-2.0/2.10.0/immodules/im-scim-bridge.so<br>
7f4628fb1000-7f4628fb2000 r--p 00012000 08:01 665470<br>
/usr/lib/gtk-2.0/2.10.0/immodules/im-scim-bridge.so<br>
7f4628fb2000-7f4628fb3000 rw-p 00013000 08:01 665470<br>
/usr/lib/gtk-2.0/2.10.0/immodules/im-scim-bridge.so<br>
7f4628fb3000-7f4629002000 r--p 00000000 08:01 918237<br>
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf<br>
7f4629002000-7f4629004000 r-xp 00000000 08:01 677948<br>
/usr/lib/pango/1.6.0/modules/pango-basic-fc.so<br>
7f4629004000-7f4629203000 ---p 00002000 08:01 677948<br>
/usr/lib/pango/1.6.0/modules/pango-basic-fc.so<br>
7f4629203000-7f4629204000 r--p 00001000 08:01 677948<br>
/usr/lib/pango/1.6.0/modules/pango-basic-fc.so<br>
7f4629204000-7f4629205000 rw-p 00002000 08:01 677948<br>
/usr/lib/pango/1.6.0/modules/pango-basic-fc.so<br>
7f4629205000-7f4629230000 r-xp 00000000 08:01 673769<br>
/usr/lib/gtk-2.0/2.10.0/engines/libclearlooks.so<br>
7f4629230000-7f4629430000 ---p 0002b000 08:01 673769<br>
/usr/lib/gtk-2.0/2.10.0/engines/libclearlooks.so<br>
7f4629430000-7f4629431000 r--p 0002b000 08:01 673769<br>
/usr/lib/gtk-2.0/2.10.0/engines/libclearlooks.so<br>
7f4629431000-7f4629432000 rw-p 0002c000 08:01 673769<br>
/usr/lib/gtk-2.0/2.10.0/engines/libclearlooks.so<br>
7f4629432000-7f4629436000 r-xp 00000000 08:01 1776<br>
/usr/lib/libcanberra-gtk.so.0.1.6<br>
7f4629436000-7f4629635000 ---p 00004000 08:01 1776<br>
/usr/lib/libcanberra-gtk.so.0.1.6<br>
7f4629635000-7f4629636000 r--p 00003000 08:01 1776<br>
/usr/lib/libcanberra-gtk.so.0.1.6<br>
7f4629636000-7f4629637000 rw-p 00004000 08:01 1776<br>
/usr/lib/libcanberra-gtk.so.0.1.6<br>
7f4629637000-7f462963c000 r-xp 00000000 08:01 673294<br>
/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so<br>
7f462963c000-7f462983c000 ---p 00005000 08:01 673294<br>
/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so<br>
7f462983c000-7f462983d000 r--p 00005000 08:01 673294<br>
/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so<br>
7f462983d000-7f462983e000 rw-p 00006000 08:01 673294<br>
/usr/lib/gtk-2.0/modules/libcanberra-gtk-module.so<br>
7f462983e000-7f4629841000 r-xp 00000000 08:01 3177<br>
/lib/libgpg-error.so.0.4.0<br>
7f4629841000-7f4629a40000 ---p 00003000 08:01 3177<br>
/lib/libgpg-error.so.0.4.0<br>
7f4629a40000-7f4629a41000 r--p 00002000 08:01 3177<br>
/lib/libgpg-error.so.0.4.0<br>
7f4629a41000-7f4629a42000 rw-p 00003000 08:01 3177<br>
/lib/libgpg-error.so.0.4.0<br>
7f4629a42000-7f4629a52000 r-xp 00000000 08:01 1832<br>
/usr/lib/libtasn1.so.3.1.9<br>
7f4629a52000-7f4629c51000 ---p 00010000 08:01 1832<br>
/usr/lib/libtasn1.so.3.1.9<br>
7f4629c51000-7f4629c52000 r--p 0000f000 08:01 1832<br>
/usr/lib/libtasn1.so.3.1.9<br>
7f4629c52000-7f4629c53000 rw-p 00010000 08:01 1832<br>
/usr/lib/libtasn1.so.3.1.9<br>
7f4629c53000-7f4629c5b000 r-xp 00000000 08:01 2764<br>
/usr/lib/libltdl.so.7.2.1<br>
7f4629c5b000-7f4629e5b000 ---p 00008000 08:01 2764<br>
/usr/lib/libltdl.so.7.2.1<br>
7f4629e5b000-7f4629e5c000 r--p 00008000 08:01 2764<br>
/usr/lib/libltdl.so.7.2.1<br>
7f4629e5c000-7f4629e5d000 rw-p 00009000 08:01 2764<br>
/usr/lib/libltdl.so.7.2.1<br>
7f4629e5d000-7f4629e6b000 r-xp 00000000 08:01 4124<br>
/usr/lib/libtdb.so.1.2.1<br>
7f4629e6b000-7f462a06a000 ---p 0000e000 08:01 4124<br>
/usr/lib/libtdb.so.1.2.1<br>
7f462a06a000-7f462a06b000 r--p 0000d000 08:01 4124<br>
/usr/lib/libtdb.so.1.2.1<br>
7f462a06b000-7f462a06c000 rw-p 0000e000 08:01 4124<br>
/usr/lib/libtdb.so.1.2.1<br>
7f462a06c000-7f462a073000 r-xp 00000000 08:01 4865<br>
/usr/lib/libvorbisfile.so.3.3.2<br>
7f462a073000-7f462a272000 ---p 00007000 08:01 4865<br>
/usr/lib/libvorbisfile.so.3.3.2<br>
7f462a272000-7f462a273000 r--p 00006000 08:01 4865<br>
/usr/lib/libvorbisfile.so.3.3.2<br>
7f462a273000-7f462a274000 rw-p 00007000 08:01 4865<br>
/usr/lib/libvorbisfile.so.3.3.2<br>
7f462a274000-7f462a2e8000 r-xp 00000000 08:01 3636<br>
/lib/libgcrypt.so.11.5.3<br>
7f462a2e8000-7f462a4e8000 ---p 00074000 08:01 3636<br>
/lib/libgcrypt.so.11.5.3<br>
7f462a4e8000-7f462a4e9000 r--p 00074000 08:01 3636<br>
/lib/libgcrypt.so.11.5.3<br>
7f462a4e9000-7f462a4ec000 rw-p 00075000 08:01 3636<br>
/lib/libgcrypt.so.11.5.3<br>
7f462a4ec000-7f462a4ee000 r-xp 00000000 08:01 2830<br>
/lib/<a href="http://libutil-2.12.1.so" target="_blank">libutil-2.12.1.so</a><br>
7f462a4ee000-7f462a6ed000 ---p 00002000 08:01 2830<br>
/lib/<a href="http://libutil-2.12.1.so" target="_blank">libutil-2.12.1.so</a><br>
7f462a6ed000-7f462a6ee000 r--p 00001000 08:01 2830<br>
/lib/<a href="http://libutil-2.12.1.so" target="_blank">libutil-2.12.1.so</a><br>
7f462a6ee000-7f462a6ef000 rw-p 00002000<br>
Process R aborted at Thu Nov 11 16:43:38 2010<br>
<br>
Regards,<br>
Yihui<br>
--<br>
<font color="#888888">Yihui Xie <<a href="mailto:xieyihui@gmail.com" target="_blank">xieyihui@gmail.com</a>><br>
Phone: 515-294-2465 Web: <a href="http://yihui.name" target="_blank">http://yihui.name</a><br>
Department of Statistics, Iowa State University<br>
2215 Snedecor Hall, Ames, IA<br>
_______________________________________________<br>
Qtinterfaces-devel mailing list<br>
<a href="mailto:Qtinterfaces-devel@lists.r-forge.r-project.org" target="_blank">Qtinterfaces-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel</a><br>
</font></blockquote></div><br><br clear="all"><br></div></div>-- <br>Tengfei Yin<br>MCDB PhD student <br>1620 Howe Hall, 2274,<br>Iowa State University<br>Ames, IA,50011-2274<br>Homepage: <a href="http://www.tengfei.name" target="_blank">www.tengfei.name</a><br>
<div><br></div><br>
</div></div>
<br>_______________________________________________<br>
Qtinterfaces-devel mailing list<br>
<a href="mailto:Qtinterfaces-devel@lists.r-forge.r-project.org">Qtinterfaces-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel</a><br>
<br></blockquote></div><br>