seth at userprimary.net
2008-Nov-14 00:45 UTC
[Rd] R crashes on sprintf with bad format specification (PR#13285)
* On 2008-11-13 at 18:51 -0500 Duncan Murdoch wrote:> On 12/11/2008 8:30 PM, ocheyett at bonddesk.com wrote: >> Full_Name: Oren Cheyette >> Version: 2.7.2 >> OS: Win XP >> Submission from: (NULL) (64.161.123.194) >> >> >> Enter the following at the R command prompt: >>> sprintf("A %S %S %S XYZ", 1, 1, 1); >> >> Note the erroneous capitalized %S instead of %s and the numeric inputs instead >> of strings. With strings there's no crash - R reports bad format >> specifications. > > 2.7.2 is obsolete, but I can confirm a crash on Windows with a recent > R-devel.Can confirm as well on OSX with a fairly recent R-devel. (gdb) bt 10 #0 0x9575e299 in _UTF8_wcsnrtombs () #1 0x957bb3a0 in wcsrtombs_l () #2 0x956ebc1e in __vfprintf () #3 0x95711e66 in sprintf () #4 0x00492bb8 in do_sprintf (call=0x10cb470, op=0x1018924, args=<value temporarily unavailable, due to optimizations>, env=0x10a40b0) at ../../../../R-devel-all/src/main/sprintf.c:179 #5 0x003fe1af in do_internal (call=0x10cb4a8, op=0x100fc38, args=0x10a40e8, env=0x10a40b0) at ../../../../R-devel-all/src/main/names.c:1140 + seth -- Seth Falcon | http://userprimary.net/user/