Bug 550736 - random mmap() failure in wine pulseaudio (lack of address space?)
Summary: random mmap() failure in wine pulseaudio (lack of address space?)
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: wine
Version: 12
Hardware: i686
OS: Linux
low
medium
Target Milestone: ---
Assignee: Andreas Bierfert
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-12-27 06:02 UTC by r6144
Modified: 2023-06-04 11:16 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-12-04 01:11:19 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description r6144 2009-12-27 06:02:02 UTC
Description of problem:

I'm running 32-bit wine in a quad-core x86_64 Fedora 12 system.

Occasionally, running wine applications (including winecfg and native win32 applications) would fail with

$ winecfg
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
xe: pulse.c:716: PULSE_WaveInit: Assertion `PULSE_context' failed.
err:module:attach_process_dlls "winmm.dll" failed to initialize, aborting
err:module:LdrInitializeThunk Main exe initialization for L"C:\\windows\\system32\\winecfg.exe" failed, status 80000101

and the application either terminates or runs with no sound.

From the strace, it seems that the bug is due to there being too little contiguous 32-bit address space to map the 64MB shared memory used by pulseaudio; somehow wine-preloader reserves the address range between 0x110000 to 0x68000000 for Windows DLLs, in particular native ole32 (see wine's preloader.c:preload_info[] and the commit http://source.winehq.org/git/wine.git/?a=commitdiff;h=4d35f3f2704fe2cda261af0e2d112bfde32fc60b), and makes only the 384MB address space between 0x68000000 and 0x80000000 available to wine itself and its linux-side libraries.

I thought turning off address space randomization (setarch i686 -R wine) might alleviate the problem somewhat, at least making it more deterministic, but somehow the problem persists and is still random.

Version-Release number of selected component (if applicable):
wine-1.1.32-1.fc12.i686
wine-pulseaudio-1.1.32-1.fc12.i686
pulseaudio-0.9.21-1.fc12.x86_64
kernel-2.6.31.6-166.fc12.x86_64

How reproducible:
Random, the bug occurs between 20% and 60% of the time IMHO.

Steps to Reproduce:
Run winecfg a few times.

Actual results:
Occasionally it fails with the error messages above.

Expected results:
Should always start properly.

Additional info:

Comment 1 tgb 2010-01-17 15:24:02 UTC
Same for up-to-date F11.

Comment 2 Osipov Oleg 2010-04-18 20:06:11 UTC
Same for f12:

[legolegs@localhost ~]$ winecfg
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
xe: pulse.c:733: PULSE_WaveInit: Assertion `PULSE_context' failed.
err:module:attach_process_dlls "winmm.dll" failed to initialize, aborting
err:module:LdrInitializeThunk Main exe initialization for L"C:\\windows\\system32\\winecfg.exe" failed, status 80000101

Versions:

pulseaudio-0.9.21-5.fc12.x86_64
pulseaudio-libs-0.9.21-5.fc12.i686
pulseaudio-libs-0.9.21-5.fc12.x86_64
wine-1.1.38-1.fc12.i686
wine-pulseaudio-1.1.38-1.fc12.i686

Comment 3 r6144 2010-04-19 01:37:19 UTC
Currently I work around the bug by changing the line modified by the aforementioned commit into

    { (void *)0x00110000, 0x3fef0000 },  /* low memory area */

This doesn't seem to break any application I use, though other things could be broken.

Comment 4 Michael S. 2010-06-30 18:56:29 UTC
valid on f13 too, with wine-1.1.38-1

Comment 5 Andreas Bierfert 2010-06-30 19:34:10 UTC
Can you reproduce this with the release candidate in updates-testing?

Comment 6 Bug Zapper 2010-11-04 02:26:28 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Bug Zapper 2010-12-04 01:11:19 UTC
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 8 bztdlinux 2011-06-26 01:41:44 UTC
I am currently having the same issue with Wine + pulseaudio audio plugin, F14, wine 1.3.19:


mmap() failed: Cannot allocate memory
mmap() failed: Cannot allocate memory
Assertion 'b' failed at pulsecore/memblock.c:451, function pa_memblock_acquire(). Aborting.


Why pulseaudio needs to mmap 64MB of memory is unknown to me.

Comment 9 hiroki04030 2023-06-04 11:16:34 UTC
What worked for me is to set `shm-size-bytes = 1048576` in /etc/pulse/client.conf and /etc/pulse/daemon.conf.


Note You need to log in before you can comment on or make changes to this bug.