[Rcpp-devel] (Very) rare segfault

Dirk Eddelbuettel edd at debian.org
Wed Aug 20 20:43:23 CEST 2014


On 20 August 2014 at 20:24, Gregor Kastner wrote:
| Thanks to all three of you for your blazing responses.
| 
| > | 1. Try running the code with `gctortue(TRUE)` on,
| 
| Currently running. Extrapolating from the performance I see now I expect the
| bug to reappear in <10 years...

:)
 
| > | 2. Try running with a debugger (gdb, lldb, valgrind),
| > | 3. Try running with sanitizers (see e.g. Dirk's docker
| > containers: https:// | github.com/eddelbuettel/docker-ubuntu-r)
| > 
| > 3.b  Also https://github.com/eddelbuettel/docker-debian-r with newer
| > compilers 
| > | This should help provide you (and/or us) enough information to diagnose
| > the | problem.
| 
| That requires a bit more studying on my side; I'll get to that immediately
| after finishing those 3 open papers :)
| 
| > Moonshoot:  Do you by chance insert RNGScope instances?  We have at times
| > have had issues with their handshaking of state back to R, temp objects etc
| > pp.
| 
| Alas, magician! Indeed, removing the "RNGScope scope;" line seems to put and
| end to the weirdness. I guess I'll rely on the seed being set in R for now.

RNGScope is not for for seed setting, it is for RNG 'state sanity'. See
Section 6.3 of 'Writing R Extensions' -- worst case you can just call
GetRNGstate() and PutRNGstate() by hand.  Though we never had to recommend
that yet.

Next point then is how use the code. JJ put in some enhancements to make the
(automatically added) RNGscope() safer.  

| BTW, I can now confirm that the issue appeared during the transition from
| 0.10.6 to 0.11.0.

Many things changed around that time :)

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org


More information about the Rcpp-devel mailing list