question about Region_map::Region_conflict in attach_at()

Alexander Tormasov a.tormasov at innopolis.ru
Tue Nov 17 09:16:18 CET 2020


seems that I found one reason for the problem.
I try to use some mmap test found in internet (and this is not my code, this is standard Unix mmap behaviour, so I do not have any control over it).

As I understand, it try to remap already statically allocated memory (!).
Are there any chance to make it correctly?
is this allocated in Genode/NOVA as single chunk dataspace?
can I try just unmapped part of virtual address space from this ds and map it separately to new ds? Like (where V and v - virtual addresses, D and d - dataspaces attached):

VVVVVV       VVVddV
DDDDDD => DDDDDD dd

if yes - I probably need to detach() V whole range first and then split it to 3 chunks - two for old ranges to old dataspace «D» and one in the middle to new dataspace «d» to be allocated?
seems to be relatively complex process, and I need to find old DS, old range and store all chunks and mappings somewhere… Start thinking of getting rid of remapping for MAP_FIXED support...

just for reference, test contain the following code:

…
static char landing_pad[PAGESIZE*2];
...
        if (tests[i].flags & MAP_FIXED)
            mmap_addr = (void *)round_up_page(landing_pad); 
        else
            mmap_addr = NULL;
...
         mmap_flags_test(tests[i].filename, mmap_addr, size, tests[i].flags);
…
static void mmap_flags_test(const char  * filename, void * target_addr,
        unsigned long size, unsigned long flags)
{
...
   addr = mmap(target_addr, bytes, PROT_READ, flags, fd, 0);
…

> 16 нояб. 2020 г., в 11:08, Christian Helmuth <christian.helmuth at genode-labs.com> написал(а):
> 
> Sorry,
> 
> my last tip will not help you further. Now I remember that the region
> that conflicts with your attachment attempt at 0x102e000 is the linker
> area, which comprises 256 MiB beginning at the binary link address.
> 
> Christian
> 
> On Mon, Nov 16, 2020 at 08:49:03 CET, Christian Helmuth wrote:
>> Hello Alexander,
>> 
>> you enabled 'ld_verbose' in your configuration. Please check if
>> 0x102e000 is already used by any shared library. You may also check
>> the binary with 'genode-x86-readelf -l build/x86_64/debug/test-log'.
>> 
>> Greets
>> -- 
>> 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
>> 
>> _______________________________________________
>> Genode users mailing list
>> users at lists.genode.org
>> https://lists.genode.org/listinfo/users
> 
> -- 
> 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
> 
> _______________________________________________
> Genode users mailing list
> users at lists.genode.org
> https://lists.genode.org/listinfo/users



More information about the users mailing list