summaryrefslogtreecommitdiffstats
path: root/docs/cygwin_dll_remapping_failure.md
diff options
context:
space:
mode:
authorandybons <andybons@chromium.org>2015-08-24 14:37:09 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-24 21:39:36 +0000
commit3322f7611ba1444e553b2cce4de3a1a32ad46e72 (patch)
treedfb6bbea413da0581b8d085b184a5e6ceea5af3e /docs/cygwin_dll_remapping_failure.md
parent5d58c9eb2baa203be1b84ac88cde82c59d72f143 (diff)
downloadchromium_src-3322f7611ba1444e553b2cce4de3a1a32ad46e72.zip
chromium_src-3322f7611ba1444e553b2cce4de3a1a32ad46e72.tar.gz
chromium_src-3322f7611ba1444e553b2cce4de3a1a32ad46e72.tar.bz2
Per https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/irLAQ8f8uGk
Initial migration of wiki content over to src/docs There will be a follow-up CL to ensure docs are following chromium’s style guide, links are fixed, etc. The file auditing was becoming too much for a single change and per Nico’s suggestion, it seems to be better to do + Bulk import with initial prune. + Follow-up CLs to clean up the documentation. So that each CL has its own purpose. BUG=none Review URL: https://codereview.chromium.org/1309473002 Cr-Commit-Position: refs/heads/master@{#345186}
Diffstat (limited to 'docs/cygwin_dll_remapping_failure.md')
-rw-r--r--docs/cygwin_dll_remapping_failure.md55
1 files changed, 55 insertions, 0 deletions
diff --git a/docs/cygwin_dll_remapping_failure.md b/docs/cygwin_dll_remapping_failure.md
new file mode 100644
index 0000000..3b56273
--- /dev/null
+++ b/docs/cygwin_dll_remapping_failure.md
@@ -0,0 +1,55 @@
+Handling repeated failures of rebaseall to allow cygwin remaps
+
+# Introduction
+
+Sometimes DLLs over which cygwin has no control get mapped into cygwin
+processes at locations that cygwin has chosen for its libraries.
+This has been seen primarily with anti-virus DLLs. When this occurs,
+cygwin must be instructed during the rebase to avoid the area of
+memory where that DLL is mapped.
+
+# Background
+
+Some background for this is available on http://www.dont-panic.cc/capi/2007/10/29/git-svn-fails-with-fatal-error-unable-to-remap/
+
+Because of unix fork semantics (presumably), cygwin libraries must be
+mapped in the same location in both parent and child of a fork. All
+cygwin libraries have hints in them as to where they should be mapped
+in a processes address space; if those hints are followed, each
+library will be mapped in the same location in both address spaces.
+However, Windows is perfectly happy mapping a DLL anywhere in the
+address space; the hint is not considered controlling. The remapping
+error occurs when a cygwin process starts and one of its libraries
+cannot be mapped to the location specified by its hint.
+
+/usr/bin/rebaseall changes the DLL hints for all of the cygwin
+libraries so that there are no inter-library conflicts; it does this
+by choosing a contiguous but not overlapping library layout starting
+at a base address and working down. This process makes sure there are
+no intra-cygwin conflicts, but cannot deal with conflicts with
+external DLLs that are in cygwin process address spaces
+(e.g. anti-virus DLLs).
+
+To handle this case, you need to figure out what the problematic
+non-cygwin library is, where it is in the address space, and do the
+rebase all so that no cygwin hints map libraries to that location.
+
+# Details
+
+<ul>
+<li>Download the ListDLLs executable from sysinternals<br>
+(<a href='http://technet.microsoft.com/en-us/sysinternals/bb896656.aspx'>http://technet.microsoft.com/en-us/sysinternals/bb896656.aspx</a>)</li>
+<li>Run it as administrator while some cygwin commands are running.</li>
+<li>Scan the output for the cygwin process (identifiable by the command) and for DLLs in that process that do not look like cygwin DLLs (like an AV). Note the location of those libraries (there will usually only be the one). Pick an address space location lower than its starting address.</li>
+<li>Quit all cygwin processes.</li>
+<li>Run a windows command shell as administrator</li>
+<li>cd in \cygwin\bin</li>
+<li>Run "ash /usr/bin/rebaseall -b <base address>" (This command can also take a "-v" flag if you want to see the DLL layout.)</li>
+</ul>
+
+
+That should fix the problem.
+
+# Failed rebaseall
+
+If you pick a base address that is too low, you may end up with a broken cygwin install. You can reinstall it by running cygwin's setup.exe again, and on the package selection page, clicking the "All" entry to Reinstall. You may have to do this twice, as you may get errors on the first reinstall pass. \ No newline at end of file