From novo@|rj @end|ng |rom rutger@@edu  Sat Apr 10 01:34:13 2021
From: novo@|rj @end|ng |rom rutger@@edu (Ryan Novosielski)
Date: Fri, 9 Apr 2021 23:34:13 +0000
Subject: [Rd] R 4.0.1-4.0.5 built with Intel Composer 19.0-19.1.1,
 error in "make check" on CentOS 7.7-7.9
In-Reply-To: <20200625150621.3854a233@Tarkus>
References: <70478914-CEB6-4C5A-A7FF-3DB213D449DE@rutgers.edu>
 <20200625150621.3854a233@Tarkus>
Message-ID: <741A52A6-B95D-446E-874B-1498AC3CC776@rutgers.edu>

> On Jun 25, 2020, at 8:06 AM, Ivan Krylov <krylov.r00t at gmail.com> wrote:
> 
> On Wed, 24 Jun 2020 18:56:06 +0000
> Ryan Novosielski <novosirj at rutgers.edu> wrote:
> 
> On my machine, getOption('expressions') is 5000 and the example from
> the test correctly stops with length(traceback()) == 2500. (And the
> simpler example of f <- function() f(); f() stops with
> length(traceback()) == 5000).
> 
>> Traceback:
> 
> <...>
> 
>> 2718: foo()
> 
> This (traceback() being more than 2500 entries long) seems to imply
> that the stack size check is somehow skipped. (Perhaps optimized away?)
> The evaluation depth limit is checked in src/main/eval.c, line 705 [*],
> followed by stack size check. Can you attach the debugger and take a
> look at the values of R_EvalDepth and R_Expressions while executing the
> text? What about R_CStackStart and R_CStackLimit? What is the stack
> size limit (ulimit -s?) on the machine running this test?
> 
> -- 
> Best regards,
> Ivan
> 
> [*]
> https://github.com/wch/r-source/blob/8d7ac4699fba640d030703fa010b66bf26054cbd/src/main/eval.c#L705

Thanks again for your help, Ivan, and also Frederick for pointing out how I might run the debugger with R. 

I?m finally back at this. Here?s what I see, presuming I?ve done this the right way. Anything of use here as far as troubleshooting?

[novosirj at amarel-test2 bin]$ ./R -d gdb-ia

...

Reading symbols from /scratch/novosirj/install-files/R-4.0.5-intel-19.1-build/bin/exec/R...
(gdb) run
Starting program: /scratch/novosirj/install-files/R-4.0.5-intel-19.1-build/bin/exec/R 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

R version 4.0.5 (2021-03-31) -- "Shake and Throw"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

...

[Detaching after fork from child process 42089]
[Detaching after fork from child process 42091]
> bar <- function() 1+1
> foo <- function() { on.exit(bar()); foo() }
> tryCatch(foo(), error=function(x) TRUE) # now simple "infinite recursion"

Program received signal SIGSEGV, Segmentation fault.
bcEval.R (body=0x3eb7748, rho=0x3f72770, useCache=TRUE) at /scratch/novosirj/install-files/R-4.0.5/src/main/eval.c:6478
6478      codebase = pc = BCCODE(body);
(gdb) print R_EvalDepth
$1 = 2729
(gdb) print R_Expressions
$2 = 5000
(gdb) print R_CStackStart
$3 = 140737488207872
(gdb) print R_CStackLimit
$4 = 7969177
(gdb) quit
A debugging session is active.

        Inferior 1 [process 42083] will be killed.

Quit anyway? (y or n) y

[novosirj at amarel-test2 bin]$ ulimit -s
8192


--
#BlackLivesMatter
____
|| \\UTGERS,  	 |---------------------------*O*---------------------------
||_// the State	 |         Ryan Novosielski - novosirj at rutgers.edu
|| \\ University | Sr. Technologist - 973/972.0922 (2x0922) ~*~ RBHS Campus
||  \\    of NJ	 | Office of Advanced Research Computing - MSB C630, Newark
     `'



[Rd] R 4.0.1-4.0.5 built with Intel Composer 19.0-19.1.1, error in "make check" on CentOS 7.7-7.9
Ryan Novosielski