Bug 16351 - R hangs when plotting invalid hexadecimal UTF-8 byte sequences
Summary: R hangs when plotting invalid hexadecimal UTF-8 byte sequences
Status: NEW
Alias: None
Product: R
Classification: Unclassified
Component: Graphics (show other bugs)
Version: R 3.2.0
Hardware: x86_64/x64/amd64 (64-bit) Linux-Ubuntu
: P5 normal
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2015-04-29 09:45 UTC by Sebastian Meyer
Modified: 2015-04-29 09:45 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Meyer 2015-04-29 09:45:03 UTC
The following code causes my interactive R session to hang with 100% CPU usage:

plot(0, 0, type = "n")
text(0, 0, labels = "M\xc3a")

The same is true if I use the x11(type = "Xlib"), pdf(), or png() device.

The following warning is displayed _once_ before the session hangs:
Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()

Interestingly, the following plots work:

plot(0, 0, type = "n"); text(0, 0, labels = "M\xc3")

plot(0, 0, type = "n", xlab = "M\xc3a")

In these cases, the Pango warning stated above is displayed _twice_.

Of course, plotting works fine when using a valid hexadecimal UTF-8 byte sequence:

plot(0, 0, type = "n"); text(0, 0, labels = "M\xc3\xbc")

--

R version 3.2.0 (2015-04-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.2 LTS

locale:
 [1] LC_CTYPE=de_CH.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=de_CH.UTF-8        LC_COLLATE=de_CH.UTF-8    
 [5] LC_MONETARY=de_CH.UTF-8    LC_MESSAGES=de_CH.UTF-8   
 [7] LC_PAPER=de_CH.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=de_CH.UTF-8 LC_IDENTIFICATION=C