Cygwin中的rebaseall有什么作用? [英] What does rebaseall in Cygwin do?

查看:139
本文介绍了Cygwin中的rebaseall有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在cygwin中遇到dll / forking错误时,我正在调用 rebaseall 脚本,然后一切都会神奇地恢复正常。我知道它会以某种方式修改cygwin安装中的dll,因为我在有问题的和重新建立的dll之间进行了区分。

When bumping in dll/forking errors in cygwin, i'm calling the rebaseall script and everything magically works again. I know that it somehow modifies the dlls in the cygwin installation because i've run a diff between the problematic ones and the rebased ones.

在这些二进制文件中,它到底做了什么修改并使它们再次起作用?

What does it exactly modify in these binary files and makes them work again?

推荐答案

根据有关模块基地址的错误消息


Windows上的DLL必须以不冲突的基地址加载到内存中。 rebaseall是一个cygwin实用程序,可扫描当前安装的所有库,并将每个库设置为请求不同的基址,以使它们不冲突。

DLLs on Windows need to be loaded into memory at non-conflicting base addresses. rebaseall is a cygwin utility that scans all the libraries currently installed and sets each to request a different base address so that none will conflict.

技术性更高一点处理rebaseall反复失败以允许cygwin重映射的说明


由于unix fork语义(大概),cygwin库必须在fork的父级和子级的相同位置映射。所有cygwin库都在其中暗示了它们应在进程地址空间中映射的位置。如果遵循这些提示,则每个库都将映射到两个地址空间中的相同位置。但是,Windows非常乐意将DLL映射到地址空间中的任何位置。该提示不被视为控制。当cygwin进程启动并且其库之一无法映射到其提示所指定的位置时,将发生重新映射错误。

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更改所有DLL提示。 cygwin库,因此不存在库间冲突;它通过选择从基址开始并向下工作的连续但不重叠的库布局来实现此目的。此过程可确保没有cygwin内部冲突,但不能处理与cygwin进程地址空间中的外部DLL(例如,防病毒DLL)发生冲突的情况。

/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).

这篇关于Cygwin中的rebaseall有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆