This is the mail archive of the
mailing list for the Cygwin project.
Re: [PATCH RFC] fork: reduce chances for "address space is already occupied" errors
- From: Achim Gratz <Stromeko at nexgo dot de>
- To: cygwin-patches at cygwin dot com
- Date: Wed, 03 Apr 2019 14:28:32 +0200
- Subject: Re: [PATCH RFC] fork: reduce chances for "address space is already occupied" errors
- References: <firstname.lastname@example.org> <20190326182538.GA4096@calimero.vinschen.de> <20190326182824.GB4096@calimero.vinschen.de> <email@example.com> <87y350ytpb.fsf@Rainer.invalid> <firstname.lastname@example.org> <0f0d7cd6-e770-fc32-f28f-817b700e4d87@SystematicSw.ab.ca> <email@example.com> <abf543bb-e8df-9eeb-5ae8-63e5d59cca9a@SystematicSw.ab.ca> <87sgv65eyc.fsf@Rainer.invalid> <5fa27e1c-a790-f03d-b4b3-1985f26df128@SystematicSw.ab.ca> <87pnq9jupk.fsf@Rainer.invalid> <a83dedc6-ea5b-5fc9-4bbc-f06a9cf19472@SystematicSw.ab.ca> <878sww93g9.fsf@Rainer.invalid> <97aec921-d9b1-3b0e-de7a-d492832ba481@SystematicSw.ab.ca> <firstname.lastname@example.org>
Michael Haubenwallner writes:
> Before I really can tell what I need regarding the rebase, I need to learn what
> exactly is recorded into the rebase database, and probably how the recorded data
> does influence the rebase procedure right now.
Just where the DLL resides in the filesystem, what address it has been
rebased to and what size it occupies. If you rebase a new DLL with the
database, it will give you the first gap in the address space that this
new DLL fits into for doing the rebase and record that into the
database. With the --oblivious option, it keeps the database file
untouched, so the information about the newly rebased DLL gets lost
whenh the program exits. That's why you need to do all oblivious
rebasing in a single invocation.
> My thoughts so far for what I probably need:
> * First, rebase new dlls before being installed into the target file system
> directory with respect to currently installed dlls (the --oblivious
You always rebase after the install so that the path information is
correct. Pre-rebasing is useless.
> * Second, register new dlls just installed into the target file system
> directory into the rebase database without performing a rebase, and
No, rebasing the installed DLL already does that.
> * Third, unregister dlls being removed from the rebase database.
Rebase already removes any entries that are no longer accessible from
> Also, it may make sense to allow for reusing the base address of an installed
> dll by it's update replacement - while the old version dll still is in use and
> the new version dll is in some temporary staging directory.
Rebase already re-uses the base-address if the path for the new DLL is
the same and it still fits into the gap. In general, however, that
won't work when the size of any DLL changes. You can ask for more
guardband around each entry, but that doesn't actually solve the problem
as it's only useful for the initial (full) rebase.
> As there may be multiple instances of Gentoo Prefix within one single operating
> system instance, it does not make sense to record the dll's base addresses into
> the rebase database of the underlying Cygwin instance in /etc, but still the
> base addresses already recorded there should be respected when rebasing dlls
> for within a particular Gentoo Prefix instance.
If you can limit the address space that's used by the Cygwin base
system, I'd just give your Gentoo prefix installation its own address
space and rebase it independently from the base system. That probably
requires some fooling around with the (currently hardcoded) rebase
database files, but should otherwise just work.
> Furthermore, with so called "Stacked Prefix", it is possible to have a second
> level of Gentoo Prefix, so what I'm after is some option to tell the rebase
> utility which database to record dll base addresses into, and which multiple(!)
> databases take into account while performing a rebase.
I don't think you'll want to do that.
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
Wavetables for the Waldorf Blofeld: