Skip to content

Commit

Permalink
Change the default base address for x86_64
Browse files Browse the repository at this point in the history
This might break things, but it turns out several Windows libraries like
to be loaded at 0x180000000.

This causes a problem, because `msys-2.0.dll` loads at `0x180040000` and
expects `0x180000000-0x180040000` to be available. A problem arises when
Antiviruses (or other DLL hooking mechanisms) load a DLL whose preferred
load address is `0x180000000` and fits in size before `0x180010000`:

1. `msys-2.0.dll` loads and fills `0x180010000-0x180040000` assuming no
   shared console structure is going to be needed.

2. Another DLL loads and fills `0x180000000-0x18000xxxx`

3. `msys-2.0.dll` tries to load `0x180000000-0x180010000` but it's not
   available. It falls back to another address, but down the line
   something else fails.

This bug triggers when using subshells (e.g.: `git clone --recursive`).

The MSYS2 runtime should be able to work around the address conflict,
but the code is failing in some way or other...

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Mikael Larsson <95430516+chirpnot@users.noreply.github.com>
  • Loading branch information
chirpnot authored and dscho committed Sep 6, 2023
1 parent e6add2f commit d8f626b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion winsup/cygwin/cygwin.din
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LIBRARY "msys-2.0.dll" BASE=0x180040000
LIBRARY "msys-2.0.dll" BASE=0x210040000

EXPORTS
# Exported variables
Expand Down

0 comments on commit d8f626b

Please sign in to comment.