[R] main/character.c (et.al): dangerous AllocBuffer()

Joerg Kindermann Joerg.Kindermann at gmd.de
Wed Oct 13 16:17:17 CEST 1999


>>>>> " " == Thomas Hoffmann <hoffmann at ehmgs2.et.tu-dresden.de> writes:

     > I was hit by ugly crashes of R, when I tried to read big data sets
     > ("volcano").  So I looked into the code and found the following in
     > character.c (triggered by substr()):

     > I assume that the helper function AllocBuffer() shall facilitate an
     > economic memory management. But the use of realloc() in the
     > else-branch does not conform to ANSI and may hit you with certain
     > compilers.
 (technical stuff deleted)

This seems to explain the seg'faults I got when executing R programs that
manipulate really long strings (I recompiled R with MAXELTSIZE set to
1MEG), using substr and parse.

Thanks for your hints!

--  Dr. Joerg Kindermann             GMD - AiS
            German National Research Center for Information Technology
                Schloss Birlinghoven, D-53754 St. Augustin, Germany
                   phone: +49 02241 142437 fax: +49 02241 142342


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list