Bug 17158 - matrix indexing broken for long matrix
Summary: matrix indexing broken for long matrix
Alias: None
Product: R
Classification: Unclassified
Component: Low-level (show other bugs)
Version: R-devel (trunk)
Hardware: x86_64/x64/amd64 (64-bit) Linux-RHEL
: P5 normal
Assignee: R-core
Depends on:
Reported: 2016-09-23 19:07 UTC by Michael Schubmehl
Modified: 2016-10-10 19:58 UTC (History)
1 user (show)

See Also:

patch to subset.c (899 bytes, patch)
2016-09-23 19:07 UTC, Michael Schubmehl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Schubmehl 2016-09-23 19:07:05 UTC
Created attachment 2162 [details]
patch to subset.c

The following matrix indexing operation errors:

a = matrix(0,47000,47000)
Error: long vectors not supported yet: subset.c:753

I believe this is due to the use of LENGTH instead of XLENGTH on that line and the following few lines. Attached is a patch that seems to resolve the issue. Thanks!
Comment 1 Martin Maechler 2016-10-10 19:58:04 UTC
Thank you!   Indeed, all is as you say.
I've confirmed the problem and that your patch fixes it.

I've committed it to R-devel  and will port it to R-patched ... which should become R 3.3.2 by the end of the month.