more Matrix weirdness

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

more Matrix weirdness

bbolker
   Am I being too optimistic in expecting this (mixing and matching
matrices and Matrices) to work?  If x is a matrix and m is a Matrix,
replacing a commensurately sized sub-matrix of x with m throws "number
of items to replace is not a multiple of replacement length" ...

x <- matrix(0,nrow=3,ncol=10, dimnames=list(letters[1:3],LETTERS[1:10]))
rr <- c("a","b","c")
cc <- c("B","C","E")
m <- Matrix(matrix(1:9,3,3))
x[rr,cc] <- m

    cheers
     Ben Bolker

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: more Matrix weirdness

Rui Barradas
Hello,

R 4.0.2 on Ubuntu 20.04, sessionInfo() below.

I can reproduce this, sort of. The error I'm getting is different:


x[rr, cc] <- m
#Error in x[rr, cc] <- m : replacement has length zero

But if I check lengths and dimensions, they are identical().

identical(length(x[rr, cc]), length(m))
#[1] TRUE
identical(dim(x[rr, cc]), dim(m))
#[1] TRUE


What works is


x[rr, cc] <- as.matrix(m)

I ran Ben's code on RStudio 1.3.1073, the following is run with Rscript
and the error message is the same.


rui@rui:~$ Rscript --vanilla rhelp.R
R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
  [1] LC_CTYPE=pt_PT.UTF-8       LC_NUMERIC=C
  [3] LC_TIME=pt_PT.UTF-8        LC_COLLATE=pt_PT.UTF-8
  [5] LC_MONETARY=pt_PT.UTF-8    LC_MESSAGES=pt_PT.UTF-8
  [7] LC_PAPER=pt_PT.UTF-8       LC_NAME=C
  [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=pt_PT.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] Matrix_1.2-18

loaded via a namespace (and not attached):
[1] compiler_4.0.2  grid_4.0.2      lattice_0.20-41
Error in x[rr, cc] <- m :
   number of items to replace is not a multiple of replacement length
Execution halted


Hope this helps,

Rui Barradas


Às 03:04 de 09/09/20, Ben Bolker escreveu:

>    Am I being too optimistic in expecting this (mixing and matching
> matrices and Matrices) to work?  If x is a matrix and m is a Matrix,
> replacing a commensurately sized sub-matrix of x with m throws "number
> of items to replace is not a multiple of replacement length" ...
>
> x <- matrix(0,nrow=3,ncol=10, dimnames=list(letters[1:3],LETTERS[1:10]))
> rr <- c("a","b","c")
> cc <- c("B","C","E")
> m <- Matrix(matrix(1:9,3,3))
> x[rr,cc] <- m
>
>     cheers
>      Ben Bolker
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: more Matrix weirdness

Georgi Boshnakov
In reply to this post by bbolker
I think that this is because `[<-` dispatches on S4 methods only if the first argument is S4.  
?"[<-" says:

"These operators are also implicit S4 generics, but as primitives,
     S4 methods will be dispatched only on S4 objects ‘x’."

Georgi Boshnakov

-----Original Message-----


Message: 19
Date: Tue, 8 Sep 2020 22:04:44 -0400
From: Ben Bolker <[hidden email]>
To: r-devel <[hidden email]>
Subject: [Rd] more Matrix weirdness
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

   Am I being too optimistic in expecting this (mixing and matching
matrices and Matrices) to work?  If x is a matrix and m is a Matrix,
replacing a commensurately sized sub-matrix of x with m throws "number
of items to replace is not a multiple of replacement length" ...

x <- matrix(0,nrow=3,ncol=10, dimnames=list(letters[1:3],LETTERS[1:10]))
rr <- c("a","b","c")
cc <- c("B","C","E")
m <- Matrix(matrix(1:9,3,3))
x[rr,cc] <- m

    cheers
     Ben Bolker




------------------------------

Message: 20
Date: Wed, 9 Sep 2020 07:03:47 +0100
From: Rui Barradas <[hidden email]>
To: Ben Bolker <[hidden email]>, r-devel <[hidden email]>
Subject: Re: [Rd] more Matrix weirdness
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

Hello,

R 4.0.2 on Ubuntu 20.04, sessionInfo() below.

I can reproduce this, sort of. The error I'm getting is different:


x[rr, cc] <- m
#Error in x[rr, cc] <- m : replacement has length zero

But if I check lengths and dimensions, they are identical().

identical(length(x[rr, cc]), length(m))
#[1] TRUE
identical(dim(x[rr, cc]), dim(m))
#[1] TRUE


What works is


x[rr, cc] <- as.matrix(m)

I ran Ben's code on RStudio 1.3.1073, the following is run with Rscript
and the error message is the same.


rui@rui:~$ Rscript --vanilla rhelp.R
R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.1 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
  [1] LC_CTYPE=pt_PT.UTF-8       LC_NUMERIC=C
  [3] LC_TIME=pt_PT.UTF-8        LC_COLLATE=pt_PT.UTF-8
  [5] LC_MONETARY=pt_PT.UTF-8    LC_MESSAGES=pt_PT.UTF-8
  [7] LC_PAPER=pt_PT.UTF-8       LC_NAME=C
  [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=pt_PT.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] Matrix_1.2-18

loaded via a namespace (and not attached):
[1] compiler_4.0.2  grid_4.0.2      lattice_0.20-41
Error in x[rr, cc] <- m :
   number of items to replace is not a multiple of replacement length
Execution halted


Hope this helps,

Rui Barradas


Às 03:04 de 09/09/20, Ben Bolker escreveu:

>    Am I being too optimistic in expecting this (mixing and matching
> matrices and Matrices) to work?  If x is a matrix and m is a Matrix,
> replacing a commensurately sized sub-matrix of x with m throws "number
> of items to replace is not a multiple of replacement length" ...
>
> x <- matrix(0,nrow=3,ncol=10, dimnames=list(letters[1:3],LETTERS[1:10]))
> rr <- c("a","b","c")
> cc <- c("B","C","E")
> m <- Matrix(matrix(1:9,3,3))
> x[rr,cc] <- m
>
>     cheers
>      Ben Bolker
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel




------------------------------

Message: 21
Date: Wed, 9 Sep 2020 08:27:06 +0200
From: Uwe Ligges <[hidden email]>
To: [hidden email]
Subject: Re: [Rd] failing automatic incoming check
Message-ID:
        <[hidden email]>
Content-Type: text/plain; charset="utf-8"; Format="flowed"



On 08.09.2020 21:34, Sebastian P. Luque wrote:

> Hello,
>
> I got a notification regarding a failure to pass incoming checks
> automatically after a CRAN submission.  The details are given here:
>
> https://win-builder.r-project.org/incoming_pretest/diveMove_1.5.0_20200908_191325/
>
> The only visible issue is a NOTE from the macosx build, with the very
> terse:
>
> "No Protocol Specified"
>
> My searches suggest this can be ignored, but it would be nice to squash
> it.  Any tips welcome.
>


For some reason this should hgave undergone manual inpection but got
auto rejected. Ideally you would reduce the test timing so that the
overall check time is less than 10 min .

Best,
Uwe Ligges




------------------------------

Message: 22
Date: Wed, 9 Sep 2020 16:48:40 +1000
From: Hugh Parsonage <[hidden email]>
To: Jeroen Ooms <[hidden email]>
Cc: Tomas Kalibera <[hidden email]>, Luke Tierney
        <[hidden email]>,  R-devel <[hidden email]>, Martin
        Maechler <[hidden email]>
Subject: Re: [Rd] [External] Re: Operations with long altrep vectors
        cause segfaults on Windows
Message-ID:
        <[hidden email]>
Content-Type: text/plain; charset="utf-8"

I am unable to set break or use gdb with any success when I use that version.

On linux I would do R -d gdb but this gives "unknown option '-d' "
while gdb R.exe (in the same directory as the debug version) gives the
same output as before.

I'm happy to help but I appreciate this list might not be the best
place to get a tutorial on using gdb on Windows.

On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms <[hidden email]> wrote:

>
> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms <[hidden email]> wrote:
> >
> > On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera <[hidden email]> wrote:
> > >
> > > On 9/8/20 4:48 PM, Hugh Parsonage wrote:
> > > > Unfortunately I only get
> > > >
> > > > [Thread 21752.0x4aa8 exited with code 3221225477]
> > > > [Thread 21752.0x4514 exited with code 3221225477]
> > > > [Thread 21752.0x3f10 exited with code 3221225477]
> > > > [Inferior 1 (process 21752) exited with code 030000000005]
> > > >
> > > > (I'm guessing I would need to build an instrumented version of R, or
> > > > can R be debugged using gdb with an off-the-shelf installation?)
> > >
> > > No, the default build lacks debug symbols. You need a build with debug
> > > symbols, and if you can reproduce in a build without compiler
> > > optimizations (-O0), the backtrace may be easier to interpret. Some bugs
> > > however "disappear" when optimizations are disabled. You can build R
> > > from source (and there may be debug builds provided by someone else
> > > (Jeroen?)).
> >
> > Debug builds for each revision are available from
> > https://r-devel.github.io . To download the installer you need to
> > click the github icon in the last column in the table. You need to be
> > signed in with a (free) Github account in order to download builds
> > (artifacts) from Github actions. It will show download links for both
> > the regular installer and installer with debug symbols.
> >
> > In other news, the https://r-devel.github.io table also shows that the
> > fix that martin committed is segfaulting on 32-bit.
>
> Sorry that was inaccurate, it is not segfaulting at all, but the unit
> test is raising an error on 32-bit.




------------------------------

Message: 23
Date: Wed, 9 Sep 2020 09:03:05 +0200
From: Tomas Kalibera <[hidden email]>
To: Hugh Parsonage <[hidden email]>, Jeroen Ooms
        <[hidden email]>
Cc: Luke Tierney <[hidden email]>, R-devel
        <[hidden email]>, Martin Maechler <[hidden email]>
Subject: Re: [Rd] [External] Re: Operations with long altrep vectors
        cause segfaults on Windows
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

On 9/9/20 8:48 AM, Hugh Parsonage wrote:
> I am unable to set break or use gdb with any success when I use that version.
>
> On linux I would do R -d gdb but this gives "unknown option '-d' "
> while gdb R.exe (in the same directory as the debug version) gives the
> same output as before.
>
> I'm happy to help but I appreciate this list might not be the best
> place to get a tutorial on using gdb on Windows.

Essentially, the steps are: build with DEBUG=T (to have debug symbols),
possibly updating EOPTS in MkRules.local to disable optimizations, then
run gdb loading RGui, "set solib-search-path", run RGui from gdb. Then
you can break to debugger from RGui menu, or just run the code that
segfaults, and you get to gdb and can print the stacktrace, etc. You can
find some information in rw-FAQ (R for Windows FAQ), but yes, it is
harder than on Linux. We can take care of this report, but of course in
the longer term it would help if more people could take their time to
setup debugging and analyze bugs even on Windows.

Tomas

>
> On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms <[hidden email]> wrote:
>> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms <[hidden email]> wrote:
>>> On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera <[hidden email]> wrote:
>>>> On 9/8/20 4:48 PM, Hugh Parsonage wrote:
>>>>> Unfortunately I only get
>>>>>
>>>>> [Thread 21752.0x4aa8 exited with code 3221225477]
>>>>> [Thread 21752.0x4514 exited with code 3221225477]
>>>>> [Thread 21752.0x3f10 exited with code 3221225477]
>>>>> [Inferior 1 (process 21752) exited with code 030000000005]
>>>>>
>>>>> (I'm guessing I would need to build an instrumented version of R, or
>>>>> can R be debugged using gdb with an off-the-shelf installation?)
>>>> No, the default build lacks debug symbols. You need a build with debug
>>>> symbols, and if you can reproduce in a build without compiler
>>>> optimizations (-O0), the backtrace may be easier to interpret. Some bugs
>>>> however "disappear" when optimizations are disabled. You can build R
>>>> from source (and there may be debug builds provided by someone else
>>>> (Jeroen?)).
>>> Debug builds for each revision are available from
>>> https://r-devel.github.io . To download the installer you need to
>>> click the github icon in the last column in the table. You need to be
>>> signed in with a (free) Github account in order to download builds
>>> (artifacts) from Github actions. It will show download links for both
>>> the regular installer and installer with debug symbols.
>>>
>>> In other news, the https://r-devel.github.io table also shows that the
>>> fix that martin committed is segfaulting on 32-bit.
>> Sorry that was inaccurate, it is not segfaulting at all, but the unit
>> test is raising an error on 32-bit.




------------------------------

Message: 24
Date: Wed, 9 Sep 2020 17:30:17 +1000
From: Hugh Parsonage <[hidden email]>
To: Tomas Kalibera <[hidden email]>
Cc: Jeroen Ooms <[hidden email]>, Luke Tierney
        <[hidden email]>,  R-devel <[hidden email]>, Martin
        Maechler <[hidden email]>
Subject: Re: [Rd] [External] Re: Operations with long altrep vectors
        cause segfaults on Windows
Message-ID:
        <[hidden email]>
Content-Type: text/plain; charset="utf-8"

Thank you!

I get

Starting program: C:\R\R-devel-20200909\bin\x64\Rgui.exe
[New Thread 19940.0x638c]
[New Thread 19940.0x102c]
[New Thread 19940.0x329c]
[New Thread 19940.0x37dc]
warning: Invalid parameter passed to C runtime function.

Program received signal SIGSEGV, Segmentation fault.
0x000000006c72d206 in compact_intseq_Dataptr (x=0x12783350,
writeable=<optimized out>) at altclasses.c:169
169     altclasses.c: No such file or directory.

On Wed, 9 Sep 2020 at 17:03, Tomas Kalibera <[hidden email]> wrote:

>
> On 9/9/20 8:48 AM, Hugh Parsonage wrote:
> > I am unable to set break or use gdb with any success when I use that version.
> >
> > On linux I would do R -d gdb but this gives "unknown option '-d' "
> > while gdb R.exe (in the same directory as the debug version) gives the
> > same output as before.
> >
> > I'm happy to help but I appreciate this list might not be the best
> > place to get a tutorial on using gdb on Windows.
>
> Essentially, the steps are: build with DEBUG=T (to have debug symbols),
> possibly updating EOPTS in MkRules.local to disable optimizations, then
> run gdb loading RGui, "set solib-search-path", run RGui from gdb. Then
> you can break to debugger from RGui menu, or just run the code that
> segfaults, and you get to gdb and can print the stacktrace, etc. You can
> find some information in rw-FAQ (R for Windows FAQ), but yes, it is
> harder than on Linux. We can take care of this report, but of course in
> the longer term it would help if more people could take their time to
> setup debugging and analyze bugs even on Windows.
>
> Tomas
>
> >
> > On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms <[hidden email]> wrote:
> >> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms <[hidden email]> wrote:
> >>> On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera <[hidden email]> wrote:
> >>>> On 9/8/20 4:48 PM, Hugh Parsonage wrote:
> >>>>> Unfortunately I only get
> >>>>>
> >>>>> [Thread 21752.0x4aa8 exited with code 3221225477]
> >>>>> [Thread 21752.0x4514 exited with code 3221225477]
> >>>>> [Thread 21752.0x3f10 exited with code 3221225477]
> >>>>> [Inferior 1 (process 21752) exited with code 030000000005]
> >>>>>
> >>>>> (I'm guessing I would need to build an instrumented version of R, or
> >>>>> can R be debugged using gdb with an off-the-shelf installation?)
> >>>> No, the default build lacks debug symbols. You need a build with debug
> >>>> symbols, and if you can reproduce in a build without compiler
> >>>> optimizations (-O0), the backtrace may be easier to interpret. Some bugs
> >>>> however "disappear" when optimizations are disabled. You can build R
> >>>> from source (and there may be debug builds provided by someone else
> >>>> (Jeroen?)).
> >>> Debug builds for each revision are available from
> >>> https://r-devel.github.io . To download the installer you need to
> >>> click the github icon in the last column in the table. You need to be
> >>> signed in with a (free) Github account in order to download builds
> >>> (artifacts) from Github actions. It will show download links for both
> >>> the regular installer and installer with debug symbols.
> >>>
> >>> In other news, the https://r-devel.github.io table also shows that the
> >>> fix that martin committed is segfaulting on 32-bit.
> >> Sorry that was inaccurate, it is not segfaulting at all, but the unit
> >> test is raising an error on 32-bit.
>
>




------------------------------

Message: 25
Date: Wed, 9 Sep 2020 08:00:41 +0000
From: "Koenker, Roger W" <[hidden email]>
To: r-devel <[hidden email]>
Subject: [Rd] Environmental Messaging
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="utf-8"

What sort of message is this to send to the younger generation?

> plastic = 1:5
> card = 1:4
> board = 1:4
> plastic/crossprod(card,board)
[1] 0.03333333 0.06666667 0.10000000 0.13333333 0.16666667
Warning message:
In plastic/crossprod(card, board) :
  Recycling array of length 1 in vector-array arithmetic is deprecated.
  Use c() or as.vector() instead.

ok,  I can write c(crossprod()) but it is ugly, and environmentally wasteful.
What’s next?  Warnings for my beloved  outer(card, board) * board

------------------------------

Message: 26
Date: Wed, 9 Sep 2020 10:00:55 +0200
From: Tomas Kalibera <[hidden email]>
To: Hugh Parsonage <[hidden email]>
Cc: Jeroen Ooms <[hidden email]>, Luke Tierney
        <[hidden email]>, R-devel <[hidden email]>, Martin
        Maechler <[hidden email]>
Subject: Re: [Rd] [External] Re: Operations with long altrep vectors
        cause segfaults on Windows
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

On 9/9/20 9:30 AM, Hugh Parsonage wrote:

> Thank you!
>
> I get
>
> Starting program: C:\R\R-devel-20200909\bin\x64\Rgui.exe
> [New Thread 19940.0x638c]
> [New Thread 19940.0x102c]
> [New Thread 19940.0x329c]
> [New Thread 19940.0x37dc]
> warning: Invalid parameter passed to C runtime function.
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x000000006c72d206 in compact_intseq_Dataptr (x=0x12783350,
> writeable=<optimized out>) at altclasses.c:169
> 169     altclasses.c: No such file or directory.

Thanks, would you know which svn version this is?

Tomas

>
> On Wed, 9 Sep 2020 at 17:03, Tomas Kalibera <[hidden email]> wrote:
>> On 9/9/20 8:48 AM, Hugh Parsonage wrote:
>>> I am unable to set break or use gdb with any success when I use that version.
>>>
>>> On linux I would do R -d gdb but this gives "unknown option '-d' "
>>> while gdb R.exe (in the same directory as the debug version) gives the
>>> same output as before.
>>>
>>> I'm happy to help but I appreciate this list might not be the best
>>> place to get a tutorial on using gdb on Windows.
>> Essentially, the steps are: build with DEBUG=T (to have debug symbols),
>> possibly updating EOPTS in MkRules.local to disable optimizations, then
>> run gdb loading RGui, "set solib-search-path", run RGui from gdb. Then
>> you can break to debugger from RGui menu, or just run the code that
>> segfaults, and you get to gdb and can print the stacktrace, etc. You can
>> find some information in rw-FAQ (R for Windows FAQ), but yes, it is
>> harder than on Linux. We can take care of this report, but of course in
>> the longer term it would help if more people could take their time to
>> setup debugging and analyze bugs even on Windows.
>>
>> Tomas
>>
>>> On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms <[hidden email]> wrote:
>>>> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms <[hidden email]> wrote:
>>>>> On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera <[hidden email]> wrote:
>>>>>> On 9/8/20 4:48 PM, Hugh Parsonage wrote:
>>>>>>> Unfortunately I only get
>>>>>>>
>>>>>>> [Thread 21752.0x4aa8 exited with code 3221225477]
>>>>>>> [Thread 21752.0x4514 exited with code 3221225477]
>>>>>>> [Thread 21752.0x3f10 exited with code 3221225477]
>>>>>>> [Inferior 1 (process 21752) exited with code 030000000005]
>>>>>>>
>>>>>>> (I'm guessing I would need to build an instrumented version of R, or
>>>>>>> can R be debugged using gdb with an off-the-shelf installation?)
>>>>>> No, the default build lacks debug symbols. You need a build with debug
>>>>>> symbols, and if you can reproduce in a build without compiler
>>>>>> optimizations (-O0), the backtrace may be easier to interpret. Some bugs
>>>>>> however "disappear" when optimizations are disabled. You can build R
>>>>>> from source (and there may be debug builds provided by someone else
>>>>>> (Jeroen?)).
>>>>> Debug builds for each revision are available from
>>>>> https://r-devel.github.io . To download the installer you need to
>>>>> click the github icon in the last column in the table. You need to be
>>>>> signed in with a (free) Github account in order to download builds
>>>>> (artifacts) from Github actions. It will show download links for both
>>>>> the regular installer and installer with debug symbols.
>>>>>
>>>>> In other news, the https://r-devel.github.io table also shows that the
>>>>> fix that martin committed is segfaulting on 32-bit.
>>>> Sorry that was inaccurate, it is not segfaulting at all, but the unit
>>>> test is raising an error on 32-bit.
>>




------------------------------

Message: 27
Date: Wed, 9 Sep 2020 18:32:58 +1000
From: Hugh Parsonage <[hidden email]>
To: Tomas Kalibera <[hidden email]>
Cc: Jeroen Ooms <[hidden email]>, Luke Tierney
        <[hidden email]>,  R-devel <[hidden email]>, Martin
        Maechler <[hidden email]>
Subject: Re: [Rd] [External] Re: Operations with long altrep vectors
        cause segfaults on Windows
Message-ID:
        <[hidden email]>
Content-Type: text/plain; charset="utf-8"

R Under development (unstable) (2020-09-08 r79165)

On Wed, 9 Sep 2020 at 18:00, Tomas Kalibera <[hidden email]> wrote:

>
> On 9/9/20 9:30 AM, Hugh Parsonage wrote:
> > Thank you!
> >
> > I get
> >
> > Starting program: C:\R\R-devel-20200909\bin\x64\Rgui.exe
> > [New Thread 19940.0x638c]
> > [New Thread 19940.0x102c]
> > [New Thread 19940.0x329c]
> > [New Thread 19940.0x37dc]
> > warning: Invalid parameter passed to C runtime function.
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > 0x000000006c72d206 in compact_intseq_Dataptr (x=0x12783350,
> > writeable=<optimized out>) at altclasses.c:169
> > 169     altclasses.c: No such file or directory.
>
> Thanks, would you know which svn version this is?
>
> Tomas
>
> >
> > On Wed, 9 Sep 2020 at 17:03, Tomas Kalibera <[hidden email]> wrote:
> >> On 9/9/20 8:48 AM, Hugh Parsonage wrote:
> >>> I am unable to set break or use gdb with any success when I use that version.
> >>>
> >>> On linux I would do R -d gdb but this gives "unknown option '-d' "
> >>> while gdb R.exe (in the same directory as the debug version) gives the
> >>> same output as before.
> >>>
> >>> I'm happy to help but I appreciate this list might not be the best
> >>> place to get a tutorial on using gdb on Windows.
> >> Essentially, the steps are: build with DEBUG=T (to have debug symbols),
> >> possibly updating EOPTS in MkRules.local to disable optimizations, then
> >> run gdb loading RGui, "set solib-search-path", run RGui from gdb. Then
> >> you can break to debugger from RGui menu, or just run the code that
> >> segfaults, and you get to gdb and can print the stacktrace, etc. You can
> >> find some information in rw-FAQ (R for Windows FAQ), but yes, it is
> >> harder than on Linux. We can take care of this report, but of course in
> >> the longer term it would help if more people could take their time to
> >> setup debugging and analyze bugs even on Windows.
> >>
> >> Tomas
> >>
> >>> On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms <[hidden email]> wrote:
> >>>> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms <[hidden email]> wrote:
> >>>>> On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera <[hidden email]> wrote:
> >>>>>> On 9/8/20 4:48 PM, Hugh Parsonage wrote:
> >>>>>>> Unfortunately I only get
> >>>>>>>
> >>>>>>> [Thread 21752.0x4aa8 exited with code 3221225477]
> >>>>>>> [Thread 21752.0x4514 exited with code 3221225477]
> >>>>>>> [Thread 21752.0x3f10 exited with code 3221225477]
> >>>>>>> [Inferior 1 (process 21752) exited with code 030000000005]
> >>>>>>>
> >>>>>>> (I'm guessing I would need to build an instrumented version of R, or
> >>>>>>> can R be debugged using gdb with an off-the-shelf installation?)
> >>>>>> No, the default build lacks debug symbols. You need a build with debug
> >>>>>> symbols, and if you can reproduce in a build without compiler
> >>>>>> optimizations (-O0), the backtrace may be easier to interpret. Some bugs
> >>>>>> however "disappear" when optimizations are disabled. You can build R
> >>>>>> from source (and there may be debug builds provided by someone else
> >>>>>> (Jeroen?)).
> >>>>> Debug builds for each revision are available from
> >>>>> https://r-devel.github.io . To download the installer you need to
> >>>>> click the github icon in the last column in the table. You need to be
> >>>>> signed in with a (free) Github account in order to download builds
> >>>>> (artifacts) from Github actions. It will show download links for both
> >>>>> the regular installer and installer with debug symbols.
> >>>>>
> >>>>> In other news, the https://r-devel.github.io table also shows that the
> >>>>> fix that martin committed is segfaulting on 32-bit.
> >>>> Sorry that was inaccurate, it is not segfaulting at all, but the unit
> >>>> test is raising an error on 32-bit.
> >>
>




------------------------------

Message: 28
Date: Wed, 9 Sep 2020 10:53:18 +0200
From: Tomas Kalibera <[hidden email]>
To: Hugh Parsonage <[hidden email]>
Cc: Jeroen Ooms <[hidden email]>, Luke Tierney
        <[hidden email]>, R-devel <[hidden email]>, Martin
        Maechler <[hidden email]>
Subject: Re: [Rd] [External] Re: Operations with long altrep vectors
        cause segfaults on Windows
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

Thanks. Should be now fixed in 79169.
Tomas

On 9/9/20 10:32 AM, Hugh Parsonage wrote:

> R Under development (unstable) (2020-09-08 r79165)
>
> On Wed, 9 Sep 2020 at 18:00, Tomas Kalibera <[hidden email]> wrote:
>> On 9/9/20 9:30 AM, Hugh Parsonage wrote:
>>> Thank you!
>>>
>>> I get
>>>
>>> Starting program: C:\R\R-devel-20200909\bin\x64\Rgui.exe
>>> [New Thread 19940.0x638c]
>>> [New Thread 19940.0x102c]
>>> [New Thread 19940.0x329c]
>>> [New Thread 19940.0x37dc]
>>> warning: Invalid parameter passed to C runtime function.
>>>
>>> Program received signal SIGSEGV, Segmentation fault.
>>> 0x000000006c72d206 in compact_intseq_Dataptr (x=0x12783350,
>>> writeable=<optimized out>) at altclasses.c:169
>>> 169     altclasses.c: No such file or directory.
>> Thanks, would you know which svn version this is?
>>
>> Tomas
>>
>>> On Wed, 9 Sep 2020 at 17:03, Tomas Kalibera <[hidden email]> wrote:
>>>> On 9/9/20 8:48 AM, Hugh Parsonage wrote:
>>>>> I am unable to set break or use gdb with any success when I use that version.
>>>>>
>>>>> On linux I would do R -d gdb but this gives "unknown option '-d' "
>>>>> while gdb R.exe (in the same directory as the debug version) gives the
>>>>> same output as before.
>>>>>
>>>>> I'm happy to help but I appreciate this list might not be the best
>>>>> place to get a tutorial on using gdb on Windows.
>>>> Essentially, the steps are: build with DEBUG=T (to have debug symbols),
>>>> possibly updating EOPTS in MkRules.local to disable optimizations, then
>>>> run gdb loading RGui, "set solib-search-path", run RGui from gdb. Then
>>>> you can break to debugger from RGui menu, or just run the code that
>>>> segfaults, and you get to gdb and can print the stacktrace, etc. You can
>>>> find some information in rw-FAQ (R for Windows FAQ), but yes, it is
>>>> harder than on Linux. We can take care of this report, but of course in
>>>> the longer term it would help if more people could take their time to
>>>> setup debugging and analyze bugs even on Windows.
>>>>
>>>> Tomas
>>>>
>>>>> On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms <[hidden email]> wrote:
>>>>>> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms <[hidden email]> wrote:
>>>>>>> On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera <[hidden email]> wrote:
>>>>>>>> On 9/8/20 4:48 PM, Hugh Parsonage wrote:
>>>>>>>>> Unfortunately I only get
>>>>>>>>>
>>>>>>>>> [Thread 21752.0x4aa8 exited with code 3221225477]
>>>>>>>>> [Thread 21752.0x4514 exited with code 3221225477]
>>>>>>>>> [Thread 21752.0x3f10 exited with code 3221225477]
>>>>>>>>> [Inferior 1 (process 21752) exited with code 030000000005]
>>>>>>>>>
>>>>>>>>> (I'm guessing I would need to build an instrumented version of R, or
>>>>>>>>> can R be debugged using gdb with an off-the-shelf installation?)
>>>>>>>> No, the default build lacks debug symbols. You need a build with debug
>>>>>>>> symbols, and if you can reproduce in a build without compiler
>>>>>>>> optimizations (-O0), the backtrace may be easier to interpret. Some bugs
>>>>>>>> however "disappear" when optimizations are disabled. You can build R
>>>>>>>> from source (and there may be debug builds provided by someone else
>>>>>>>> (Jeroen?)).
>>>>>>> Debug builds for each revision are available from
>>>>>>> https://r-devel.github.io . To download the installer you need to
>>>>>>> click the github icon in the last column in the table. You need to be
>>>>>>> signed in with a (free) Github account in order to download builds
>>>>>>> (artifacts) from Github actions. It will show download links for both
>>>>>>> the regular installer and installer with debug symbols.
>>>>>>>
>>>>>>> In other news, the https://r-devel.github.io table also shows that the
>>>>>>> fix that martin committed is segfaulting on 32-bit.
>>>>>> Sorry that was inaccurate, it is not segfaulting at all, but the unit
>>>>>> test is raising an error on 32-bit.




------------------------------

Message: 29
Date: Wed, 9 Sep 2020 11:06:12 +0200
From: Tomas Kalibera <[hidden email]>
To: Jeroen Ooms <[hidden email]>
Cc: Hugh Parsonage <[hidden email]>, Luke Tierney
        <[hidden email]>, R-devel <[hidden email]>, Martin
        Maechler <[hidden email]>
Subject: Re: [Rd] [External] Re: Operations with long altrep vectors
        cause segfaults on Windows
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

On 9/8/20 11:47 PM, Jeroen Ooms wrote:

> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms <[hidden email]> wrote:
>> On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera <[hidden email]> wrote:
>>> On 9/8/20 4:48 PM, Hugh Parsonage wrote:
>>>> Unfortunately I only get
>>>>
>>>> [Thread 21752.0x4aa8 exited with code 3221225477]
>>>> [Thread 21752.0x4514 exited with code 3221225477]
>>>> [Thread 21752.0x3f10 exited with code 3221225477]
>>>> [Inferior 1 (process 21752) exited with code 030000000005]
>>>>
>>>> (I'm guessing I would need to build an instrumented version of R, or
>>>> can R be debugged using gdb with an off-the-shelf installation?)
>>> No, the default build lacks debug symbols. You need a build with debug
>>> symbols, and if you can reproduce in a build without compiler
>>> optimizations (-O0), the backtrace may be easier to interpret. Some bugs
>>> however "disappear" when optimizations are disabled. You can build R
>>> from source (and there may be debug builds provided by someone else
>>> (Jeroen?)).
>> Debug builds for each revision are available from
>> https://r-devel.github.io . To download the installer you need to
>> click the github icon in the last column in the table. You need to be
>> signed in with a (free) Github account in order to download builds
>> (artifacts) from Github actions. It will show download links for both
>> the regular installer and installer with debug symbols.
>>
>> In other news, the https://r-devel.github.io table also shows that the
>> fix that martin committed is segfaulting on 32-bit.
> Sorry that was inaccurate, it is not segfaulting at all, but the unit
> test is raising an error on 32-bit.

Now fixed, the test needs to be run only on 64-bit builds where such
long vectors/sequences are allowed.

Tomas




------------------------------

Subject: Digest Footer

_______________________________________________
[hidden email] mailing list  DIGESTED
https://stat.ethz.ch/mailman/listinfo/r-devel


------------------------------

End of R-devel Digest, Vol 211, Issue 7
***************************************
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: more Matrix weirdness

Martin Maechler
>>>>> Georgi Boshnakov
>>>>>     on Wed, 9 Sep 2020 10:48:56 +0000 writes:

    > I think that this is because `[<-` dispatches on S4
    > methods only if the first argument is S4.  ?"[<-" says:

    > "These operators are also implicit S4 generics, but as
    > primitives, S4 methods will be dispatched only on S4
    > objects ‘x’."

    > Georgi Boshnakov

Yes, exactly,  very well found, Georgi!

This is something I would have wanted different for years,
exactly because of several such problems with the Matrix
package of which I'm the maintainer.

Long time ago I had also looked if I saw how to fix this
behavior inside 'methods' (i.e. the S4 infrastructure pkg)
and I think in this case also, inside R's basic C code.

At the time (~ 10 yrs ago) I gave up, but don't remember why.

I'm happy if you create a formal bug report, possibly "wishlist"
as it is documented behavior, for this infelicity...
and then I will probably add the  'HELPWANTED'  keyword.

Martin


    > -----Original Message-----


    > Message: 19 Date: Tue, 8 Sep 2020 22:04:44 -0400 From: Ben
    > Bolker <[hidden email]> To: r-devel
    > <[hidden email]> Subject: [Rd] more Matrix
    > weirdness Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"; Format="flowed"

    >    Am I being too optimistic in expecting this (mixing and
    > matching matrices and Matrices) to work?  If x is a matrix
    > and m is a Matrix, replacing a commensurately sized
    > sub-matrix of x with m throws "number of items to replace
    > is not a multiple of replacement length" ...

    > x <- matrix(0,nrow=3,ncol=10,
    > dimnames=list(letters[1:3],LETTERS[1:10])) rr <-
    > c("a","b","c") cc <- c("B","C","E") m <-
    > Matrix(matrix(1:9,3,3)) x[rr,cc] <- m

    >     cheers Ben Bolker




    > ------------------------------

    > Message: 20 Date: Wed, 9 Sep 2020 07:03:47 +0100 From: Rui
    > Barradas <[hidden email]> To: Ben Bolker
    > <[hidden email]>, r-devel <[hidden email]>
    > Subject: Re: [Rd] more Matrix weirdness Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"; Format="flowed"

    > Hello,

    > R 4.0.2 on Ubuntu 20.04, sessionInfo() below.

    > I can reproduce this, sort of. The error I'm getting is
    > different:


    > x[rr, cc] <- m #Error in x[rr, cc] <- m : replacement has
    > length zero

    > But if I check lengths and dimensions, they are
    > identical().

    > identical(length(x[rr, cc]), length(m)) #[1] TRUE
    > identical(dim(x[rr, cc]), dim(m)) #[1] TRUE


    > What works is


    > x[rr, cc] <- as.matrix(m)

    > I ran Ben's code on RStudio 1.3.1073, the following is run
    > with Rscript and the error message is the same.


    > rui@rui:~$ Rscript --vanilla rhelp.R R version 4.0.2
    > (2020-06-22) Platform: x86_64-pc-linux-gnu (64-bit)
    > Running under: Ubuntu 20.04.1 LTS

    > Matrix products: default BLAS:
    > /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0 LAPACK:
    > /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

    > locale: [1] LC_CTYPE=pt_PT.UTF-8 LC_NUMERIC=C [3]
    > LC_TIME=pt_PT.UTF-8 LC_COLLATE=pt_PT.UTF-8 [5]
    > LC_MONETARY=pt_PT.UTF-8 LC_MESSAGES=pt_PT.UTF-8 [7]
    > LC_PAPER=pt_PT.UTF-8 LC_NAME=C [9] LC_ADDRESS=C
    > LC_TELEPHONE=C [11] LC_MEASUREMENT=pt_PT.UTF-8
    > LC_IDENTIFICATION=C

    > attached base packages: [1] stats graphics grDevices utils
    > datasets methods base

    > other attached packages: [1] Matrix_1.2-18

    > loaded via a namespace (and not attached): [1]
    > compiler_4.0.2 grid_4.0.2 lattice_0.20-41 Error in x[rr,
    > cc] <- m : number of items to replace is not a multiple of
    > replacement length Execution halted


    > Hope this helps,

    > Rui Barradas


    > Às 03:04 de 09/09/20, Ben Bolker escreveu:
    >>   Am I being too optimistic in expecting this (mixing and
    >> matching matrices and Matrices) to work?  If x is a
    >> matrix and m is a Matrix, replacing a commensurately
    >> sized sub-matrix of x with m throws "number of items to
    >> replace is not a multiple of replacement length" ...
    >>
    >> x <- matrix(0,nrow=3,ncol=10,
    >> dimnames=list(letters[1:3],LETTERS[1:10])) rr <-
    >> c("a","b","c") cc <- c("B","C","E") m <-
    >> Matrix(matrix(1:9,3,3)) x[rr,cc] <- m
    >>
    >>    cheers     Ben Bolker
    >>
    >> ______________________________________________
    >> [hidden email] mailing list
    >> https://stat.ethz.ch/mailman/listinfo/r-devel




    > ------------------------------

    > Message: 21 Date: Wed, 9 Sep 2020 08:27:06 +0200 From: Uwe
    > Ligges <[hidden email]> To:
    > [hidden email] Subject: Re: [Rd] failing automatic
    > incoming check Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"; Format="flowed"



    > On 08.09.2020 21:34, Sebastian P. Luque wrote:
    >> Hello,
    >>
    >> I got a notification regarding a failure to pass incoming
    >> checks automatically after a CRAN submission.  The
    >> details are given here:
    >>
    >> https://win-builder.r-project.org/incoming_pretest/diveMove_1.5.0_20200908_191325/
    >>
    >> The only visible issue is a NOTE from the macosx build,
    >> with the very terse:
    >>
    >> "No Protocol Specified"
    >>
    >> My searches suggest this can be ignored, but it would be
    >> nice to squash it.  Any tips welcome.
    >>


    > For some reason this should hgave undergone manual
    > inpection but got auto rejected. Ideally you would reduce
    > the test timing so that the overall check time is less
    > than 10 min .

    > Best, Uwe Ligges




    > ------------------------------

    > Message: 22 Date: Wed, 9 Sep 2020 16:48:40 +1000 From:
    > Hugh Parsonage <[hidden email]> To: Jeroen Ooms
    > <[hidden email]> Cc: Tomas Kalibera
    > <[hidden email]>, Luke Tierney
    > <[hidden email]>, R-devel <[hidden email]>,
    > Martin Maechler <[hidden email]> Subject: Re:
    > [Rd] [External] Re: Operations with long altrep vectors
    > cause segfaults on Windows Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"

    > I am unable to set break or use gdb with any success when
    > I use that version.

    > On linux I would do R -d gdb but this gives "unknown
    > option '-d' " while gdb R.exe (in the same directory as
    > the debug version) gives the same output as before.

    > I'm happy to help but I appreciate this list might not be
    > the best place to get a tutorial on using gdb on Windows.

    > On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms
    > <[hidden email]> wrote:
    >>
    >> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms
    >> <[hidden email]> wrote:
    >> >
    >> > On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera
    >> <[hidden email]> wrote:
    >> > >
    >> > > On 9/8/20 4:48 PM, Hugh Parsonage wrote: > > >
    >> Unfortunately I only get
    >> > > >
    >> > > > [Thread 21752.0x4aa8 exited with code 3221225477] >
    >> > > [Thread 21752.0x4514 exited with code 3221225477] > >
    >> > [Thread 21752.0x3f10 exited with code 3221225477] > > >
    >> [Inferior 1 (process 21752) exited with code
    >> 030000000005]
    >> > > >
    >> > > > (I'm guessing I would need to build an instrumented
    >> version of R, or > > > can R be debugged using gdb with
    >> an off-the-shelf installation?)
    >> > >
    >> > > No, the default build lacks debug symbols. You need a
    >> build with debug > > symbols, and if you can reproduce in
    >> a build without compiler > > optimizations (-O0), the
    >> backtrace may be easier to interpret. Some bugs > >
    >> however "disappear" when optimizations are disabled. You
    >> can build R > > from source (and there may be debug
    >> builds provided by someone else > > (Jeroen?)).
    >> >
    >> > Debug builds for each revision are available from >
    >> https://r-devel.github.io . To download the installer you
    >> need to > click the github icon in the last column in the
    >> table. You need to be > signed in with a (free) Github
    >> account in order to download builds > (artifacts) from
    >> Github actions. It will show download links for both >
    >> the regular installer and installer with debug symbols.
    >> >
    >> > In other news, the https://r-devel.github.io table also
    >> shows that the > fix that martin committed is segfaulting
    >> on 32-bit.
    >>
    >> Sorry that was inaccurate, it is not segfaulting at all,
    >> but the unit test is raising an error on 32-bit.




    > ------------------------------

    > Message: 23 Date: Wed, 9 Sep 2020 09:03:05 +0200 From:
    > Tomas Kalibera <[hidden email]> To: Hugh
    > Parsonage <[hidden email]>, Jeroen Ooms
    > <[hidden email]> Cc: Luke Tierney
    > <[hidden email]>, R-devel <[hidden email]>,
    > Martin Maechler <[hidden email]> Subject: Re:
    > [Rd] [External] Re: Operations with long altrep vectors
    > cause segfaults on Windows Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"; Format="flowed"

    > On 9/9/20 8:48 AM, Hugh Parsonage wrote:
    >> I am unable to set break or use gdb with any success when
    >> I use that version.
    >>
    >> On linux I would do R -d gdb but this gives "unknown
    >> option '-d' " while gdb R.exe (in the same directory as
    >> the debug version) gives the same output as before.
    >>
    >> I'm happy to help but I appreciate this list might not be
    >> the best place to get a tutorial on using gdb on Windows.

    > Essentially, the steps are: build with DEBUG=T (to have
    > debug symbols), possibly updating EOPTS in MkRules.local
    > to disable optimizations, then run gdb loading RGui, "set
    > solib-search-path", run RGui from gdb. Then you can break
    > to debugger from RGui menu, or just run the code that
    > segfaults, and you get to gdb and can print the
    > stacktrace, etc. You can find some information in rw-FAQ
    > (R for Windows FAQ), but yes, it is harder than on
    > Linux. We can take care of this report, but of course in
    > the longer term it would help if more people could take
    > their time to setup debugging and analyze bugs even on
    > Windows.

    > Tomas

    >>
    >> On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms
    >> <[hidden email]> wrote:
    >>> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms
    >>> <[hidden email]> wrote:
    >>>> On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera
    >>>> <[hidden email]> wrote:
    >>>>> On 9/8/20 4:48 PM, Hugh Parsonage wrote:
>>>>> Unfortunately I only get
    >>>>>>
>>>>> [Thread 21752.0x4aa8 exited with code 3221225477]
>>>>> [Thread 21752.0x4514 exited with code 3221225477]
>>>>> [Thread 21752.0x3f10 exited with code 3221225477]
>>>>> [Inferior 1 (process 21752) exited with code 030000000005]
    >>>>>>
>>>>> (I'm guessing I would need to build an instrumented
    >>>>>> version of R, or
>>>>> can R be debugged using gdb with an off-the-shelf
    >>>>>> installation?)
    >>>>> No, the default build lacks debug symbols. You need a
    >>>>> build with debug symbols, and if you can reproduce in
    >>>>> a build without compiler optimizations (-O0), the
    >>>>> backtrace may be easier to interpret. Some bugs
    >>>>> however "disappear" when optimizations are
    >>>>> disabled. You can build R from source (and there may
    >>>>> be debug builds provided by someone else (Jeroen?)).
    >>>> Debug builds for each revision are available from
    >>>> https://r-devel.github.io . To download the installer
    >>>> you need to click the github icon in the last column in
    >>>> the table. You need to be signed in with a (free)
    >>>> Github account in order to download builds (artifacts)
    >>>> from Github actions. It will show download links for
    >>>> both the regular installer and installer with debug
    >>>> symbols.
    >>>>
    >>>> In other news, the https://r-devel.github.io table also
    >>>> shows that the fix that martin committed is segfaulting
    >>>> on 32-bit.
    >>> Sorry that was inaccurate, it is not segfaulting at all,
    >>> but the unit test is raising an error on 32-bit.




    > ------------------------------

    > Message: 24 Date: Wed, 9 Sep 2020 17:30:17 +1000 From:
    > Hugh Parsonage <[hidden email]> To: Tomas
    > Kalibera <[hidden email]> Cc: Jeroen Ooms
    > <[hidden email]>, Luke Tierney
    > <[hidden email]>, R-devel <[hidden email]>,
    > Martin Maechler <[hidden email]> Subject: Re:
    > [Rd] [External] Re: Operations with long altrep vectors
    > cause segfaults on Windows Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"

    > Thank you!

    > I get

    > Starting program: C:\R\R-devel-20200909\bin\x64\Rgui.exe
    > [New Thread 19940.0x638c] [New Thread 19940.0x102c] [New
    > Thread 19940.0x329c] [New Thread 19940.0x37dc] warning:
    > Invalid parameter passed to C runtime function.

    > Program received signal SIGSEGV, Segmentation fault.
    > 0x000000006c72d206 in compact_intseq_Dataptr
    > (x=0x12783350, writeable=<optimized out>) at
    > altclasses.c:169 169 altclasses.c: No such file or
    > directory.

    > On Wed, 9 Sep 2020 at 17:03, Tomas Kalibera
    > <[hidden email]> wrote:
    >>
    >> On 9/9/20 8:48 AM, Hugh Parsonage wrote: > I am unable to
    >> set break or use gdb with any success when I use that
    >> version.
    >> >
    >> > On linux I would do R -d gdb but this gives "unknown
    >> option '-d' " > while gdb R.exe (in the same directory as
    >> the debug version) gives the > same output as before.
    >> >
    >> > I'm happy to help but I appreciate this list might not
    >> be the best > place to get a tutorial on using gdb on
    >> Windows.
    >>
    >> Essentially, the steps are: build with DEBUG=T (to have
    >> debug symbols), possibly updating EOPTS in MkRules.local
    >> to disable optimizations, then run gdb loading RGui, "set
    >> solib-search-path", run RGui from gdb. Then you can break
    >> to debugger from RGui menu, or just run the code that
    >> segfaults, and you get to gdb and can print the
    >> stacktrace, etc. You can find some information in rw-FAQ
    >> (R for Windows FAQ), but yes, it is harder than on
    >> Linux. We can take care of this report, but of course in
    >> the longer term it would help if more people could take
    >> their time to setup debugging and analyze bugs even on
    >> Windows.
    >>
    >> Tomas
    >>
    >> >
    >> > On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms
    >> <[hidden email]> wrote: >> On Tue, Sep 8, 2020 at
    >> 11:44 PM Jeroen Ooms <[hidden email]> wrote: >>> On
    >> Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera
    >> <[hidden email]> wrote: >>>> On 9/8/20 4:48 PM,
    >> Hugh Parsonage wrote: >>>>> Unfortunately I only get
    >> >>>>>
    >> >>>>> [Thread 21752.0x4aa8 exited with code 3221225477]
    >> >>>>> [Thread 21752.0x4514 exited with code 3221225477]
    >> >>>>> [Thread 21752.0x3f10 exited with code 3221225477]
    >> >>>>> [Inferior 1 (process 21752) exited with code
    >> 030000000005]
    >> >>>>>
    >> >>>>> (I'm guessing I would need to build an instrumented
    >> version of R, or >>>>> can R be debugged using gdb with
    >> an off-the-shelf installation?)  >>>> No, the default
    >> build lacks debug symbols. You need a build with debug
    >> >>>> symbols, and if you can reproduce in a build without
    >> compiler >>>> optimizations (-O0), the backtrace may be
    >> easier to interpret. Some bugs >>>> however "disappear"
    >> when optimizations are disabled. You can build R >>>>
    >> from source (and there may be debug builds provided by
    >> someone else >>>> (Jeroen?)).  >>> Debug builds for each
    >> revision are available from >>> https://r-devel.github.io
    >> . To download the installer you need to >>> click the
    >> github icon in the last column in the table. You need to
    >> be >>> signed in with a (free) Github account in order to
    >> download builds >>> (artifacts) from Github actions. It
    >> will show download links for both >>> the regular
    >> installer and installer with debug symbols.
    >> >>>
    >> >>> In other news, the https://r-devel.github.io table
    >> also shows that the >>> fix that martin committed is
    >> segfaulting on 32-bit.  >> Sorry that was inaccurate, it
    >> is not segfaulting at all, but the unit >> test is
    >> raising an error on 32-bit.
    >>
    >>




    > ------------------------------

    > Message: 25 Date: Wed, 9 Sep 2020 08:00:41 +0000 From:
    > "Koenker, Roger W" <[hidden email]> To: r-devel
    > <[hidden email]> Subject: [Rd] Environmental
    > Messaging Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"

    > What sort of message is this to send to the younger
    > generation?

    >> plastic = 1:5 card = 1:4 board = 1:4
    >> plastic/crossprod(card,board)
    > [1] 0.03333333 0.06666667 0.10000000 0.13333333 0.16666667
    > Warning message: In plastic/crossprod(card, board) :
    > Recycling array of length 1 in vector-array arithmetic is
    > deprecated.  Use c() or as.vector() instead.

    > ok, I can write c(crossprod()) but it is ugly, and
    > environmentally wasteful.  What’s next?  Warnings for my
    > beloved outer(card, board) * board

    > ------------------------------

    > Message: 26 Date: Wed, 9 Sep 2020 10:00:55 +0200 From:
    > Tomas Kalibera <[hidden email]> To: Hugh
    > Parsonage <[hidden email]> Cc: Jeroen Ooms
    > <[hidden email]>, Luke Tierney
    > <[hidden email]>, R-devel <[hidden email]>,
    > Martin Maechler <[hidden email]> Subject: Re:
    > [Rd] [External] Re: Operations with long altrep vectors
    > cause segfaults on Windows Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"; Format="flowed"

    > On 9/9/20 9:30 AM, Hugh Parsonage wrote:
    >> Thank you!
    >>
    >> I get
    >>
    >> Starting program: C:\R\R-devel-20200909\bin\x64\Rgui.exe
    >> [New Thread 19940.0x638c] [New Thread 19940.0x102c] [New
    >> Thread 19940.0x329c] [New Thread 19940.0x37dc] warning:
    >> Invalid parameter passed to C runtime function.
    >>
    >> Program received signal SIGSEGV, Segmentation fault.
    >> 0x000000006c72d206 in compact_intseq_Dataptr
    >> (x=0x12783350, writeable=<optimized out>) at
    >> altclasses.c:169 169 altclasses.c: No such file or
    >> directory.

    > Thanks, would you know which svn version this is?

    > Tomas

    >>
    >> On Wed, 9 Sep 2020 at 17:03, Tomas Kalibera
    >> <[hidden email]> wrote:
    >>> On 9/9/20 8:48 AM, Hugh Parsonage wrote:
    >>>> I am unable to set break or use gdb with any success
    >>>> when I use that version.
    >>>>
    >>>> On linux I would do R -d gdb but this gives "unknown
    >>>> option '-d' " while gdb R.exe (in the same directory as
    >>>> the debug version) gives the same output as before.
    >>>>
    >>>> I'm happy to help but I appreciate this list might not
    >>>> be the best place to get a tutorial on using gdb on
    >>>> Windows.
    >>> Essentially, the steps are: build with DEBUG=T (to have
    >>> debug symbols), possibly updating EOPTS in MkRules.local
    >>> to disable optimizations, then run gdb loading RGui,
    >>> "set solib-search-path", run RGui from gdb. Then you can
    >>> break to debugger from RGui menu, or just run the code
    >>> that segfaults, and you get to gdb and can print the
    >>> stacktrace, etc. You can find some information in rw-FAQ
    >>> (R for Windows FAQ), but yes, it is harder than on
    >>> Linux. We can take care of this report, but of course in
    >>> the longer term it would help if more people could take
    >>> their time to setup debugging and analyze bugs even on
    >>> Windows.
    >>>
    >>> Tomas
    >>>
    >>>> On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms
    >>>> <[hidden email]> wrote:
    >>>>> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms
    >>>>> <[hidden email]> wrote:
>>>>> On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera
    >>>>> <[hidden email]> wrote:
    >>>>>>> On 9/8/20 4:48 PM, Hugh Parsonage wrote:
    >>>>>>>> Unfortunately I only get
    >>>>>>>>
    >>>>>>>> [Thread 21752.0x4aa8 exited with code 3221225477]
    >>>>>>>> [Thread 21752.0x4514 exited with code 3221225477]
    >>>>>>>> [Thread 21752.0x3f10 exited with code 3221225477]
    >>>>>>>> [Inferior 1 (process 21752) exited with code
    >>>>>>>> 030000000005]
    >>>>>>>>
    >>>>>>>> (I'm guessing I would need to build an instrumented
    >>>>>>>> version of R, or can R be debugged using gdb with
    >>>>>>>> an off-the-shelf installation?)
    >>>>>>> No, the default build lacks debug symbols. You need
    >>>>>>> a build with debug symbols, and if you can reproduce
    >>>>>>> in a build without compiler optimizations (-O0), the
    >>>>>>> backtrace may be easier to interpret. Some bugs
    >>>>>>> however "disappear" when optimizations are
    >>>>>>> disabled. You can build R from source (and there may
    >>>>>>> be debug builds provided by someone else (Jeroen?)).
>>>>> Debug builds for each revision are available from
>>>>> https://r-devel.github.io . To download the installer you
    >>>>>>> need to
>>>>> click the github icon in the last column in the table. You
    >>>>>>> need to be
>>>>> signed in with a (free) Github account in order to
    >>>>>>> download builds
>>>>> (artifacts) from Github actions. It will show download
    >>>>>>> links for both
>>>>> the regular installer and installer with debug symbols.
    >>>>>>
>>>>> In other news, the https://r-devel.github.io table also
    >>>>>> shows that the
>>>>> fix that martin committed is segfaulting on 32-bit.
    >>>>> Sorry that was inaccurate, it is not segfaulting at
    >>>>> all, but the unit test is raising an error on 32-bit.
    >>>




    > ------------------------------

    > Message: 27 Date: Wed, 9 Sep 2020 18:32:58 +1000 From:
    > Hugh Parsonage <[hidden email]> To: Tomas
    > Kalibera <[hidden email]> Cc: Jeroen Ooms
    > <[hidden email]>, Luke Tierney
    > <[hidden email]>, R-devel <[hidden email]>,
    > Martin Maechler <[hidden email]> Subject: Re:
    > [Rd] [External] Re: Operations with long altrep vectors
    > cause segfaults on Windows Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"

    > R Under development (unstable) (2020-09-08 r79165)

    > On Wed, 9 Sep 2020 at 18:00, Tomas Kalibera
    > <[hidden email]> wrote:
    >>
    >> On 9/9/20 9:30 AM, Hugh Parsonage wrote: > Thank you!
    >> >
    >> > I get
    >> >
    >> > Starting program:
    >> C:\R\R-devel-20200909\bin\x64\Rgui.exe > [New Thread
    >> 19940.0x638c] > [New Thread 19940.0x102c] > [New Thread
    >> 19940.0x329c] > [New Thread 19940.0x37dc] > warning:
    >> Invalid parameter passed to C runtime function.
    >> >
    >> > Program received signal SIGSEGV, Segmentation fault.  >
    >> 0x000000006c72d206 in compact_intseq_Dataptr
    >> (x=0x12783350, > writeable=<optimized out>) at
    >> altclasses.c:169 > 169 altclasses.c: No such file or
    >> directory.
    >>
    >> Thanks, would you know which svn version this is?
    >>
    >> Tomas
    >>
    >> >
    >> > On Wed, 9 Sep 2020 at 17:03, Tomas Kalibera
    >> <[hidden email]> wrote: >> On 9/9/20 8:48 AM,
    >> Hugh Parsonage wrote: >>> I am unable to set break or use
    >> gdb with any success when I use that version.
    >> >>>
    >> >>> On linux I would do R -d gdb but this gives "unknown
    >> option '-d' " >>> while gdb R.exe (in the same directory
    >> as the debug version) gives the >>> same output as
    >> before.
    >> >>>
    >> >>> I'm happy to help but I appreciate this list might
    >> not be the best >>> place to get a tutorial on using gdb
    >> on Windows.  >> Essentially, the steps are: build with
    >> DEBUG=T (to have debug symbols), >> possibly updating
    >> EOPTS in MkRules.local to disable optimizations, then >>
    >> run gdb loading RGui, "set solib-search-path", run RGui
    >> from gdb. Then >> you can break to debugger from RGui
    >> menu, or just run the code that >> segfaults, and you get
    >> to gdb and can print the stacktrace, etc. You can >> find
    >> some information in rw-FAQ (R for Windows FAQ), but yes,
    >> it is >> harder than on Linux. We can take care of this
    >> report, but of course in >> the longer term it would help
    >> if more people could take their time to >> setup
    >> debugging and analyze bugs even on Windows.
    >> >>
    >> >> Tomas
    >> >>
    >> >>> On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms
    >> <[hidden email]> wrote: >>>> On Tue, Sep 8, 2020 at
    >> 11:44 PM Jeroen Ooms <[hidden email]> wrote: >>>>>
    >> On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera
    >> <[hidden email]> wrote: >>>>>> On 9/8/20 4:48
    >> PM, Hugh Parsonage wrote: >>>>>>> Unfortunately I only
    >> get
    >> >>>>>>>
    >> >>>>>>> [Thread 21752.0x4aa8 exited with code 3221225477]
    >> >>>>>>> [Thread 21752.0x4514 exited with code 3221225477]
    >> >>>>>>> [Thread 21752.0x3f10 exited with code 3221225477]
    >> >>>>>>> [Inferior 1 (process 21752) exited with code
    >> 030000000005]
    >> >>>>>>>
    >> >>>>>>> (I'm guessing I would need to build an
    >> instrumented version of R, or >>>>>>> can R be debugged
    >> using gdb with an off-the-shelf installation?)  >>>>>>
    >> No, the default build lacks debug symbols. You need a
    >> build with debug >>>>>> symbols, and if you can reproduce
    >> in a build without compiler >>>>>> optimizations (-O0),
    >> the backtrace may be easier to interpret. Some bugs
    >> >>>>>> however "disappear" when optimizations are
    >> disabled. You can build R >>>>>> from source (and there
    >> may be debug builds provided by someone else >>>>>>
    >> (Jeroen?)).  >>>>> Debug builds for each revision are
    >> available from >>>>> https://r-devel.github.io . To
    >> download the installer you need to >>>>> click the github
    >> icon in the last column in the table. You need to be
    >> >>>>> signed in with a (free) Github account in order to
    >> download builds >>>>> (artifacts) from Github actions. It
    >> will show download links for both >>>>> the regular
    >> installer and installer with debug symbols.
    >> >>>>>
    >> >>>>> In other news, the https://r-devel.github.io table
    >> also shows that the >>>>> fix that martin committed is
    >> segfaulting on 32-bit.  >>>> Sorry that was inaccurate,
    >> it is not segfaulting at all, but the unit >>>> test is
    >> raising an error on 32-bit.
    >> >>
    >>




    > ------------------------------

    > Message: 28 Date: Wed, 9 Sep 2020 10:53:18 +0200 From:
    > Tomas Kalibera <[hidden email]> To: Hugh
    > Parsonage <[hidden email]> Cc: Jeroen Ooms
    > <[hidden email]>, Luke Tierney
    > <[hidden email]>, R-devel <[hidden email]>,
    > Martin Maechler <[hidden email]> Subject: Re:
    > [Rd] [External] Re: Operations with long altrep vectors
    > cause segfaults on Windows Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"; Format="flowed"

    > Thanks. Should be now fixed in 79169.  Tomas

    > On 9/9/20 10:32 AM, Hugh Parsonage wrote:
    >> R Under development (unstable) (2020-09-08 r79165)
    >>
    >> On Wed, 9 Sep 2020 at 18:00, Tomas Kalibera
    >> <[hidden email]> wrote:
    >>> On 9/9/20 9:30 AM, Hugh Parsonage wrote:
    >>>> Thank you!
    >>>>
    >>>> I get
    >>>>
    >>>> Starting program:
    >>>> C:\R\R-devel-20200909\bin\x64\Rgui.exe [New Thread
    >>>> 19940.0x638c] [New Thread 19940.0x102c] [New Thread
    >>>> 19940.0x329c] [New Thread 19940.0x37dc] warning:
    >>>> Invalid parameter passed to C runtime function.
    >>>>
    >>>> Program received signal SIGSEGV, Segmentation fault.
    >>>> 0x000000006c72d206 in compact_intseq_Dataptr
    >>>> (x=0x12783350, writeable=<optimized out>) at
    >>>> altclasses.c:169 169 altclasses.c: No such file or
    >>>> directory.
    >>> Thanks, would you know which svn version this is?
    >>>
    >>> Tomas
    >>>
    >>>> On Wed, 9 Sep 2020 at 17:03, Tomas Kalibera
    >>>> <[hidden email]> wrote:
    >>>>> On 9/9/20 8:48 AM, Hugh Parsonage wrote:
>>>>> I am unable to set break or use gdb with any success when
    >>>>> I use that version.
    >>>>>>
>>>>> On linux I would do R -d gdb but this gives "unknown
    >>>>>> option '-d' "
>>>>> while gdb R.exe (in the same directory as the debug
    >>>>>> version) gives the
>>>>> same output as before.
    >>>>>>
>>>>> I'm happy to help but I appreciate this list might not be
    >>>>>> the best
>>>>> place to get a tutorial on using gdb on Windows.
    >>>>> Essentially, the steps are: build with DEBUG=T (to
    >>>>> have debug symbols), possibly updating EOPTS in
    >>>>> MkRules.local to disable optimizations, then run gdb
    >>>>> loading RGui, "set solib-search-path", run RGui from
    >>>>> gdb. Then you can break to debugger from RGui menu, or
    >>>>> just run the code that segfaults, and you get to gdb
    >>>>> and can print the stacktrace, etc. You can find some
    >>>>> information in rw-FAQ (R for Windows FAQ), but yes, it
    >>>>> is harder than on Linux. We can take care of this
    >>>>> report, but of course in the longer term it would help
    >>>>> if more people could take their time to setup
    >>>>> debugging and analyze bugs even on Windows.
    >>>>>
    >>>>> Tomas
    >>>>>
>>>>> On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms
    >>>>> <[hidden email]> wrote:
    >>>>>>> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms
    >>>>>>> <[hidden email]> wrote:
    >>>>>>>> On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera
    >>>>>>>> <[hidden email]> wrote:
    >>>>>>>>> On 9/8/20 4:48 PM, Hugh Parsonage wrote:
    >>>>>>>>>> Unfortunately I only get
    >>>>>>>>>>
    >>>>>>>>>> [Thread 21752.0x4aa8 exited with code 3221225477]
    >>>>>>>>>> [Thread 21752.0x4514 exited with code 3221225477]
    >>>>>>>>>> [Thread 21752.0x3f10 exited with code 3221225477]
    >>>>>>>>>> [Inferior 1 (process 21752) exited with code
    >>>>>>>>>> 030000000005]
    >>>>>>>>>>
    >>>>>>>>>> (I'm guessing I would need to build an
    >>>>>>>>>> instrumented version of R, or can R be debugged
    >>>>>>>>>> using gdb with an off-the-shelf installation?)
    >>>>>>>>> No, the default build lacks debug symbols. You
    >>>>>>>>> need a build with debug symbols, and if you can
    >>>>>>>>> reproduce in a build without compiler
    >>>>>>>>> optimizations (-O0), the backtrace may be easier
    >>>>>>>>> to interpret. Some bugs however "disappear" when
    >>>>>>>>> optimizations are disabled. You can build R from
    >>>>>>>>> source (and there may be debug builds provided by
    >>>>>>>>> someone else (Jeroen?)).
    >>>>>>>> Debug builds for each revision are available from
    >>>>>>>> https://r-devel.github.io . To download the
    >>>>>>>> installer you need to click the github icon in the
    >>>>>>>> last column in the table. You need to be signed in
    >>>>>>>> with a (free) Github account in order to download
    >>>>>>>> builds (artifacts) from Github actions. It will
    >>>>>>>> show download links for both the regular installer
    >>>>>>>> and installer with debug symbols.
    >>>>>>>>
    >>>>>>>> In other news, the https://r-devel.github.io table
    >>>>>>>> also shows that the fix that martin committed is
    >>>>>>>> segfaulting on 32-bit.
    >>>>>>> Sorry that was inaccurate, it is not segfaulting at
    >>>>>>> all, but the unit test is raising an error on
    >>>>>>> 32-bit.




    > ------------------------------

    > Message: 29 Date: Wed, 9 Sep 2020 11:06:12 +0200 From:
    > Tomas Kalibera <[hidden email]> To: Jeroen Ooms
    > <[hidden email]> Cc: Hugh Parsonage
    > <[hidden email]>, Luke Tierney
    > <[hidden email]>, R-devel <[hidden email]>,
    > Martin Maechler <[hidden email]> Subject: Re:
    > [Rd] [External] Re: Operations with long altrep vectors
    > cause segfaults on Windows Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"; Format="flowed"

    > On 9/8/20 11:47 PM, Jeroen Ooms wrote:
    >> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms
    >> <[hidden email]> wrote:
    >>> On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera
    >>> <[hidden email]> wrote:
    >>>> On 9/8/20 4:48 PM, Hugh Parsonage wrote:
    >>>>> Unfortunately I only get
    >>>>>
    >>>>> [Thread 21752.0x4aa8 exited with code 3221225477]
    >>>>> [Thread 21752.0x4514 exited with code 3221225477]
    >>>>> [Thread 21752.0x3f10 exited with code 3221225477]
    >>>>> [Inferior 1 (process 21752) exited with code
    >>>>> 030000000005]
    >>>>>
    >>>>> (I'm guessing I would need to build an instrumented
    >>>>> version of R, or can R be debugged using gdb with an
    >>>>> off-the-shelf installation?)
    >>>> No, the default build lacks debug symbols. You need a
    >>>> build with debug symbols, and if you can reproduce in a
    >>>> build without compiler optimizations (-O0), the
    >>>> backtrace may be easier to interpret. Some bugs however
    >>>> "disappear" when optimizations are disabled. You can
    >>>> build R from source (and there may be debug builds
    >>>> provided by someone else (Jeroen?)).
    >>> Debug builds for each revision are available from
    >>> https://r-devel.github.io . To download the installer
    >>> you need to click the github icon in the last column in
    >>> the table. You need to be signed in with a (free) Github
    >>> account in order to download builds (artifacts) from
    >>> Github actions. It will show download links for both the
    >>> regular installer and installer with debug symbols.
    >>>
    >>> In other news, the https://r-devel.github.io table also
    >>> shows that the fix that martin committed is segfaulting
    >>> on 32-bit.
    >> Sorry that was inaccurate, it is not segfaulting at all,
    >> but the unit test is raising an error on 32-bit.

    > Now fixed, the test needs to be run only on 64-bit builds
    > where such long vectors/sequences are allowed.

    > Tomas




    > ------------------------------

    > Subject: Digest Footer

    > _______________________________________________
    > [hidden email] mailing list DIGESTED
    > https://stat.ethz.ch/mailman/listinfo/r-devel


    > ------------------------------

    > End of R-devel Digest, Vol 211, Issue 7
    > ***************************************
    > ______________________________________________
    > [hidden email] mailing list
    > https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply | Threaded
Open this post in threaded view
|

Re: more Matrix weirdness

aBBy Spurdle, ⍺XY
>     > "These operators are also implicit S4 generics, but as
>     > primitives, S4 methods will be dispatched only on S4
>     > objects ‘x’."

> Yes, exactly,  very well found, Georgi!

I'm sorry Martin, but I don't understand your point here.

I'm assuming that you want the (S3) matrix, x, to be converted to an
(S4) Matrix.

However, this is not a question of method dispatch, as such.
But rather a question of type conversion (integer to numeric to complex, etc).

Specifically, can/should automatic type conversion, convert an S3 data
type to an S4 data type, even where user-defined data types are
involved?

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: more Matrix weirdness

Georgi Boshnakov
In reply to this post by Martin Maechler
If the current semantics is to be kept, one approach might be to insert in the internal code of "[<-" something like the equivalent of

If(isS4(value))
    value <- coreData(value)

with the contract that classes that wish to be treated as equivalent to basic vector classes define suitable method for coreData(). So, a matrix class would return a plain matrix, a vector class - a vector, etc. This is akin to coredata() for time series in package 'zoo' and others.


Georgi Boshnakov

-----Original Message-----
From: Martin Maechler <[hidden email]>
Sent: 10 September 2020 13:48
To: Georgi Boshnakov <[hidden email]>
Cc: [hidden email]
Subject: Re: [Rd] more Matrix weirdness

>>>>> Georgi Boshnakov
>>>>>     on Wed, 9 Sep 2020 10:48:56 +0000 writes:

    > I think that this is because `[<-` dispatches on S4
    > methods only if the first argument is S4.  ?"[<-" says:

    > "These operators are also implicit S4 generics, but as
    > primitives, S4 methods will be dispatched only on S4
    > objects ‘x’."

    > Georgi Boshnakov

Yes, exactly,  very well found, Georgi!

This is something I would have wanted different for years, exactly because of several such problems with the Matrix package of which I'm the maintainer.

Long time ago I had also looked if I saw how to fix this behavior inside 'methods' (i.e. the S4 infrastructure pkg) and I think in this case also, inside R's basic C code.

At the time (~ 10 yrs ago) I gave up, but don't remember why.

I'm happy if you create a formal bug report, possibly "wishlist"
as it is documented behavior, for this infelicity...
and then I will probably add the  'HELPWANTED'  keyword.

Martin


    > -----Original Message-----


    > Message: 19 Date: Tue, 8 Sep 2020 22:04:44 -0400 From: Ben
    > Bolker <[hidden email]> To: r-devel
    > <[hidden email]> Subject: [Rd] more Matrix
    > weirdness Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"; Format="flowed"

    >    Am I being too optimistic in expecting this (mixing and
    > matching matrices and Matrices) to work?  If x is a matrix
    > and m is a Matrix, replacing a commensurately sized
    > sub-matrix of x with m throws "number of items to replace
    > is not a multiple of replacement length" ...

    > x <- matrix(0,nrow=3,ncol=10,
    > dimnames=list(letters[1:3],LETTERS[1:10])) rr <-
    > c("a","b","c") cc <- c("B","C","E") m <-
    > Matrix(matrix(1:9,3,3)) x[rr,cc] <- m

    >     cheers Ben Bolker




    > ------------------------------

    > Message: 20 Date: Wed, 9 Sep 2020 07:03:47 +0100 From: Rui
    > Barradas <[hidden email]> To: Ben Bolker
    > <[hidden email]>, r-devel <[hidden email]>
    > Subject: Re: [Rd] more Matrix weirdness Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"; Format="flowed"

    > Hello,

    > R 4.0.2 on Ubuntu 20.04, sessionInfo() below.

    > I can reproduce this, sort of. The error I'm getting is
    > different:


    > x[rr, cc] <- m #Error in x[rr, cc] <- m : replacement has
    > length zero

    > But if I check lengths and dimensions, they are
    > identical().

    > identical(length(x[rr, cc]), length(m)) #[1] TRUE
    > identical(dim(x[rr, cc]), dim(m)) #[1] TRUE


    > What works is


    > x[rr, cc] <- as.matrix(m)

    > I ran Ben's code on RStudio 1.3.1073, the following is run
    > with Rscript and the error message is the same.


    > rui@rui:~$ Rscript --vanilla rhelp.R R version 4.0.2
    > (2020-06-22) Platform: x86_64-pc-linux-gnu (64-bit)
    > Running under: Ubuntu 20.04.1 LTS

    > Matrix products: default BLAS:
    > /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0 LAPACK:
    > /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

    > locale: [1] LC_CTYPE=pt_PT.UTF-8 LC_NUMERIC=C [3]
    > LC_TIME=pt_PT.UTF-8 LC_COLLATE=pt_PT.UTF-8 [5]
    > LC_MONETARY=pt_PT.UTF-8 LC_MESSAGES=pt_PT.UTF-8 [7]
    > LC_PAPER=pt_PT.UTF-8 LC_NAME=C [9] LC_ADDRESS=C
    > LC_TELEPHONE=C [11] LC_MEASUREMENT=pt_PT.UTF-8
    > LC_IDENTIFICATION=C

    > attached base packages: [1] stats graphics grDevices utils
    > datasets methods base

    > other attached packages: [1] Matrix_1.2-18

    > loaded via a namespace (and not attached): [1]
    > compiler_4.0.2 grid_4.0.2 lattice_0.20-41 Error in x[rr,
    > cc] <- m : number of items to replace is not a multiple of
    > replacement length Execution halted


    > Hope this helps,

    > Rui Barradas


    > Às 03:04 de 09/09/20, Ben Bolker escreveu:
    >>   Am I being too optimistic in expecting this (mixing and
    >> matching matrices and Matrices) to work?  If x is a
    >> matrix and m is a Matrix, replacing a commensurately
    >> sized sub-matrix of x with m throws "number of items to
    >> replace is not a multiple of replacement length" ...
    >>
    >> x <- matrix(0,nrow=3,ncol=10,
    >> dimnames=list(letters[1:3],LETTERS[1:10])) rr <-
    >> c("a","b","c") cc <- c("B","C","E") m <-
    >> Matrix(matrix(1:9,3,3)) x[rr,cc] <- m
    >>
    >>    cheers     Ben Bolker
    >>
    >> ______________________________________________
    >> [hidden email] mailing list
    >> https://stat.ethz.ch/mailman/listinfo/r-devel




    > ------------------------------

    > Message: 21 Date: Wed, 9 Sep 2020 08:27:06 +0200 From: Uwe
    > Ligges <[hidden email]> To:
    > [hidden email] Subject: Re: [Rd] failing automatic
    > incoming check Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"; Format="flowed"



    > On 08.09.2020 21:34, Sebastian P. Luque wrote:
    >> Hello,
    >>
    >> I got a notification regarding a failure to pass incoming
    >> checks automatically after a CRAN submission.  The
    >> details are given here:
    >>
    >> https://win-builder.r-project.org/incoming_pretest/diveMove_1.5.0_20200908_191325/
    >>
    >> The only visible issue is a NOTE from the macosx build,
    >> with the very terse:
    >>
    >> "No Protocol Specified"
    >>
    >> My searches suggest this can be ignored, but it would be
    >> nice to squash it.  Any tips welcome.
    >>


    > For some reason this should hgave undergone manual
    > inpection but got auto rejected. Ideally you would reduce
    > the test timing so that the overall check time is less
    > than 10 min .

    > Best, Uwe Ligges




    > ------------------------------

    > Message: 22 Date: Wed, 9 Sep 2020 16:48:40 +1000 From:
    > Hugh Parsonage <[hidden email]> To: Jeroen Ooms
    > <[hidden email]> Cc: Tomas Kalibera
    > <[hidden email]>, Luke Tierney
    > <[hidden email]>, R-devel <[hidden email]>,
    > Martin Maechler <[hidden email]> Subject: Re:
    > [Rd] [External] Re: Operations with long altrep vectors
    > cause segfaults on Windows Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"

    > I am unable to set break or use gdb with any success when
    > I use that version.

    > On linux I would do R -d gdb but this gives "unknown
    > option '-d' " while gdb R.exe (in the same directory as
    > the debug version) gives the same output as before.

    > I'm happy to help but I appreciate this list might not be
    > the best place to get a tutorial on using gdb on Windows.

    > On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms
    > <[hidden email]> wrote:
    >>
    >> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms
    >> <[hidden email]> wrote:
    >> >
    >> > On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera
    >> <[hidden email]> wrote:
    >> > >
    >> > > On 9/8/20 4:48 PM, Hugh Parsonage wrote: > > >
    >> Unfortunately I only get
    >> > > >
    >> > > > [Thread 21752.0x4aa8 exited with code 3221225477] >
    >> > > [Thread 21752.0x4514 exited with code 3221225477] > >
    >> > [Thread 21752.0x3f10 exited with code 3221225477] > > >
    >> [Inferior 1 (process 21752) exited with code
    >> 030000000005]
    >> > > >
    >> > > > (I'm guessing I would need to build an instrumented
    >> version of R, or > > > can R be debugged using gdb with
    >> an off-the-shelf installation?)
    >> > >
    >> > > No, the default build lacks debug symbols. You need a
    >> build with debug > > symbols, and if you can reproduce in
    >> a build without compiler > > optimizations (-O0), the
    >> backtrace may be easier to interpret. Some bugs > >
    >> however "disappear" when optimizations are disabled. You
    >> can build R > > from source (and there may be debug
    >> builds provided by someone else > > (Jeroen?)).
    >> >
    >> > Debug builds for each revision are available from >
    >> https://r-devel.github.io . To download the installer you
    >> need to > click the github icon in the last column in the
    >> table. You need to be > signed in with a (free) Github
    >> account in order to download builds > (artifacts) from
    >> Github actions. It will show download links for both >
    >> the regular installer and installer with debug symbols.
    >> >
    >> > In other news, the https://r-devel.github.io table also
    >> shows that the > fix that martin committed is segfaulting
    >> on 32-bit.
    >>
    >> Sorry that was inaccurate, it is not segfaulting at all,
    >> but the unit test is raising an error on 32-bit.




    > ------------------------------

    > Message: 23 Date: Wed, 9 Sep 2020 09:03:05 +0200 From:
    > Tomas Kalibera <[hidden email]> To: Hugh
    > Parsonage <[hidden email]>, Jeroen Ooms
    > <[hidden email]> Cc: Luke Tierney
    > <[hidden email]>, R-devel <[hidden email]>,
    > Martin Maechler <[hidden email]> Subject: Re:
    > [Rd] [External] Re: Operations with long altrep vectors
    > cause segfaults on Windows Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"; Format="flowed"

    > On 9/9/20 8:48 AM, Hugh Parsonage wrote:
    >> I am unable to set break or use gdb with any success when
    >> I use that version.
    >>
    >> On linux I would do R -d gdb but this gives "unknown
    >> option '-d' " while gdb R.exe (in the same directory as
    >> the debug version) gives the same output as before.
    >>
    >> I'm happy to help but I appreciate this list might not be
    >> the best place to get a tutorial on using gdb on Windows.

    > Essentially, the steps are: build with DEBUG=T (to have
    > debug symbols), possibly updating EOPTS in MkRules.local
    > to disable optimizations, then run gdb loading RGui, "set
    > solib-search-path", run RGui from gdb. Then you can break
    > to debugger from RGui menu, or just run the code that
    > segfaults, and you get to gdb and can print the
    > stacktrace, etc. You can find some information in rw-FAQ
    > (R for Windows FAQ), but yes, it is harder than on
    > Linux. We can take care of this report, but of course in
    > the longer term it would help if more people could take
    > their time to setup debugging and analyze bugs even on
    > Windows.

    > Tomas

    >>
    >> On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms
    >> <[hidden email]> wrote:
    >>> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms
    >>> <[hidden email]> wrote:
    >>>> On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera
    >>>> <[hidden email]> wrote:
    >>>>> On 9/8/20 4:48 PM, Hugh Parsonage wrote:
>>>>> Unfortunately I only get
    >>>>>>
>>>>> [Thread 21752.0x4aa8 exited with code 3221225477] [Thread
>>>>> 21752.0x4514 exited with code 3221225477] [Thread 21752.0x3f10
>>>>> exited with code 3221225477] [Inferior 1 (process 21752) exited
>>>>> with code 030000000005]
    >>>>>>
>>>>> (I'm guessing I would need to build an instrumented
    >>>>>> version of R, or
>>>>> can R be debugged using gdb with an off-the-shelf
    >>>>>> installation?)
    >>>>> No, the default build lacks debug symbols. You need a
    >>>>> build with debug symbols, and if you can reproduce in
    >>>>> a build without compiler optimizations (-O0), the
    >>>>> backtrace may be easier to interpret. Some bugs
    >>>>> however "disappear" when optimizations are
    >>>>> disabled. You can build R from source (and there may
    >>>>> be debug builds provided by someone else (Jeroen?)).
    >>>> Debug builds for each revision are available from
    >>>> https://r-devel.github.io . To download the installer
    >>>> you need to click the github icon in the last column in
    >>>> the table. You need to be signed in with a (free)
    >>>> Github account in order to download builds (artifacts)
    >>>> from Github actions. It will show download links for
    >>>> both the regular installer and installer with debug
    >>>> symbols.
    >>>>
    >>>> In other news, the https://r-devel.github.io table also
    >>>> shows that the fix that martin committed is segfaulting
    >>>> on 32-bit.
    >>> Sorry that was inaccurate, it is not segfaulting at all,
    >>> but the unit test is raising an error on 32-bit.




    > ------------------------------

    > Message: 24 Date: Wed, 9 Sep 2020 17:30:17 +1000 From:
    > Hugh Parsonage <[hidden email]> To: Tomas
    > Kalibera <[hidden email]> Cc: Jeroen Ooms
    > <[hidden email]>, Luke Tierney
    > <[hidden email]>, R-devel <[hidden email]>,
    > Martin Maechler <[hidden email]> Subject: Re:
    > [Rd] [External] Re: Operations with long altrep vectors
    > cause segfaults on Windows Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"

    > Thank you!

    > I get

    > Starting program: C:\R\R-devel-20200909\bin\x64\Rgui.exe
    > [New Thread 19940.0x638c] [New Thread 19940.0x102c] [New
    > Thread 19940.0x329c] [New Thread 19940.0x37dc] warning:
    > Invalid parameter passed to C runtime function.

    > Program received signal SIGSEGV, Segmentation fault.
    > 0x000000006c72d206 in compact_intseq_Dataptr
    > (x=0x12783350, writeable=<optimized out>) at
    > altclasses.c:169 169 altclasses.c: No such file or
    > directory.

    > On Wed, 9 Sep 2020 at 17:03, Tomas Kalibera
    > <[hidden email]> wrote:
    >>
    >> On 9/9/20 8:48 AM, Hugh Parsonage wrote: > I am unable to
    >> set break or use gdb with any success when I use that
    >> version.
    >> >
    >> > On linux I would do R -d gdb but this gives "unknown
    >> option '-d' " > while gdb R.exe (in the same directory as
    >> the debug version) gives the > same output as before.
    >> >
    >> > I'm happy to help but I appreciate this list might not
    >> be the best > place to get a tutorial on using gdb on
    >> Windows.
    >>
    >> Essentially, the steps are: build with DEBUG=T (to have
    >> debug symbols), possibly updating EOPTS in MkRules.local
    >> to disable optimizations, then run gdb loading RGui, "set
    >> solib-search-path", run RGui from gdb. Then you can break
    >> to debugger from RGui menu, or just run the code that
    >> segfaults, and you get to gdb and can print the
    >> stacktrace, etc. You can find some information in rw-FAQ
    >> (R for Windows FAQ), but yes, it is harder than on
    >> Linux. We can take care of this report, but of course in
    >> the longer term it would help if more people could take
    >> their time to setup debugging and analyze bugs even on
    >> Windows.
    >>
    >> Tomas
    >>
    >> >
    >> > On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms
    >> <[hidden email]> wrote: >> On Tue, Sep 8, 2020 at
    >> 11:44 PM Jeroen Ooms <[hidden email]> wrote: >>> On
    >> Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera
    >> <[hidden email]> wrote: >>>> On 9/8/20 4:48 PM,
    >> Hugh Parsonage wrote: >>>>> Unfortunately I only get
    >> >>>>>
    >> >>>>> [Thread 21752.0x4aa8 exited with code 3221225477]
    >> >>>>> [Thread 21752.0x4514 exited with code 3221225477]
    >> >>>>> [Thread 21752.0x3f10 exited with code 3221225477]
    >> >>>>> [Inferior 1 (process 21752) exited with code
    >> 030000000005]
    >> >>>>>
    >> >>>>> (I'm guessing I would need to build an instrumented
    >> version of R, or >>>>> can R be debugged using gdb with
    >> an off-the-shelf installation?)  >>>> No, the default
    >> build lacks debug symbols. You need a build with debug
    >> >>>> symbols, and if you can reproduce in a build without
    >> compiler >>>> optimizations (-O0), the backtrace may be
    >> easier to interpret. Some bugs >>>> however "disappear"
    >> when optimizations are disabled. You can build R >>>>
    >> from source (and there may be debug builds provided by
    >> someone else >>>> (Jeroen?)).  >>> Debug builds for each
    >> revision are available from >>> https://r-devel.github.io
    >> . To download the installer you need to >>> click the
    >> github icon in the last column in the table. You need to
    >> be >>> signed in with a (free) Github account in order to
    >> download builds >>> (artifacts) from Github actions. It
    >> will show download links for both >>> the regular
    >> installer and installer with debug symbols.
    >> >>>
    >> >>> In other news, the https://r-devel.github.io table
    >> also shows that the >>> fix that martin committed is
    >> segfaulting on 32-bit.  >> Sorry that was inaccurate, it
    >> is not segfaulting at all, but the unit >> test is
    >> raising an error on 32-bit.
    >>
    >>




    > ------------------------------

    > Message: 25 Date: Wed, 9 Sep 2020 08:00:41 +0000 From:
    > "Koenker, Roger W" <[hidden email]> To: r-devel
    > <[hidden email]> Subject: [Rd] Environmental
    > Messaging Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"

    > What sort of message is this to send to the younger
    > generation?

    >> plastic = 1:5 card = 1:4 board = 1:4
    >> plastic/crossprod(card,board)
    > [1] 0.03333333 0.06666667 0.10000000 0.13333333 0.16666667
    > Warning message: In plastic/crossprod(card, board) :
    > Recycling array of length 1 in vector-array arithmetic is
    > deprecated.  Use c() or as.vector() instead.

    > ok, I can write c(crossprod()) but it is ugly, and
    > environmentally wasteful.  What’s next?  Warnings for my
    > beloved outer(card, board) * board

    > ------------------------------

    > Message: 26 Date: Wed, 9 Sep 2020 10:00:55 +0200 From:
    > Tomas Kalibera <[hidden email]> To: Hugh
    > Parsonage <[hidden email]> Cc: Jeroen Ooms
    > <[hidden email]>, Luke Tierney
    > <[hidden email]>, R-devel <[hidden email]>,
    > Martin Maechler <[hidden email]> Subject: Re:
    > [Rd] [External] Re: Operations with long altrep vectors
    > cause segfaults on Windows Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"; Format="flowed"

    > On 9/9/20 9:30 AM, Hugh Parsonage wrote:
    >> Thank you!
    >>
    >> I get
    >>
    >> Starting program: C:\R\R-devel-20200909\bin\x64\Rgui.exe
    >> [New Thread 19940.0x638c] [New Thread 19940.0x102c] [New
    >> Thread 19940.0x329c] [New Thread 19940.0x37dc] warning:
    >> Invalid parameter passed to C runtime function.
    >>
    >> Program received signal SIGSEGV, Segmentation fault.
    >> 0x000000006c72d206 in compact_intseq_Dataptr
    >> (x=0x12783350, writeable=<optimized out>) at
    >> altclasses.c:169 169 altclasses.c: No such file or
    >> directory.

    > Thanks, would you know which svn version this is?

    > Tomas

    >>
    >> On Wed, 9 Sep 2020 at 17:03, Tomas Kalibera
    >> <[hidden email]> wrote:
    >>> On 9/9/20 8:48 AM, Hugh Parsonage wrote:
    >>>> I am unable to set break or use gdb with any success
    >>>> when I use that version.
    >>>>
    >>>> On linux I would do R -d gdb but this gives "unknown
    >>>> option '-d' " while gdb R.exe (in the same directory as
    >>>> the debug version) gives the same output as before.
    >>>>
    >>>> I'm happy to help but I appreciate this list might not
    >>>> be the best place to get a tutorial on using gdb on
    >>>> Windows.
    >>> Essentially, the steps are: build with DEBUG=T (to have
    >>> debug symbols), possibly updating EOPTS in MkRules.local
    >>> to disable optimizations, then run gdb loading RGui,
    >>> "set solib-search-path", run RGui from gdb. Then you can
    >>> break to debugger from RGui menu, or just run the code
    >>> that segfaults, and you get to gdb and can print the
    >>> stacktrace, etc. You can find some information in rw-FAQ
    >>> (R for Windows FAQ), but yes, it is harder than on
    >>> Linux. We can take care of this report, but of course in
    >>> the longer term it would help if more people could take
    >>> their time to setup debugging and analyze bugs even on
    >>> Windows.
    >>>
    >>> Tomas
    >>>
    >>>> On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms
    >>>> <[hidden email]> wrote:
    >>>>> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms
    >>>>> <[hidden email]> wrote:
>>>>> On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera
    >>>>> <[hidden email]> wrote:
    >>>>>>> On 9/8/20 4:48 PM, Hugh Parsonage wrote:
    >>>>>>>> Unfortunately I only get
    >>>>>>>>
    >>>>>>>> [Thread 21752.0x4aa8 exited with code 3221225477]
    >>>>>>>> [Thread 21752.0x4514 exited with code 3221225477]
    >>>>>>>> [Thread 21752.0x3f10 exited with code 3221225477]
    >>>>>>>> [Inferior 1 (process 21752) exited with code
    >>>>>>>> 030000000005]
    >>>>>>>>
    >>>>>>>> (I'm guessing I would need to build an instrumented
    >>>>>>>> version of R, or can R be debugged using gdb with
    >>>>>>>> an off-the-shelf installation?)
    >>>>>>> No, the default build lacks debug symbols. You need
    >>>>>>> a build with debug symbols, and if you can reproduce
    >>>>>>> in a build without compiler optimizations (-O0), the
    >>>>>>> backtrace may be easier to interpret. Some bugs
    >>>>>>> however "disappear" when optimizations are
    >>>>>>> disabled. You can build R from source (and there may
    >>>>>>> be debug builds provided by someone else (Jeroen?)).
>>>>> Debug builds for each revision are available from
>>>>> https://r-devel.github.io . To download the installer you
    >>>>>>> need to
>>>>> click the github icon in the last column in the table. You
    >>>>>>> need to be
>>>>> signed in with a (free) Github account in order to
    >>>>>>> download builds
>>>>> (artifacts) from Github actions. It will show download
    >>>>>>> links for both
>>>>> the regular installer and installer with debug symbols.
    >>>>>>
>>>>> In other news, the https://r-devel.github.io table also
    >>>>>> shows that the
>>>>> fix that martin committed is segfaulting on 32-bit.
    >>>>> Sorry that was inaccurate, it is not segfaulting at
    >>>>> all, but the unit test is raising an error on 32-bit.
    >>>




    > ------------------------------

    > Message: 27 Date: Wed, 9 Sep 2020 18:32:58 +1000 From:
    > Hugh Parsonage <[hidden email]> To: Tomas
    > Kalibera <[hidden email]> Cc: Jeroen Ooms
    > <[hidden email]>, Luke Tierney
    > <[hidden email]>, R-devel <[hidden email]>,
    > Martin Maechler <[hidden email]> Subject: Re:
    > [Rd] [External] Re: Operations with long altrep vectors
    > cause segfaults on Windows Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"

    > R Under development (unstable) (2020-09-08 r79165)

    > On Wed, 9 Sep 2020 at 18:00, Tomas Kalibera
    > <[hidden email]> wrote:
    >>
    >> On 9/9/20 9:30 AM, Hugh Parsonage wrote: > Thank you!
    >> >
    >> > I get
    >> >
    >> > Starting program:
    >> C:\R\R-devel-20200909\bin\x64\Rgui.exe > [New Thread
    >> 19940.0x638c] > [New Thread 19940.0x102c] > [New Thread
    >> 19940.0x329c] > [New Thread 19940.0x37dc] > warning:
    >> Invalid parameter passed to C runtime function.
    >> >
    >> > Program received signal SIGSEGV, Segmentation fault.  >
    >> 0x000000006c72d206 in compact_intseq_Dataptr
    >> (x=0x12783350, > writeable=<optimized out>) at
    >> altclasses.c:169 > 169 altclasses.c: No such file or
    >> directory.
    >>
    >> Thanks, would you know which svn version this is?
    >>
    >> Tomas
    >>
    >> >
    >> > On Wed, 9 Sep 2020 at 17:03, Tomas Kalibera
    >> <[hidden email]> wrote: >> On 9/9/20 8:48 AM,
    >> Hugh Parsonage wrote: >>> I am unable to set break or use
    >> gdb with any success when I use that version.
    >> >>>
    >> >>> On linux I would do R -d gdb but this gives "unknown
    >> option '-d' " >>> while gdb R.exe (in the same directory
    >> as the debug version) gives the >>> same output as
    >> before.
    >> >>>
    >> >>> I'm happy to help but I appreciate this list might
    >> not be the best >>> place to get a tutorial on using gdb
    >> on Windows.  >> Essentially, the steps are: build with
    >> DEBUG=T (to have debug symbols), >> possibly updating
    >> EOPTS in MkRules.local to disable optimizations, then >>
    >> run gdb loading RGui, "set solib-search-path", run RGui
    >> from gdb. Then >> you can break to debugger from RGui
    >> menu, or just run the code that >> segfaults, and you get
    >> to gdb and can print the stacktrace, etc. You can >> find
    >> some information in rw-FAQ (R for Windows FAQ), but yes,
    >> it is >> harder than on Linux. We can take care of this
    >> report, but of course in >> the longer term it would help
    >> if more people could take their time to >> setup
    >> debugging and analyze bugs even on Windows.
    >> >>
    >> >> Tomas
    >> >>
    >> >>> On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms
    >> <[hidden email]> wrote: >>>> On Tue, Sep 8, 2020 at
    >> 11:44 PM Jeroen Ooms <[hidden email]> wrote: >>>>>
    >> On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera
    >> <[hidden email]> wrote: >>>>>> On 9/8/20 4:48
    >> PM, Hugh Parsonage wrote: >>>>>>> Unfortunately I only
    >> get
    >> >>>>>>>
    >> >>>>>>> [Thread 21752.0x4aa8 exited with code 3221225477]
    >> >>>>>>> [Thread 21752.0x4514 exited with code 3221225477]
    >> >>>>>>> [Thread 21752.0x3f10 exited with code 3221225477]
    >> >>>>>>> [Inferior 1 (process 21752) exited with code
    >> 030000000005]
    >> >>>>>>>
    >> >>>>>>> (I'm guessing I would need to build an
    >> instrumented version of R, or >>>>>>> can R be debugged
    >> using gdb with an off-the-shelf installation?)  >>>>>>
    >> No, the default build lacks debug symbols. You need a
    >> build with debug >>>>>> symbols, and if you can reproduce
    >> in a build without compiler >>>>>> optimizations (-O0),
    >> the backtrace may be easier to interpret. Some bugs
    >> >>>>>> however "disappear" when optimizations are
    >> disabled. You can build R >>>>>> from source (and there
    >> may be debug builds provided by someone else >>>>>>
    >> (Jeroen?)).  >>>>> Debug builds for each revision are
    >> available from >>>>> https://r-devel.github.io . To
    >> download the installer you need to >>>>> click the github
    >> icon in the last column in the table. You need to be
    >> >>>>> signed in with a (free) Github account in order to
    >> download builds >>>>> (artifacts) from Github actions. It
    >> will show download links for both >>>>> the regular
    >> installer and installer with debug symbols.
    >> >>>>>
    >> >>>>> In other news, the https://r-devel.github.io table
    >> also shows that the >>>>> fix that martin committed is
    >> segfaulting on 32-bit.  >>>> Sorry that was inaccurate,
    >> it is not segfaulting at all, but the unit >>>> test is
    >> raising an error on 32-bit.
    >> >>
    >>




    > ------------------------------

    > Message: 28 Date: Wed, 9 Sep 2020 10:53:18 +0200 From:
    > Tomas Kalibera <[hidden email]> To: Hugh
    > Parsonage <[hidden email]> Cc: Jeroen Ooms
    > <[hidden email]>, Luke Tierney
    > <[hidden email]>, R-devel <[hidden email]>,
    > Martin Maechler <[hidden email]> Subject: Re:
    > [Rd] [External] Re: Operations with long altrep vectors
    > cause segfaults on Windows Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"; Format="flowed"

    > Thanks. Should be now fixed in 79169.  Tomas

    > On 9/9/20 10:32 AM, Hugh Parsonage wrote:
    >> R Under development (unstable) (2020-09-08 r79165)
    >>
    >> On Wed, 9 Sep 2020 at 18:00, Tomas Kalibera
    >> <[hidden email]> wrote:
    >>> On 9/9/20 9:30 AM, Hugh Parsonage wrote:
    >>>> Thank you!
    >>>>
    >>>> I get
    >>>>
    >>>> Starting program:
    >>>> C:\R\R-devel-20200909\bin\x64\Rgui.exe [New Thread
    >>>> 19940.0x638c] [New Thread 19940.0x102c] [New Thread
    >>>> 19940.0x329c] [New Thread 19940.0x37dc] warning:
    >>>> Invalid parameter passed to C runtime function.
    >>>>
    >>>> Program received signal SIGSEGV, Segmentation fault.
    >>>> 0x000000006c72d206 in compact_intseq_Dataptr
    >>>> (x=0x12783350, writeable=<optimized out>) at
    >>>> altclasses.c:169 169 altclasses.c: No such file or
    >>>> directory.
    >>> Thanks, would you know which svn version this is?
    >>>
    >>> Tomas
    >>>
    >>>> On Wed, 9 Sep 2020 at 17:03, Tomas Kalibera
    >>>> <[hidden email]> wrote:
    >>>>> On 9/9/20 8:48 AM, Hugh Parsonage wrote:
>>>>> I am unable to set break or use gdb with any success when
    >>>>> I use that version.
    >>>>>>
>>>>> On linux I would do R -d gdb but this gives "unknown
    >>>>>> option '-d' "
>>>>> while gdb R.exe (in the same directory as the debug
    >>>>>> version) gives the
>>>>> same output as before.
    >>>>>>
>>>>> I'm happy to help but I appreciate this list might not be
    >>>>>> the best
>>>>> place to get a tutorial on using gdb on Windows.
    >>>>> Essentially, the steps are: build with DEBUG=T (to
    >>>>> have debug symbols), possibly updating EOPTS in
    >>>>> MkRules.local to disable optimizations, then run gdb
    >>>>> loading RGui, "set solib-search-path", run RGui from
    >>>>> gdb. Then you can break to debugger from RGui menu, or
    >>>>> just run the code that segfaults, and you get to gdb
    >>>>> and can print the stacktrace, etc. You can find some
    >>>>> information in rw-FAQ (R for Windows FAQ), but yes, it
    >>>>> is harder than on Linux. We can take care of this
    >>>>> report, but of course in the longer term it would help
    >>>>> if more people could take their time to setup
    >>>>> debugging and analyze bugs even on Windows.
    >>>>>
    >>>>> Tomas
    >>>>>
>>>>> On Wed, 9 Sep 2020 at 07:47, Jeroen Ooms
    >>>>> <[hidden email]> wrote:
    >>>>>>> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms
    >>>>>>> <[hidden email]> wrote:
    >>>>>>>> On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera
    >>>>>>>> <[hidden email]> wrote:
    >>>>>>>>> On 9/8/20 4:48 PM, Hugh Parsonage wrote:
    >>>>>>>>>> Unfortunately I only get
    >>>>>>>>>>
    >>>>>>>>>> [Thread 21752.0x4aa8 exited with code 3221225477]
    >>>>>>>>>> [Thread 21752.0x4514 exited with code 3221225477]
    >>>>>>>>>> [Thread 21752.0x3f10 exited with code 3221225477]
    >>>>>>>>>> [Inferior 1 (process 21752) exited with code
    >>>>>>>>>> 030000000005]
    >>>>>>>>>>
    >>>>>>>>>> (I'm guessing I would need to build an
    >>>>>>>>>> instrumented version of R, or can R be debugged
    >>>>>>>>>> using gdb with an off-the-shelf installation?)
    >>>>>>>>> No, the default build lacks debug symbols. You
    >>>>>>>>> need a build with debug symbols, and if you can
    >>>>>>>>> reproduce in a build without compiler
    >>>>>>>>> optimizations (-O0), the backtrace may be easier
    >>>>>>>>> to interpret. Some bugs however "disappear" when
    >>>>>>>>> optimizations are disabled. You can build R from
    >>>>>>>>> source (and there may be debug builds provided by
    >>>>>>>>> someone else (Jeroen?)).
    >>>>>>>> Debug builds for each revision are available from
    >>>>>>>> https://r-devel.github.io . To download the
    >>>>>>>> installer you need to click the github icon in the
    >>>>>>>> last column in the table. You need to be signed in
    >>>>>>>> with a (free) Github account in order to download
    >>>>>>>> builds (artifacts) from Github actions. It will
    >>>>>>>> show download links for both the regular installer
    >>>>>>>> and installer with debug symbols.
    >>>>>>>>
    >>>>>>>> In other news, the https://r-devel.github.io table
    >>>>>>>> also shows that the fix that martin committed is
    >>>>>>>> segfaulting on 32-bit.
    >>>>>>> Sorry that was inaccurate, it is not segfaulting at
    >>>>>>> all, but the unit test is raising an error on
    >>>>>>> 32-bit.




    > ------------------------------

    > Message: 29 Date: Wed, 9 Sep 2020 11:06:12 +0200 From:
    > Tomas Kalibera <[hidden email]> To: Jeroen Ooms
    > <[hidden email]> Cc: Hugh Parsonage
    > <[hidden email]>, Luke Tierney
    > <[hidden email]>, R-devel <[hidden email]>,
    > Martin Maechler <[hidden email]> Subject: Re:
    > [Rd] [External] Re: Operations with long altrep vectors
    > cause segfaults on Windows Message-ID:
    > <[hidden email]>
    > Content-Type: text/plain; charset="utf-8"; Format="flowed"

    > On 9/8/20 11:47 PM, Jeroen Ooms wrote:
    >> On Tue, Sep 8, 2020 at 11:44 PM Jeroen Ooms
    >> <[hidden email]> wrote:
    >>> On Tue, Sep 8, 2020 at 5:20 PM Tomas Kalibera
    >>> <[hidden email]> wrote:
    >>>> On 9/8/20 4:48 PM, Hugh Parsonage wrote:
    >>>>> Unfortunately I only get
    >>>>>
    >>>>> [Thread 21752.0x4aa8 exited with code 3221225477]
    >>>>> [Thread 21752.0x4514 exited with code 3221225477]
    >>>>> [Thread 21752.0x3f10 exited with code 3221225477]
    >>>>> [Inferior 1 (process 21752) exited with code
    >>>>> 030000000005]
    >>>>>
    >>>>> (I'm guessing I would need to build an instrumented
    >>>>> version of R, or can R be debugged using gdb with an
    >>>>> off-the-shelf installation?)
    >>>> No, the default build lacks debug symbols. You need a
    >>>> build with debug symbols, and if you can reproduce in a
    >>>> build without compiler optimizations (-O0), the
    >>>> backtrace may be easier to interpret. Some bugs however
    >>>> "disappear" when optimizations are disabled. You can
    >>>> build R from source (and there may be debug builds
    >>>> provided by someone else (Jeroen?)).
    >>> Debug builds for each revision are available from
    >>> https://r-devel.github.io . To download the installer
    >>> you need to click the github icon in the last column in
    >>> the table. You need to be signed in with a (free) Github
    >>> account in order to download builds (artifacts) from
    >>> Github actions. It will show download links for both the
    >>> regular installer and installer with debug symbols.
    >>>
    >>> In other news, the https://r-devel.github.io table also
    >>> shows that the fix that martin committed is segfaulting
    >>> on 32-bit.
    >> Sorry that was inaccurate, it is not segfaulting at all,
    >> but the unit test is raising an error on 32-bit.

    > Now fixed, the test needs to be run only on 64-bit builds
    > where such long vectors/sequences are allowed.

    > Tomas




    > ------------------------------

    > Subject: Digest Footer

    > _______________________________________________
    > [hidden email] mailing list DIGESTED
    > https://stat.ethz.ch/mailman/listinfo/r-devel


    > ------------------------------

    > End of R-devel Digest, Vol 211, Issue 7
    > ***************************************
    > ______________________________________________
    > [hidden email] mailing list
    > https://stat.ethz.ch/mailman/listinfo/r-devel
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: more Matrix weirdness

Georgi Boshnakov
In reply to this post by aBBy Spurdle, ⍺XY
Abby, my answer was too concise. The thrust is that even if you define a method for
"[<-" with signature x="matrix" and value ="Matrix", for example, it will never be used since "matrix" is S3.
If instead x="someS4class" then the S4 method will be invoked.

There may be cases when changing the class of the left-hand side make sense (such as one subclass of "Matrix" to another) but certainly not for the base R vector classes.


Georgi Boshnakov


-----Original Message-----
From: Abby Spurdle <[hidden email]>
Sent: 11 September 2020 03:03
To: Martin Maechler <[hidden email]>
Cc: Georgi Boshnakov <[hidden email]>; [hidden email]
Subject: Re: [Rd] more Matrix weirdness

>     > "These operators are also implicit S4 generics, but as
>     > primitives, S4 methods will be dispatched only on S4
>     > objects ‘x’."

> Yes, exactly,  very well found, Georgi!

I'm sorry Martin, but I don't understand your point here.

I'm assuming that you want the (S3) matrix, x, to be converted to an
(S4) Matrix.

However, this is not a question of method dispatch, as such.
But rather a question of type conversion (integer to numeric to complex, etc).

Specifically, can/should automatic type conversion, convert an S3 data type to an S4 data type, even where user-defined data types are involved?
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: more Matrix weirdness

aBBy Spurdle, ⍺XY
> There may be cases when changing the class of the left-hand side make sense (such as one subclass of "Matrix" to another) but certainly not for the base R vector classes.

I'm not sure what you mean by "not for the base R vector classes".
Historically, the simpler class (or mode) gets coerced to the more
complex class (or mode).

    x <- y <- 1:10
    y [1] <- 1

    (class (x) == class (y) ) #FALSE

Also, I note the behavior of multiplication of a matrix with a Matrix.

    library (Matrix)

    m <- matrix (1:16, 4, 4)
    M <- Matrix (1:16, 4, 4)

    as.vector (class (m * M) )   #dgeMatrix
    as.vector (class (M * m) )   #dgeMatrix
    as.vector (class (m %*% M) ) #dgeMatrix
    as.vector (class (M %*% m) ) #dgeMatrix

So, here also, the output is a Matrix, regardless of the type of
multiplication, or the order of the operands.

But the following surprised me:

    k <- m
    mode (k) <- "complex"
    k %*% M

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel