Skip to content
Prev 31982 / 63424 Next

sprintf causes a segfault (PR#13613)

strangely enough, the way r handles the same sequence of expressions on
different occasions varies:

    # fresh session 1
    e = simpleError('foo')
    sprintf('%s', e)
    # segfault: address 0x202, cause memory not mapped
    # ^c
    sprintf('%s', e)
    # error in sprintf("%s", e) : 'getEncChar' must be called on a CHARSXP
  
    # fresh session 2
    e = simpleError('foo')
    sprintf('%s', e)
    # segfault: address (nil), cause memory not mapped
    # ^c
    sprintf('%s', e)
    # segfault, exit

note the difference in the address and how this relates to the outcome
of the second execution of sprintf('%s', e)

vQ
Waclaw.Marcin.Kusnierczyk at idi.ntnu.no wrote: