From ripley at stats.ox.ac.uk  Fri Oct 31 15:26:36 2008
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Fri, 31 Oct 2008 14:26:36 +0000 (GMT)
Subject: [Rd] *** buffer overflow detected ***: /usr/lib64/R/bin/exec/R
 terminated on R 2.6.2 to 2.8.0: logging a bug?
In-Reply-To: <490AFF2B.2020209@biostat.ku.dk>
References: <200810311117.17677.ct529@york.ac.uk>
	<490AF97F.4070505@biostat.ku.dk>
	<200810311237.10402.ct529@york.ac.uk>
	<490AFF2B.2020209@biostat.ku.dk>
Message-ID: <alpine.LFD.2.00.0810311401070.17003@gannet.stats.ox.ac.uk>

On Fri, 31 Oct 2008, Peter Dalgaard wrote:

> Corrado wrote:
>> I apologise .... The dsn is not empty, the database the dsn connects to is
>> empty!
>>
>> You get the same error when connecting to a populated database.
>
> Do I? I wouldn't know...
>
> (You are _still_ not providing steps to reproduce the situation!)
>
> The actual maintainer might know, though, so wait for him to chime in.

He cannot reproduce this, on a Fedora 8 system with buffer overflow 
detection enabled and PostgreSQL 8.2.10 (the one that Fedora supplies). 
As the error is from the PostgreSQL ODBC driver, it is most likely a bug 
in that driver (and there is a long history of problems with PostgreSQL 
ODBC drivers, especially on 64-bit systems).

Note that the error is pretty clearly in /usr/lib64/libodbcpsql.so.2 
calling sprintf, and the buffer passed from RODBC has a length specified 
(correctly) in the SQLGetInfo call.  Thus using sprintf on _that_ buffer 
would of itself be an error.  So there is no evidence here of a 'serious 
problem with RODBC' (and many other people are using it on Linux systems 
with PostgreSQL, and no one else has reported any such issue).


>
> 	-p
>
>>
>> Regards
>>
>>
>> On Friday 31 October 2008 12:26:39 Peter Dalgaard wrote:
>>> Corrado wrote:
>>>> Dear friends,
>>>>
>>>> there is a serious problem with RODBC on R from 2.6.2 to 2.8.0 on a
>>>> postgresql 8.3 database.
>>>>
>>>> Let's say we define an empty dsn called "test", with user "postgres" and
>>>> password "none". We test the connection with another application, and it
>>>> works properly.
>>>>
>>>> When you call the database using RODBC, you get the following:
>>>>> odbcConnect("test","postgres","none")
>>>> *** buffer overflow detected ***: /usr/lib64/R/bin/exec/R terminated
>>>> ======= Backtrace: =========
>>>> /lib64/libc.so.6(__fortify_fail+0x37)[0x2ad38a3f4157]
>>>> /lib64/libc.so.6[0x2ad38a3f27e0]
>>>> /lib64/libc.so.6[0x2ad38a3f1db9]
>>>> /lib64/libc.so.6(_IO_default_xsputn+0x8e)[0x2ad38a379b5e]
>>>> /lib64/libc.so.6(_IO_vfprintf+0x3c22)[0x2ad38a351fa2]
>>>> /lib64/libc.so.6(__vsprintf_chk+0x9d)[0x2ad38a3f1e5d]
>>>> /lib64/libc.so.6(__sprintf_chk+0x80)[0x2ad38a3f1da0]
>>>> /usr/lib64/libodbcpsql.so.2(SQLGetInfo+0x973)[0x2ad38de11013]
>>>> /usr/lib64/libodbc.so.1(SQLGetInfo+0x624)[0x2ad38c5e91a4]
>>>> /usr/lib64/R/library/RODBC/libs/RODBC.so(RODBCGetInfo+0xbb)[0x2ad38c393a9
>>>> b]
>>> -....-
>>>
>>>> OS: Mandriva 2008.1 x86_64
>>>> Postgresql: 8.3.1 (PostGIS enabled)
>>>> R: from 2.6.2 from repository to 2.8.0 repackaged
>>>>
>>>> Is it my doing, or R's doing?
>>> (R-help snipped)
>>>
>>> It looks like that the problem is in the RODBC package, so the
>>> maintainer of RODBC should be informed. For reproducibility, you might
>>> need to be more explicit about how to create an "empty dsn" with postgres.
>>
>>
>>
>
>
> --
>   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
>  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
> (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
> ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907
>
> ______________________________________________
> 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


[Rd] *** buffer overflow detected ***: /usr/lib64/R/bin/exec/R terminated on R 2.6.2 to 2.8.0: logging a bug?
Prof Brian Ripley