<div dir="ltr">Update: I seem to have many of the issues resolved, under R 4.2.2 and R-devel, except for a<div>problem that shows up occasionally: RInside::repl() loop terminates immediately after</div><div>a plot, for example, plot(0,0). I upgraded to Rcpp 1.0.10, but this didn't make any difference.</div><div><br></div><div>Many of the problems I reported appear to have been caused by an anti-virus program</div><div>(AVG) that silently deletes files that it thinks are "suspicious" like Rterm.exe. When it</div><div>does this, Windows will not permit the file to be restored to its original location unless</div><div>you reboot: you get an "access denied" message for a file that doesn't exit!</div><div><br></div><div>The work-around is to tell AVG to treat certain directories (like the one containing</div><div>Rterm.exe) as exceptions. I have seen no phantom instances  of processes </div><div>since I made this change, so this may have fixed that problem as well (only</div><div>time will tell).</div><div><br></div><div>Dominick</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div> <div><br></div><div>except that RInline::repl() often terminates<div>immediately after a plot(0,0) command. This happens about 10% of the time.</div><div><br></div><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 25, 2023 at 9:14 AM Dominick Samperi <<a href="mailto:djsamperi@gmail.com">djsamperi@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Just today I simply started R in a CMD window (no Rcpp/RInside), and a new window popped up<div>with the R prompt, instead of just starting the session in the current window. This new window</div><div>goes away after a few seconds and you are left in the original window with an R command prompt.</div><div><br></div><div>I'm using the development version of R, and this has nothing to do with Rcpp/RInside.</div><div><br></div><div>This tends to happen rarely, usually the first time I run R after opening the CMD window. Terminating</div><div>and running R again does not reproduce the problem, so it is somehow dependent on</div><div>operating system context.</div><div><br></div><div>Not sure if this is a bug or a side-effect of a virus infection.</div><div><br></div><div>Dominick</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 23, 2023 at 8:38 PM Dominick Samperi <<a href="mailto:djsamperi@gmail.com" target="_blank">djsamperi@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">The problems I have reported have three possible causes, individually, or<div>in combination. Feedback from experts on this might help.<br><div><div><br></div><div>1. Changes to R internals esp. since R 4.2.0 may break RInline,</div><div>     and also break other FFI apps that I'm working on (Haskell). For</div><div>     example, fetching the address of the SEXP R_NilValue gives an</div><div>     invalid address with R 4.2.2, but does not have this problem</div><div>     with R 4.1.3, for example.</div><div><br></div><div>2. When you start a Windows CMD terminal, at least two threads</div><div>    are started (can be seen in task manager), and sometimes Windows</div><div>    seems to start two instances of your app instead of one. This may</div><div>    be a bug in RInside, or a bug in Windows? Google shows that</div><div>    others have reported problems caused by Windows starting two</div><div>    terminals when you expect one.</div><div><br></div><div>3. There may be problems with the Rinline::repl() code that I have</div><div>     not found yet.</div><div><br></div><div>Dominick</div><div><br></div><div><br></div><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 23, 2023 at 1:43 PM Dirk Eddelbuettel <<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Maintainer of affected package here:<br>
<br>
On 23 January 2023 at 12:20, Dominick Samperi wrote:<br>
| On the changes for R 4.2.0, it is not clear how to distinguish<br>
| R API functions from R internal functions (and this probably<br>
| doesn't matter for Rcpp), but you are correct,<br>
| on closer inspection these changes should not have effected<br>
| the way R_DefParams() was used before R_DefParamsEx()<br>
| was introduced.<br>
| <br>
| It would be helpful if others could test to see if they can reproduce<br>
| the problems I reported. I will submit a pull request when<br>
| ready,<br>
<br>
That would be really appreciated! It really sounds like we could do with an<br>
update of some internals, and as seem to have spent some time in that corner<br>
you are likely right now the most qualified person to do this.<br>
<br>
| and if there is no objection, ifdefs will be included that<br>
| permit compiling Rcpp and RInside using MSVC (there are only<br>
| a few small changes with most of them applying to RInside.cpp).<br>
<br>
I think that is out of scope, and should be not in the pull request, and<br>
RInside repo.<br>
<br>
By all means keep them in a branch / fork of yours if that is how you work,<br>
but the RInside package is part of R ecosystem which has a well-established<br>
empty intersection with the MSVC world and toolchains.<br>
<br>
Dirk<br>
<br>
-- <br>
<a href="http://dirk.eddelbuettel.com" rel="noreferrer" target="_blank">dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>