Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

package from source installation fails with cygheap base mismatch error #31

Open
drag05 opened this issue Oct 31, 2021 · 7 comments
Open

Comments

@drag05
Copy link

drag05 commented Oct 31, 2021

Updating packages from source suddenly started failing yesterday.
Example, updating package 'cli' from source gives the following error:

"C:/rtools40/mingw64/bin/"gcc  -I"C:/R/R-4.1.1/include" -DNDEBUG          -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c ansi.c -o ansi.o
      0 [main] make (8644) C:\rtools40\usr\bin\make.exe: *** fatal error - cygheap base mismatch detected - 0xD66408/0xF96408

Following the advice listed under error does not help:

  1. Using installr::install.Cygwin(bit=64), I have installed Cygwin64 on my machine for the first time and still does not work.
  2. Downloaded the cygwin1.dll (64bit version) and replaced the existing one in C:/cygwin/bin
    folder as specified and still does not work.

Please advise!

sessionInfo()

R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

loaded via a namespace (and not attached):
[1] compiler_4.1.1 tools_4.1.1   

This is the first time when this happens.

OS:
Windows 10 version 21H1
build 19043.1320

Error happens in both R Studio and R Console.

R Studio:
2021.09.0 Build 351

Thank you!

@jeroen
Copy link
Member

jeroen commented Oct 31, 2021 via email

@drag05
Copy link
Author

drag05 commented Nov 1, 2021

@jeroen Thank you for your time! The rtools\...\bin directory was the first on the PATH, I had forgotten to mention this in my post. Also:
do I really need to have Cygwin installed? I do not use it at all and installing from source worked before its installation.
Could it be that a sneaky Windows 10 update caused this?
Thank you!
P.S. Just in case: I have run DISM and sfc utilities and came up with no violations found.

@jeroen
Copy link
Member

jeroen commented Nov 1, 2021 via email

@drag05
Copy link
Author

drag05 commented Nov 1, 2021

@jeroen
I have uninstalled Cygwin - quite a pain! Returning to the main issue: is there any foreseeable solution to the cygheap base mismatch?
Thank you!
UPDATE: I have searched for cygwin1.dll on my computer and been unable to find it anywhere. The cygheap error however, mentions it. I wonder why.

@drag05
Copy link
Author

drag05 commented Nov 9, 2021

@jeroen
Solved: switching "Force Randomization of Images (Mandatory ASLR)" to OFF in "Windows10\Security\App&Browser Control\Exploit protection" solved the issue for me. It does not address the root cause though.

@drag05 drag05 closed this as completed Nov 9, 2021
@Moodjbow
Copy link

Moodjbow commented Feb 8, 2022

@drag05 turning OFF ASLR works also for me but I cannot leave my computer vulnerable this way. This technology is 15 years old now, and still some binaries are not ready for that.
@jeroen I have tried both Rtools40 and Rtools42: it starts already with the MSYS2 bash erroring "Could not fork child process [...] DLL rebasing may be required" (and no, rebaseall ends up also with "forked process died unexpectedly" error)
Could building rtools with the dynamicbase and high entropy (64-bit ALSR) flags help?

@drag05
Copy link
Author

drag05 commented Feb 8, 2022

@Moodjbow I am well aware of that! I think I will just ignore or just stop installing from source. I am on ignore mode currently.

Maybe this will help me switch.

The above article states that the ASLR can be turned off program-by-program. I will try for mingw64 only until Rtools becomes ASLR-aware.

@jeroen Turning off ASLR for mingw64 only did not work. The initial error popped up. What other exe(s) in Rtools should I add to turn off ASLR by-program? Please advise, thank you!

@drag05 drag05 reopened this Feb 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants