From ripley at stats.ox.ac.uk  Wed Dec  3 18:13:32 2008
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed, 3 Dec 2008 17:13:32 +0000 (GMT)
Subject: [Rd] Matrix dimnames crash (PR#13361)
In-Reply-To: <20081203125009.42B49282EFF6@mail.pubhealth.ku.dk>
References: <20081203125009.42B49282EFF6@mail.pubhealth.ku.dk>
Message-ID: <alpine.LFD.2.00.0812031702110.13705@gannet.stats.ox.ac.uk>

On Wed, 3 Dec 2008, arnima at u.washington.edu wrote:

> In Windows XP, the matrix() function crashes the program when 'dimnames'
> is an empty list:
>
>   matrix(1:4, nrow=2, dimnames=list())
>   # R has encountered a problem and needs to close ...
>
> This bug is specific to WinXP, as Linux64 handles this situation more
> gracefully:
>
>   matrix(1:4, nrow=2, dimnames=list())
>   Error in matrix(1:4, nrow = 2, dimnames = list()) :
>     invalid type (environment) for 'dimnames' (must be a vector)

Actually no (the reported type is wrong, and my x86_64 Linux system also 
crashes).

This case slips though the error-checking, and I've added a final error 
check that will catch it in R-patched.

Thank you for the report.

>
> Thanks,
> Arni
>
> R 2.8.0-patched on WinXP
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] Matrix dimnames crash (PR#13361)
Prof Brian Ripley