From m@ech|er @end|ng |rom @t@t@m@th@ethz@ch  Tue Jun  8 18:32:14 2021
From: m@ech|er @end|ng |rom @t@t@m@th@ethz@ch (Martin Maechler)
Date: Tue, 8 Jun 2021 18:32:14 +0200
Subject: [Rd] dgTMatrix Segmentation Fault
In-Reply-To: <SYBPR01MB4761A3436511885B1346831ACD379@SYBPR01MB4761.ausprd01.prod.outlook.com>
References: <SYBPR01MB4761C684F1CA43CA4945FA25CD389@SYBPR01MB4761.ausprd01.prod.outlook.com>
 <91d30364-998a-c783-b9c5-9b05405d30b2@insa-toulouse.fr>
 <SYBPR01MB4761A3436511885B1346831ACD379@SYBPR01MB4761.ausprd01.prod.outlook.com>
Message-ID: <24767.39822.987117.724657@stat.math.ethz.ch>

>>>>> Dario Strbenac 
>>>>>     on Tue, 8 Jun 2021 09:00:04 +0000 writes:

    > Good day, Indeed, changing the logical test is a
    > workaround to the problem. However, a segmentation fault
    > means that the software tried to access an invalid memory
    > location, so I think the original problem should be
    > addressed in Matrix package, regardless.

Hmm, you maybe right or not ..

Note we have the situation you (via R) ask your computer
(i.e. the OS system memory allocation routines) to provide
memory.

In a reasonable setup, the OS routine returns, saying
"I cannot provide the memory you asked for",
and the R function stop() s. .. no segfault, all is fine.

The problem that on some platforms that does not work, is a
relatively deep problem  and also has happened in base R in some
cases on some platforms (possibly never on Linux based ones
(Ubuntu, Debian, Fedora, CentOS..),  but maybe I'm too
optimistic there as well.

Note: I now also tried on our oldish Windows (Terminal) Server,
and it also just gave errors that it could not allocate so much
memory but did not produce a seg.fault.


Currently, I don't see what we should improve in the Matrix
package here.

Martin Maechler
(co-maintainer of 'Matrix')

    > --------------------------------------
    > Dario Strbenac University of Sydney Camperdown NSW 2050
    > Australia



[Rd] dgTMatrix Segmentation Fault
Martin Maechler