From jorismeys at gmail.com  Tue Oct  6 14:48:53 2015
From: jorismeys at gmail.com (Joris Meys)
Date: Tue, 6 Oct 2015 14:48:53 +0200
Subject: [Rd] Error generated by .Internal(nchar) disappears when
	debugging
In-Reply-To: <56130E61.8060007@gmail.com>
References: <CAO1zAVYsOWG0QSVdU_wex-Y2U3KD3YEtGJu5nH5zNc8dCzm5ig@mail.gmail.com>
	<loom.20151006T011642-505@post.gmane.org>
	<56130E61.8060007@gmail.com>
Message-ID: <CAO1zAVZZtGsgJWzLfZAb5gn0YMdZaq1PB3cfPuATzRdjOrLsLA@mail.gmail.com>

On Tue, Oct 6, 2015 at 1:57 AM, Duncan Murdoch <murdoch.duncan at gmail.com>
wrote:

> On 05/10/2015 7:24 PM, Matt Dowle wrote:
> > Joris Meys <jorismeys <at> gmail.com> writes:
> >
> >>
> >> Hi all,
> >>
> >> I have a puzzling problem related to nchar. In R 3.2.1, the internal
> > nchar
> >> gained an extra argument (see
> >> https://stat.ethz.ch/pipermail/r-announce/2015/000586.html)
> >>
> >> I've been testing code using the package copula, and at home I'm still
> >> running R 3.2.0 (I know, I know...). When trying the following code, I
> > got
> >> an error:
> >>
> >>> library(copula)
> >>> fgmCopula(0.8)
> >> Error in substr(sc[i], 2, nchar(sc[i]) - 1) :
> >>   4 arguments passed to .Internal(nchar) which requires 3
> >>
> >> Cheers
> >> Joris
> >
> >
> > I'm seeing a similar problem. IIUC, the Windows binary .zip from CRAN of
> > any package using base::nchar is affected. Could someone check my answer
> > here is correct please : http://stackoverflow.com/a/32959306/403310
>
> Nobody has posted a simple reproducible example here, so it's kind of
> hard to say.
>

You're free to try the simple reproducible example I've provided in my
original question. Tried that out on 3 different computers, and I got the
same behaviour 3 times.


>
> I would have guessed that a change to the internal signature of the C
> code underlying nchar() wouldn't have any effect on a package that
> called the R nchar() function.
>
> When I put together my own example (a tiny package containing a function
> calling nchar(), built to .zip using R 3.2.2, installed into R 3.2.0),
> it confirmed my guess.
>
> On the other hand, if some package is calling the .Internal function
> directly, I'd expect that to break.  Packages shouldn't do that.
>

I never said the package called the internal function, because it doesn't.
The error message reports there's an error in substr(sc[i], 2, nchar(sc[i])
- 1). Then it continues to indicate the problem occurs at the moment
nchar() calles the internal function. That's how the core team wrote the
nchar() function.


> So I'd say there's been no evidence posted of a problem in R here,
> though there may be problems in some of the packages involved.  I'd
> welcome an example that provided some usable evidence.
>

With all due respect for your involvement in and knowledge about R, I have
the impression you read too quickly through the mail. There is a problem
and it is reproducible. I'm just not smart enough to figure out how the
problem came about.

Kind regards
Joris


>
> Duncan Murdoch
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



-- 
Joris Meys
Statistical consultant

Ghent University
Faculty of Bioscience Engineering
Department of Mathematical Modelling, Statistics and Bio-Informatics

tel :  +32 (0)9 264 61 79
Joris.Meys at Ugent.be
-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php

	[[alternative HTML version deleted]]



[Rd] Error generated by .Internal(nchar) disappears when debugging
Joris Meys