From maechler at stat.math.ethz.ch  Tue Apr 28 09:50:21 2009
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Tue, 28 Apr 2009 09:50:21 +0200
Subject: [Rd] incorrect output and segfaults from sprintf with %*d
	(PR#13667)
In-Reply-To: <49F60692.1080400@idi.ntnu.no>
References: <20090424104524.DFA4F283432B@mail.pubhealth.ku.dk>
	<971536df0904270805s22bb72a9xce5f17ec8f13f20e@mail.gmail.com>
	<49F60692.1080400@idi.ntnu.no>
Message-ID: <18934.46397.747957.757000@lynne.math.ethz.ch>

>>>>> "vQ" == Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk at idi.ntnu.no>
>>>>>     on Mon, 27 Apr 2009 21:25:06 +0200 writes:

    vQ> Gabor Grothendieck wrote:
    >> On Fri, Apr 24, 2009 at 6:45 AM,
    >> <maechler at stat.math.ethz.ch> wrote:
    >> 
    >>> Yes, the documentation will also have to be amended, but
    >>> apart from that, would people see a big problem with the
    >>> "8192" limit which now is suddenly of greater importance
    >>> {{as I said all along; hence my question to Wacek (and
    >>> the R-develers) if anybody found that limit too low}}
    >>> 
    >> 
> I haven't been following all this but in working with strings
    >> for the gsubfn package my own usage of the package was
    >> primarily for small strings but then I discovered that
    >> others wanted to use it for much larger strings of 25,000
    >> characters, say, and it was necessary to raise the limits
    >> (and there are also performance implications which could
    >> be addressed too). I don't know what the situation is
    >> particularly here but cases where very large strings can
    >> be used include linguistic analysis and computer
    >> generated R code.
    >> 

    vQ> in principle, instead of the quite arbitrary and not
    vQ> justified constant vQ> size limit 8192 [1], one could
    vQ> use dynamic arrays.  this would allow strings of
    vQ> arbitrary length without adding much performance penalty
    vQ> for strings shorter than 8193 bytes.

    vQ> [1] src/include/Defn.h:60

Yes, in principle that would be clearly better.
well-tested ('make check-all') patches are welcome!

Martin



[Rd] incorrect output and segfaults from sprintf with %*d (PR#13667)
Martin Maechler