From p.dalgaard@kubism.ku.dk  Wed May  7 15:10:03 1997
From: p.dalgaard@kubism.ku.dk (Peter Dalgaard BSA)
Date: 07 May 1997 16:10:03 +0200
Subject: R-alpha: Re: contr.helmert: bug (??) don't have the SAME problem
In-Reply-To: Martin Maechler's message of Wed, 7 May 97 14:28:16 +0200
References: <9705071228.AA01474@>
Message-ID: <x24tcfmkzo.fsf@bush.kubism.ku.dk>

Martin Maechler <maechler@stat.math.ethz.ch> writes:

> 
> [I diverged to  R-devel]
> 
> Peter, I cannot reproduce your bug
> I can type
> 
> 	solve(cbind(c(1,1,1,1),contr.helmert(4)))
> 
> many times, and never get an error.
...
> Process R segmentation violation at Wed May  7 14:22:57 1997
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Also, it seems to behave differently in different circumstances. When
I reported it, I had started R from a read-only directory. In my home
directory, I get this:

> A<-contr.helmert(4)
> X<-cbind(c(1,1,1,1),A)
Error: Unimplemented feature in duplicate
> ls()
Error: Unimplemented feature in duplicate
> > ls
Error: Unimplemented feature in deparse2buff

Can you say "random memory overwrite"?

<imagine long and arduous gdb session here>

In main/bind.c:753, I see
STRING(CADR(dn))[j++] = blank;

Later on, during garbage collection, the same memory location gets
marked, setting a bit in the pointer, which gets accessed a split
second later, and... kerunch! 

I suspect that should have said ...=duplicate(blank)  , right? Or is
it the marking process in gcc. Hmm... not sure I got it straight
there, but somehow the "blank" value, which is a SEXP (aka *SEXPREC)
is getting treated as a SEXPREC.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


R-alpha: Re: contr.helmert: bug (??) don't have the SAME problem
Peter Dalgaard BSA