BTW, replying to an old thread here but I ran into this issue today with the CvM2SL2Test package. The problem is on line 51 of src/XCvMTest.cc in that package. If you get a stack trace from that memory not mapped location in your code you'll see its from std::sort, because line 51 is violating sort's requirement of "strict weak ordering", because with the given comparison function comp(x,x) == TRUE. If you change the <= to < on that line your problem will go away.
I'll send a patch to the maintainer (CCed). - Murray (Thanks Karl Millar for helping me debug this this afternoon) On Wed, Feb 20, 2013 at 5:30 AM, Santiago Guallar <sgual...@yahoo.com>wrote: > Great Barry! > Thanks for your time. I will e-mail the package maintainers. > > Santi > > From: Barry Rowlingson <b.rowling...@lancaster.ac.uk> > >To: Santiago Guallar <sgual...@yahoo.com> > >Cc: "r-help@r-project.org" <r-help@r-project.org> > >Sent: Wednesday, February 20, 2013 1:36 PM > >Subject: Re: [R] Cramer von Mises test for a discrete distribution > > > >On Wed, Feb 20, 2013 at 10:03 AM, Santiago Guallar <sgual...@yahoo.com> > wrote: > >> Thanks Barry, > >> > >> Following your list order > >> 1) It pops up a window saying R for windows GUI front-end crashed. Below > >> three options: look for on-line solutions; shut down the program; debug > the > >> program (I'm translating from Spanish) > > > >That's good - often people say "crash" when all they have seen is a > >"stop" from R. > > > >> 2) The processor of my laptop is an Intel Core duo 1,60GHz with ram= 4 > GB, > >> 32 bits. The R version I have installed is 2.15.2 (2012-10-26) > > > >Nicely up to date... > > > >> 3) I read the posting-guide. Ok, it may be basic statistics. Question > >> withdrawn > > > >Oh don't do that! You're not asking how to do basic statistics, you > >are trying to do it yourself and getting a crash. Fair question for > >starters... > > > >> I made an additional mistake: I attached the wrong files. Please run the > >> code with these, and you'll see the problem. > > > >Will I, will I, will I.... > > > >> ct1 = cvmts.test(prm, prpmr) # here R crashes > > > >*** caught segfault *** > >address 0x5620e458, cause 'memory not mapped' > > > >Traceback: > >1: .C("CvMTestStat", as.double(x), as.integer(length(x)), > >as.double(y), as.integer(length(y)), testscore = double(1)) > >2: cvmts.test(prm, prpmr) > > > >Possible actions: > >1: abort (with core dump, if enabled) > >2: normal R exit > >3: exit R without saving workspace > >4: exit R saving workspace > >Selection: > > > >Yes! This looks like a bug in that package function, a bit of > >investigation seems to blame it on when you have repeated values in > >the vectors: > > > >> cvmts.test(1:10,1:10) > >[1] 0.025 > >> cvmts.test(rep(1,10),rep(1,10)) > >[1] 0.955 > >> cvmts.test(rep(1,10),rep(2,10)) > > > >*** caught segfault *** > >address 0x514daba8, cause 'memory not mapped' > > > >Traceback: > >1: .C("CvMTestStat", as.double(x), as.integer(length(x)), > >as.double(y), as.integer(length(y)), testscore = double(1)) > >2: cvmts.test(rep(1, 10), rep(2, 10)) > > > >Possible actions: > >1: abort (with core dump, if enabled) > >2: normal R exit > >3: exit R without saving workspace > >4: exit R saving workspace > > > >Functions shouldn't crash like this - so time for you to email the > maintainer: > > > >> packageDescription("CvM2SL2Test")$Maintainer > >[1] "Yuanhui Xiao <yx...@gsu.edu>" > > > >The function disappears into C code, but I suspect its dividing by > >zero somewhere... > > > >Barry > > > > > > > [[alternative HTML version deleted]] > > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.