Bug 16146 - valgrind complains about title() when string has fancy quotes
Summary: valgrind complains about title() when string has fancy quotes
Status: UNCONFIRMED
Alias: None
Product: R
Classification: Unclassified
Component: Graphics (show other bugs)
Version: R 3.1.2
Hardware: ix86 (32-bit) Linux
: P5 trivial
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2015-01-10 03:50 UTC by Adrian Baddeley
Modified: 2015-01-16 10:28 UTC (History)
0 users

See Also:


Attachments
tiny package to demonstrate the bug (use valgrind to check) (900 bytes, application/gzip)
2015-01-10 03:50 UTC, Adrian Baddeley
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Baddeley 2015-01-10 03:50:53 UTC
Created attachment 1720 [details]
tiny package to demonstrate the bug (use valgrind to check)

Valgrind complains about title(b) when the string b contains fancy quotes.

The attached package 'fake_1.0.tar.gz' demonstrates the bug when it is checked with valgrind.

............. Extract from fake-Ex.Rout .................................

>  a <- dQuote("nothing")
>  b <- paste("This package does", a)
>  plot(0:1, 0:1, type="n", xlab="x", ylab="y", main=b)
Warning in title(...) :
  conversion failure on 'This package does “nothing”' in 'mbcsToSbcs': dot substituted for <e2>

==8856== Invalid read of size 1
==8856==    at 0x618AFE8: PostScriptStringWidth (devPS.c:766)
==8856==    by 0x619AE79: PDF_StrWidthUTF8 (devPS.c:8119)
==8856==    by 0x80D361C: GEStrWidth (engine.c:2487)
==8856==    by 0x80D408E: GEText (engine.c:1761)
==8856==    by 0x61C7372: Rf_GText (graphics.c:3030)
==8856==    by 0x61DDA7D: C_title (plot.c:2607)
==8856==    by 0x80BB5E3: do_External (dotcode.c:530)
==8856==    by 0x80C1E8B: do_Externalgr (dotcode.c:1257)
==8856==    by 0x80F0733: bcEval (eval.c:4721)
==8856==    by 0x80F39CA: Rf_eval (eval.c:560)
==8856==    by 0x80F4D9C: Rf_applyClosure (eval.c:1044)
==8856==    by 0x80ED6E5: bcEval (eval.c:4731)
==8856==  Address 0xbef20920 is just below the stack ptr.  To suppress, use: --workaround-gcc296-bugs=yes
Comment 1 Brian Ripley 2015-01-16 10:28:44 UTC
I cannot reproduce this: x86_64 Linux, en_GB.UTF-8 (it does I think need to be in a UTF-8 locale).  Neither with R 3.1.2 nor R-devel.