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