[R] data.entry segfault

(Ted Harding) Ted.Harding at nessie.mcc.ac.uk
Fri Dec 13 18:40:03 CET 2002


On 13-Dec-02 Peter Dalgaard BSA wrote:
> I get this (with 1.6.0 installed from the CRAN RPM) SuSE too,
> but *not* on RedHat. More detailed symptoms are [SNIP]...
> 
> It is reproducible with a hand-compiled version and things boil
> down to
> 
> 1243    static KeySym GetKey(DEEvent * event)
> 1244    {
> 1245        char text[1];
> 1246        KeySym iokey;
> 1247
> 1248        XLookupString(event, text, 10, &iokey, 0);
> 1249        return iokey;
> 1250    }
> 
> And the XLookupString call is the culprit. "10" is the buffer length,
> but "text" is declared to have length 1, and in practice has at least 2
> bytes since "text" is \0-terminated...
> 
> Switching to "char text[10];" looks like a likely fix.

Interesting. But why does it give a problem in SuSE (both RPM and
hand-compiled) but not on RedHat? (I too have R also on Red Hat 7.2,
was R-1.2, is now R-1.6.1, and have not had this problem with either
version of R; R-1.4 on SuSE 7.2 however segfaults). Presumably the
same code is compiled on both distributions ... ?

Best wishes,
Ted.




--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 167 1972
Date: 13-Dec-02                                       Time: 17:29:34
------------------------------ XFMail ------------------------------




More information about the R-help mailing list