[R] segfault 'memory not mapped', dual core problem?
I encountered a segfault running glm() and wonder if it could have something to do with the way memory is handled in a dual core system (which I just set up). I'm running R-base-2.4.0-1, installed from the SuSE 10.1 x86_64 rpm (obtained from CRAN). (My processor is an AMD Athlon 64 x2 4800+). The error and traceback are *** caught segfault *** address 0x8001326f2b, cause 'memory not mapped' Traceback: 1: any(is.na(varmu)) 2: glm.fit(x = X, y = Y, weights = weights, start = start, etastart = etastart, mustart = mustart, offset = offset, family = family, control = control, intercept = attr(mt, intercept) 0) 3: glm(y ~ x, family = binomial(logit), data = da) 4: ... Note that this does NOT happen every time I make this call to glm(). I'm calling glm() in a loop and it executed correctly many times. The seqfault occurred while I was running two instances of R (in separate Linux processes), so both cores were being utilized. Free memory exceeded the swap memory in use, so I don't think that there was a lot of swapping going on. Any thoughts on what might have caused this to happen - and how to avoid it - would be appreciated. thanks, bw __ R-help@stat.math.ethz.ch 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.
Re: [R] segfault 'memory not mapped', dual core problem?
Barnet Wagman [EMAIL PROTECTED] writes: I encountered a segfault running glm() and wonder if it could have something to do with the way memory is handled in a dual core system (which I just set up). I'm running R-base-2.4.0-1, installed from the SuSE 10.1 x86_64 rpm (obtained from CRAN). (My processor is an AMD Athlon 64 x2 4800+). The error and traceback are *** caught segfault *** address 0x8001326f2b, cause 'memory not mapped' Traceback: 1: any(is.na(varmu)) 2: glm.fit(x = X, y = Y, weights = weights, start = start, etastart = etastart, mustart = mustart, offset = offset, family = family, control = control, intercept = attr(mt, intercept) 0) 3: glm(y ~ x, family = binomial(logit), data = da) 4: ... Note that this does NOT happen every time I make this call to glm(). I'm calling glm() in a loop and it executed correctly many times. The seqfault occurred while I was running two instances of R (in separate Linux processes), so both cores were being utilized. Free memory exceeded the swap memory in use, so I don't think that there was a lot of swapping going on. Any thoughts on what might have caused this to happen - and how to avoid it - would be appreciated. It's highly unlikely that the dual core has anything to do with it unless your system is overheating or has a hardware problem. Instead, see if you can create a script that reproduces the issue (if random numbres are involved, use set.seed) and/or run R with the -d gdb switch on and see if you can get a traceback. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch 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.
Re: [R] segfault 'memory not mapped', dual core problem?
Benilton Carvalho [EMAIL PROTECTED] writes: I had a similar problem, but with the silhouette() function. I figured that the function expected that the grouping variable started from 1, ie., if for some reason on my obs I didn't have any observation on group 1, the function would return me random numbers and repeated execution of the code would cause a seg. fault. My fix was to remap my group variable so that it would always start from 1. Ugh! You shouldn't fix something like that, instead try your very best to find circumstances where you reproduce the crash as quickly as possible, prefering using a minimal setup without external data, and report it (or try debugging it yourself). Maybe something like this is happening with you? cheers, b On Nov 12, 2006, at 3:05 PM, Barnet Wagman wrote: I encountered a segfault running glm() and wonder if it could have something to do with the way memory is handled in a dual core system (which I just set up). I'm running R-base-2.4.0-1, installed from the SuSE 10.1 x86_64 rpm (obtained from CRAN). (My processor is an AMD Athlon 64 x2 4800+). The error and traceback are *** caught segfault *** address 0x8001326f2b, cause 'memory not mapped' Traceback: 1: any(is.na(varmu)) 2: glm.fit(x = X, y = Y, weights = weights, start = start, etastart = etastart, mustart = mustart, offset = offset, family = family, control = control, intercept = attr(mt, intercept) 0) 3: glm(y ~ x, family = binomial(logit), data = da) 4: ... Note that this does NOT happen every time I make this call to glm(). I'm calling glm() in a loop and it executed correctly many times. The seqfault occurred while I was running two instances of R (in separate Linux processes), so both cores were being utilized. Free memory exceeded the swap memory in use, so I don't think that there was a lot of swapping going on. Any thoughts on what might have caused this to happen - and how to avoid it - would be appreciated. thanks, bw __ R-help@stat.math.ethz.ch 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. __ R-help@stat.math.ethz.ch 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. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch 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.
Re: [R] segfault 'memory not mapped', dual core problem?
It's highly unlikely that the dual core has anything to do with it unless your system is overheating or has a hardware problem. Instead, see if you can create a script that reproduces the issue (if random numbres are involved, use set.seed) and/or run R with the -d gdb switch on and see if you can get a traceback. ^ Are there random numbers involved in estimating a logit (which is what I was running)? (I'm not using any random numbers in my functions or in generating my data.) I wouldn't have thought so, but then I don't really understand how logit estimations are actually calculated. __ R-help@stat.math.ethz.ch 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.
Re: [R] segfault 'memory not mapped', dual core problem?
What failed for you did not fail for me. version _ platform powerpc-apple-darwin7.9.0 arch powerpc os darwin7.9.0 system powerpc, darwin7.9.0 status major2 minor2.1 year 2005 month12 day 20 svn rev 36812 language R Just to help bound the problem, Jeff On Nov 12, 2006, at 3:55 PM, Benilton Carvalho wrote: On Nov 12, 2006, at 3:35 PM, Peter Dalgaard wrote: My fix was to remap my group variable so that it would always start from 1. Ugh! You shouldn't fix something like that, instead try your very best to find circumstances where you reproduce the crash as quickly as possible, prefering using a minimal setup without external data, and report it (or try debugging it yourself). I reported on Sep 7th (the maintainer directly). But I haven't heard back, nor the solution implemented yet. Probably a matter of time? Anyways, all one need to do is: # require(cluster) set.seed(1) x=rnorm(100) g=sample(2:4, 100, replace=T) for (i in 1:10){ print(i) tmp1=silhouette(g, dist(x)) } ## the above fails on the 2nd step, ie, i==2. But using the code below, it works as expected. # require(cluster) set.seed(1) x=rnorm(100) g=sample(2:4, 100, replace=T) for (i in 1:1000){ print(i) tmp2=silhouette(as.numeric(as.factor(g)), dist(x)) } ## Btw, tmp1 and tmp2 are two different results... Cheers, Benilton __ R-help@stat.math.ethz.ch 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. __ R-help@stat.math.ethz.ch 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.
Re: [R] segfault 'memory not mapped', dual core problem?
Benilton Carvalho [EMAIL PROTECTED] writes: On Nov 12, 2006, at 3:35 PM, Peter Dalgaard wrote: My fix was to remap my group variable so that it would always start from 1. Ugh! You shouldn't fix something like that, instead try your very best to find circumstances where you reproduce the crash as quickly as possible, prefering using a minimal setup without external data, and report it (or try debugging it yourself). I reported on Sep 7th (the maintainer directly). But I haven't heard back, nor the solution implemented yet. Probably a matter of time? Ah, good. As things should be. I'm sure Martin will get to it. -p Anyways, all one need to do is: # require(cluster) set.seed(1) x=rnorm(100) g=sample(2:4, 100, replace=T) for (i in 1:10){ print(i) tmp1=silhouette(g, dist(x)) } ## the above fails on the 2nd step, ie, i==2. But using the code below, it works as expected. # require(cluster) set.seed(1) x=rnorm(100) g=sample(2:4, 100, replace=T) for (i in 1:1000){ print(i) tmp2=silhouette(as.numeric(as.factor(g)), dist(x)) } ## Btw, tmp1 and tmp2 are two different results... Cheers, Benilton -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch 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.
Re: [R] segfault 'memory not mapped', dual core problem?
Barnet Wagman [EMAIL PROTECTED] writes: It's highly unlikely that the dual core has anything to do with it unless your system is overheating or has a hardware problem. Instead, see if you can create a script that reproduces the issue (if random numbres are involved, use set.seed) and/or run R with the -d gdb switch on and see if you can get a traceback. ^ Are there random numbers involved in estimating a logit (which is what I was running)? (I'm not using any random numbers in my functions or in generating my data.) I wouldn't have thought so, but then I don't really understand how logit estimations are actually calculated. Only if you use simulated data. Do you get the crash in the same place if you rerun the same code on the same data? -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch 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.
Re: [R] segfault 'memory not mapped', dual core problem?
Mea culpa. Please accept my apologies... The problem was fixed on R-2.4.0 (final) and what I reported was on R-2.4.0 alpha. Good job of Martin, by the way... The problem was fixed and I didn't notice (given that I was always using my work-around). benilton __ R-help@stat.math.ethz.ch 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.