ripley at stats.ox.ac.uk
2007-Nov-19 15:50 UTC
[Rd] (PR#10437) segfault on functions with 'source' attribute
I am not sure why you would want to do that, but the C code does assume source attributes were put there by R, and changing tests from !isNull to isString in a few places will fix that. If there is a character vector "source" attribute it should be used: that is the point of such attributes. On Mon, 19 Nov 2007, karl at huftis.org wrote:> Full_Name: Karl Ove Hufthammer > Version: 2.6.0 > OS: Linux (Fedora 7) > Submission from: (NULL) (129.177.61.84) > > > When viewing a function that has its 'source' attribute set to a boolean or a > numeric, R crashes with a segfault. (Setting 'source' to a character vector does > not make R crash, however.) > > Steps to reproduce: > >> attr(lm,"source")=FALSE >> lm > > *** caught segfault *** > address 0x18, cause 'memory not mapped' > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
karl at huftis.org
2007-Nov-20 10:30 UTC
[Rd] (PR#10437) segfault on functions with 'source' attribute
For the record: The reason I used attr(myfun, "source") = FALSE, is that I misread the example 'Tidying R Code' in 'Writing R Extensions', which calls for attr(myfun, "source") = NULL. Somehow setting 'source' to FALSE seems more natural to me than setting it to NULL. ripley at stats.ox.ac.uk:> I am not sure why you would want to do that, but the C code does assume > source attributes were put there by R, and changing tests from !isNull to > isString in a few places will fix that.-- Karl Ove Hufthammer