From ripley at stats.ox.ac.uk  Wed Mar 31 23:26:23 2004
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed Mar 31 23:31:20 2004
Subject: [Rd] segfault in browseURL()
In-Reply-To: <Pine.SOL.4.20.0403311612250.14754-100000@santiam.dfci.harvard.edu>
Message-ID: <Pine.LNX.4.44.0403312219010.28113-100000@gannet.stats>

On Wed, 31 Mar 2004, Jeff Gentry wrote:

> > > Well, the toy example I was using to first verify that it was coming from
> > > browseURL in general was just to do this:
> > > z <- rep("z", 300)
> > > z <- paste(z, collapse="")
> > > browseURL(z)
> > That's not a URL at all, and I get nothing (as I should). If I put http:// 
> > in front it works (as a search item).
> 
> That's not the point.  When it is repped to length 300, it causes a

Yes, it _is_ the point: I do not get a segfault on that example.

> segfault for me.  When it is repped to a length of say, 250 - it simply
> doesn't work properly (as one would expect, because as you so correctly
> pointed out 'aaaaaaa....' isn't a URL.  My point here was to demonstrate
> the segfaulting due to excessively long strings, which at least for me,
> does not seem to be tied to a URL being valid or not.
> 
> Here:
> 
> z <- paste("http://www.r-project.org/", paste(rep("a", 200),
>            collapse=""))
> browseURL(z)
> 
> This gives an error that the URL does not exist.
> 
> z <- paste("http://www.r-project.org/", paste(rep("a", 300),
>            collapse=""))
> browseURL(z)
> 
> This causes a segfault.
> 
> > > This builds up a URL query and then calls 'browseURL(query)'.
> > And you could extract `query' and tell us what that is ....
> 
> [1]
> "http://www.ncbi.nih.gov/entrez/query.fcgi?tool=bioconductor&cmd=Retrieve&db=PubMed&list_uids=12730033%2c12691826%2c12544996%2c12490434%2c12477932%2c12411538%2c12391142%2c12207910%2c11971973%2c11864979%2c10859165%2c10216320%2c10205060%2c3931075%2c3470951%2c3019832%2c2880793%2c2858050%2c2538825%2c1700760%2c1478667"

At last, thank you.  Yes, that segfaults in 1.8.1 but works in the 
current 1.9.0 cvs sources, where what I guessed to be the limit has been 
removed.

-- 
Brian D. Ripley,                  ripley@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] segfault in browseURL()
Prof Brian Ripley