[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] linux-user/mmap: Should not return NULL on guest call m
From: |
Maximilian Riemensberger |
Subject: |
Re: [Qemu-devel] linux-user/mmap: Should not return NULL on guest call mmap(NULL, ...), causes crash inside glibc |
Date: |
Sat, 6 Jan 2018 18:02:26 +0100 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
On 05.01.18 22:13, Maximilian Riemensberger wrote:
> On 05.01.18 19:38, Peter Maydell wrote:
>> On 5 January 2018 at 18:13, Maximilian Riemensberger
>> <address@hidden> wrote:
>>> Hi,
>>>
>>> yesterday I hit the following problem when running an arm linux executable
>>> on
>>> qemu-2.10 (qemu-arm-static through binfmt_misc)
>>>
>>> 1879
>>> mmap2(NULL,8388608,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANONYMOUS|0x20000,-1,0)
>>> = 0x00000000
>>> 1879 write(2,0xf6fd39d0,79) stx_test: allocatestack.c:514: allocate_stack:
>>> Assertion `mem != NULL' failed.
>>>
>>> The issue comes up when the executable creates and joins lots of
>>> threads in a loop (it's a unit test). Eventually, glibc allocatestack
>>> hits the mmap(NULL, ...) == NULL. Judging from the posix and linux
>>> manuals mmap(NULL, ...) never returns NULL. Either it fails with MAP_FAILED
>>> or it succeeds and returns non-NULL address.
>>
>> Given the heavy use of threading, can you retest with QEMU 2.11,
>> please? We fixed a couple of threading issues in linux-user there.
>
> Same error with fresh qemu-2.11 build.
I just sent out a online patch that fixes the issue for me.
Cheers
Max