s-news
[Top] [All Lists]

Re: (Summary) Function that kills S-Plus 2000

To: "'s-news@wubios.wustl.edu'" <s-news@wubios.wustl.edu>
Subject: Re: (Summary) Function that kills S-Plus 2000
From: Andrej Blejec <andrej.blejec@Uni-Lj.si>
Date: Mon, 05 Feb 2001 08:27:51 +0100
In-reply-to: <21255707C24105438C5BEA7061D33228332338@ESSEX.nps.navy.mil>
Organization: NIB
Reply-to: Andrej.Blejec@Uni-Lj.si
I tried death() function with S-PLUS 2000 on Windows98 and it kills 
it too.

Andrej


On 1 Feb 2001, at 9:05, Buttrey, Samuel wrote:

> I posted a function that kills S-Plus 2000 rel. 3 under NT. Amazingly, I
> enticed some people to try it out. Sure enough, it crashes for others, too.
> It turns out I've discovered a bug although precisely what the problem is
> isn't clear.
> 
> Thanks to Patrick Connolly, Henrik Nielsen and Steve McKinney (of
> Insightful, formerly MathSoft) for spending time on this.
> 
> Patrick Connolly used my function (wittily named death() ) to kill Version
> 3.4 (Solaris), but, he says, "it doesn't have the whole world crashing down.
> Only one process dies.  The emacs session in which I was running Splus is
> still there, complete with the text of the function ready to have another
> go.  It takes about 3 seconds to be back where I was...it might be worth
> your time investigating [emacs and ESS with Windows]"
> 
> Henrik Neilsen (using Ver.  5.1 under HP-UX 10.20) noticed that I didn't
> have a return value in my function and says, " If I add 'return(ccn)' in the
> end of the function I get:
> 
> > death()
> Problem in prmatrix(x, rowlab = dn[[1.]], collab = c..: collab is wrong
> length...
> 
> "Before the last assignment [I had]:
> > little
>  11111 33333 2222222 
>      1     1       2
> > ccn
>  1111111 2222222 3333333 4444444 5555555 
>        0       7       0       0       0
> > ccn[names(little)]
>  1111111 3333333 2222222 
>        0       0       7
> 
> I am having trouble seeing the logic in this. It seems as if the names are
> matched as in the pmatch function?  - Is this documented anywhere?"
> 
> A fine question. I will say that the problem does *not* lie in the fact that
> the mis-matched names in "little" happen to be shortened versions of the
> names in "ccn," because if I replace "11111" and "33333" by "811111" and
> "833333," I get another crash.
> 
> 
> Steve McKinney from Insightful (they're the people who make S-Plus, by the
> way) was abel to replicate my crash on S-Plus 2000 ver. 3 under NT. He notes
> that using the function as presented, S-Plus 6.0 beta for Windows doesn't
> die. However if he adds ccn as a return value, he gets the same "Problem"
> message that Henrik got.
> S-PLUS 6.0 beta for windows does not die. "So," Steve says, "something is
> amiss internally."
> 
> Steve modified death() into the poetically-named phoenix() by replacing the
> offending line
> 
> ccn[names(little)] <- ccn[names(little)] + little
> 
> with 
> 
>  ccn[match(names(little), names(ccn), nomatch = 0)] <-
>           ccn[match(names(little), names(ccn), nomatch = 0)] +
>             little[match(names(ccn), names(little), nomatch = 0)]
> 
> and once again the sun shone on the users of S-Plus. Many thanks to all!
> 
> Sam ("The S-Plus Slayer") Buttrey
> buttrey@nps.navy.mil
> 
> -----Original Message-----
> From: Buttrey, Samuel [mailto:sebuttre@nps.navy.mil]
> Sent: Wednesday, January 31, 2001 4:59 PM
> To: 's-news@wubios.wustl.edu'
> Subject: [S] function that kills S-Plus 2000
> 
> 
> Hi. Here's a cool function that kills S-Plus 2000 rel. 3 running under NT.
> What I was trying to do was build up a cumulative table from a bunch of
> little tables. I had expected each of the little tables (called "little"
> below) to have a subset of the levels in the big table (called "ccn"). I had
> forgotten that table() puts the entries in order, so I wanted to prepare for
> the case where "little"'s names weren't in the same order as "ccn"'s. The
> key is this line:
> 
> ccn[names(little)] <- ccn[names(little)] + little
> 
> This seems reasonable: increment only the entries of "ccn" which appear as
> names of "little." When the names of "little" do indeed form a subset of
> those of "ccn," all is well. But in the example below, my whole S-Plus
> session crashes, whether I run this inside the function or at the command
> line. Is that a little odd? At least once it ran at the command line, doing
> vaguely what I expect (which is the creation of new entries of ccn with the
> offending names). But from inside a function it crashes every time.
> 
> Does anyone dare try it and see what happens? I'd appreciate it: but only do
> it if you're prepared to have your whole world come crashing down.
> 
> Thanks,
> 
> Sam ("The S-Plus Killer") Buttrey
> buttrey@nps.navy.mil
> 
> > death
> function()
> {
> #
> # Death: Program to kill S-Plus 2000 rel. 3 on Windows NT
> #
> # Create a factor with five levels. Then create the "ccn" table, which has
> el
> ements
> # in only one of these levels.
> # 
>       ccn.entries <- rep(2222222, 7)
>       ccn.labels <- (1:5) * 1111111
>       ccn.entries <- factor(ccn.entries, labels = ccn.labels, levels = 
>               ccn.labels)
>       ccn <- table(ccn.entries)       #
> #
> # Okay. Now build a "little" table, with three names. One of the three
> appear
> s among
> # the names in "ccn," and the other two don't.
> #
>       little <- c(11111, 33333, 2222222, 2222222)
>       little <- table(little) #
> #
> # Add the entries of little to the corresponding entries of ccn. And die!
> #
>       ccn[names(little)] <- ccn[names(little)] + little
> }
> ---------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu.  To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message:  unsubscribe s-news


----------------------------------------------------
dr. Andrej Blejec
National Institute of Biology
Vecna pot 111 POB 141
SI-1001 Ljubljana
SLOVENIA

E-mail: andrej.blejec@uni-lj.si
Tel: + 386 1 423-33-88
Fax: + 386 1 423-50-38
----------------------------------------------------

<Prev in Thread] Current Thread [Next in Thread>