From |g@ut|er @end|ng |rom gm@||@com  Sat Sep 21 17:37:07 2019
From: |g@ut|er @end|ng |rom gm@||@com (Laurent Gautier)
Date: Sat, 21 Sep 2019 11:37:07 -0400
Subject: [Rd] =?utf-8?q?Error=3A_package_or_namespace_load_failed_for_?=
	=?utf-8?b?4oCYdXRpbHM=?=
In-Reply-To: <23935.16335.343808.52170@stat.math.ethz.ch>
References: <CA+JCgN39_YGcPH7xgc+O8qbRaXZcc6=kqBVDcgQyGyBGJmgoCQ@mail.gmail.com>
 <CA+JCgN3VBrqXLc+Y=wikf19zkoCRNct2Pof0sVxF82RWN-+T1g@mail.gmail.com>
 <23935.16335.343808.52170@stat.math.ethz.ch>
Message-ID: <CA+JCgN3XHKZ4jFh32F2fk7LkHdQQKx9ZZOra2VxqgBN5uPZoDw@mail.gmail.com>

Thanks to all that looked at it and tried to answer.

I am reporting here what I found in the end, in the hope it helps someone
with a similar issue solve it quicker than I solved the one I had:

Having

int R_NaInt;

rather than

extern int R_NaInt;

in the header / C definitions of the cffi interface (part of the header
definitions have to be copied/prepared to be digestable by the C parser
used Python's cffi interface) was enough to send R into a confused state at
initialization (but without an obvious error message).


Le lun. 16 sept. 2019 ? 03:55, Martin Maechler <maechler at stat.math.ethz.ch>
a ?crit :

> >>>>> Laurent Gautier
> >>>>>     on Sun, 15 Sep 2019 15:01:09 -0400 writes:
>
>     > In case a search engine leads someone with the same issue
>     > here, I am documenting the point I reached:
>
>     > I can reproduce the issue with a small example when
>     > forcing R to not load any package at startup time (using
>     > an Renviron file): ``` package <- "utils" lib.loc <-
>     > "<fill this according to your R install>" ns <-
>     > loadNamespace(package, lib.loc) ```
>
>     > The code path goes through
>     > `registerS3methods(nsInfo$S3methods, package, env)` and
>     > there to:
>
>     > ``` if (methods::is(genfun, "genericFunction")) ```
>
>     > The evaluation of `methods::is` reaches the line
>     > triggering the error as `.identC(class1, class2)` and
>     > `.identC(class2, "ANY")` both return `NA` and `NA || NA`
>     > is not defined:
>
>     > ```
>     >> if (NA || NA) { cat("here\n") }
>     > Error in if (NA || NA) { : missing value where TRUE/FALSE
>     > needed ```
>
>     > As I understand it `.identC()` should never return `NA`,
>
> that understanding is correct, it should return TRUE or FALSE,
> nothing else.
>
>     > and if the case this would mean that R itself is an
>     > unstable state (something at the C level that should not
>     > have happened has happened) but this was not caught
>     > earlier.
>
> yes.. something like that...
> My current diagnosis would be that something in your embedding of R
> happened
> in a way that "broke R entirely" ...
> but note that I know almost nothing about embedding R.
>
> Martin
>

	[[alternative HTML version deleted]]



[Rd] =?utf-8?q?Error=3A_package_or_namespace_load_failed_for_?= =?utf-8?b?4oCYdXRpbHM=?=
Laurent Gautier