question about Region_map::Region_conflict in attach_at()
Christian Helmuth
christian.helmuth at genode-labs.com
Tue Nov 17 09:01:54 CET 2020
Hello Alexander,
On Mon, Nov 16, 2020 at 22:03:49 CET, Alexander Tormasov via users wrote:
> current map show
> [init -> gdb_monitor -> mmaptest] 0x40000000 .. 0x4fffffff: stack area
> [init -> gdb_monitor -> mmaptest] 0x30000 .. 0x1befff: ld.lib.so
> [init -> gdb_monitor -> mmaptest] 0x10d55000 .. 0x10ffffff: libc.lib.so
> [init -> gdb_monitor -> mmaptest] 0x10c3a000 .. 0x10d54fff: vfs.lib.so
> [init -> gdb_monitor -> mmaptest] 0x10bee000 .. 0x10c39fff: libm.lib.so
> [init -> gdb_monitor -> mmaptest] 0x1030000 .. 0x124bfff: stdcxx.lib.so
> so, requested range 0x102e000 till 0x102f000 which is BEFORE allocated address related to stdcxx?
>
> I assume that range could be free… while may be it is in use by heap/etc.
I added information about the linker area to the ldso ld_verbose log
with
https://github.com/genodelabs/genode/commit/ec763e25e052a2d61295984942fc41ac4804bc13
to reduce the confusion in this regard.
> anyway, are there ANY way to check what particular addresses are in
> use, or at least, setup break in GDB to the place where this address
> generate Regionmap conflict? where are the related places in the
> genode code?
The region map does not provide this kind of reflective information.
On Genode, we follow the same approach as with Linux mmap(): Just do
not expect any fixed address-space layout resp. free address regions.
So, there are two options you may choose from.
1) Let env.rm().attach(dataspace) choose a region from your address space that
fits your dataspaces one-by-one.
2) If a address region of known size for custom layout requirements is
required, create a region map from the RM service with the
appropriate size and attach the region-map dataspace with
env.rm().attach(). This gives you an appropriate address region
and your code must only be parameterized by the base address of
this region.
Any other approach of "guessing maybe unused address regions" is
designed to fail sooner or later. Imagine libraries that also map
dataspaces dynamically for pointer-based data access for example.
> If I will try to use Libc::valid(addr_t addr) - to verify that it is
> used, is it always give me correct results?
I do not know anything about such a function, sorry.
Regards
--
Christian Helmuth
Genode Labs
https://www.genode-labs.com/ · https://genode.org/
https://twitter.com/GenodeLabs · /ˈdʒiː.nəʊd/
Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
More information about the users
mailing list