[PATCH RFC] fork: reduce chances for "address space is already occupied" errors

Brian Inglis Brian.Inglis@SystematicSw.ab.ca
Thu Mar 28 22:56:00 GMT 2019


On 2019-03-28 10:48, Michael Haubenwallner wrote:
> On 3/28/19 4:19 PM, Brian Inglis wrote:
>> On 2019-03-28 08:59, Michael Haubenwallner wrote:
>>> On 3/27/19 8:59 PM, Achim Gratz wrote:
>>>> Michael Haubenwallner writes:
>>>>> As far as I understand, rebasing is about touching already installed
>>>>> dlls as well, which would require to restart all Cygwin processes.
>>>>> As the problem is about some dll built during a larger build job,
>>>>> this is not something that feels useful to me.
>>>>
>>>> That's exactly why I introduced the "--oblivious" option several years
>>>> ago.  It'll let you rebase a set of DLL while benefitting from the
>>>> rebase database, but not recording them there, so if you later install
>>>> them properly there will be no collision.  I needed this for testing
>>>> newly compiled Perl XS modules, but you seem to have a similar use case.
>>>
>>> What I can see so far is that right now there is only one single rebase
>>> database, in /etc/rebase.db.<arch>.
>>>
>>> However, my 'installed' dlls are not put into /bin, but into the so called
>>> Gentoo "Prefix", e.g. /home/haubi/test-20190327/gentoo-prefix/usr/bin for
>>> example.  Remember that there can be multiple independent instances of Gentoo
>>> Prefix, so recording them all into the host /etc/rebase.db is not an option.
>>>
>>> Hence there should be a rebase database per Gentoo Prefix instance, like
>>> /home/haubi/test-20190327/gentoo-prefix/etc/rebase.db.<arch>, to record
>>> my 'installed' dlls, while still loading the /etc/rebase.db.<arch> to avoid
>>> conflicts with cygwin provided dlls.
>>>
>>> And how would one explicitly remove specific entries from the rebase database
>>> when dlls get uninstalled (by either package remove or package upgrade)?
>>
>> Using rebase -O, --oblivious with -T, --filelist local-test-rebase-db gives you
>> your own local test rebase db - just add all your test dlls into it (sort -u to
>> eliminate dups).
> Sounds interesting... but something I must be doing wrong here:
> $ rebase --oblivious --filelist=my-dlls.txt local-test-rebase-db
> local-test-rebase-db: skipped because nonexistent.
> $ touch local-test-rebase-db
> $ rebase --oblivious --filelist=my-dlls.txt local-test-rebase-db
> local-test-rebase-db: skipped because not rebaseable
> $ cp /etc/rebase.db.x86_64 local-test-rebase-db
> $ rebase --oblivious --filelist=my-dlls.txt local-test-rebase-db
> local-test-rebase-db: skipped because not rebaseable
> It doesn't want to create or update the local-test-rebase-db file...

File list my-dlls.txt is your local test rebase db listing all your test dlls.
If you are packaging your own exes and dlls with your own local Cygwin distro,
you should point to your local utility directory with a path in a file under
/var/lib/rebase/user.d/$USER for each Cygwin userid on each system, or perhaps
you might also need to add your own production exes and dlls into
/var/cache/rebase/rebase_user and /var/cache/rebase/rebase_user_exe: see
/usr/share/doc/Cygwin/_autorebase.README.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.q



More information about the Cygwin-patches mailing list