Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 655832

Summary: app-emulation/wine-vanilla: wineboot fails on mmap with "Cannot allocate memory"
Product: Gentoo Linux Reporter: Alex <maniac>
Component: Current packagesAssignee: Wine Maintainers <wine>
Status: RESOLVED OBSOLETE    
Severity: normal CC: maniac
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info wine
strace -f wineboot
kconfig-4.16.8-gentoo.txt

Description Alex 2018-05-15 20:38:05 UTC
Created attachment 531670 [details]
emerge --info wine

Hi. I had this problem for a while and not sure if it's my misconfiguration or something else.

Basically when trying to start any wine program running wine preloader (even wineboot on empty prefix) it fails with error:

~% wineboot             
/usr/lib64/wine-vanilla-3.8/bin/wine: error while loading shared libraries: cannot create cache for search path: Cannot allocate memory

strace shows that last call before this error was mmap2:
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 EPERM (Operation not permitted)

I found closed upstream bug with this problem reported by arch user: https://bugs.winehq.org/show_bug.cgi?id=43963
Arch bugtracker ( https://bugs.archlinux.org/task/55954#comment164591 ) had a solution that worked for me: setting sysctl vm.mmap_min_addr to zero.

This fix was suggested for running dos applications, but my wine is built without dos flag and fails the same. Some users on other had same error message because of missing multilib binaries, but it's not the case here.

I'm making this bug so anyone having same problem will have less time searching for quick solution.
The real quiestions are: why this happens? why this started happening? (and when?). I would put this solution in gentoo wiki if I was sure that it's not my misconfiguration, after all searching shows that only some users are affected.

Attaching emerge --info wine and my kernel config.
Thank you in advance.
Comment 1 Alex 2018-05-15 20:38:40 UTC
Created attachment 531672 [details]
strace -f wineboot
Comment 2 Alex 2018-05-15 20:39:54 UTC
Created attachment 531674 [details]
kconfig-4.16.8-gentoo.txt
Comment 3 Bob Wya 2018-05-16 09:51:01 UTC
Possibly an selinux issue...?? I'd check the selinux audit log.

Perhaps try the top answer from... https://unix.stackexchange.com/questions/61032/how-to-get-wine-to-work-with-selinux
Comment 4 Alex 2018-05-16 16:24:54 UTC
Thanks for reply.

Yes, I have selinux, but this happens in permissive mode too and toggling those booleans gives nothing. No complaints in audit log too.

I also read yesterday that it might be cause by CONFIG_STRICT_DEVMEM option, going to check that later.
Comment 5 Alex 2018-05-18 00:05:59 UTC
No, turning off STRICT_DEVMEM (and STRICT_IO_DEVMEM alone too) gives same result.
Comment 6 Nick Sarnie gentoo-dev 2019-06-22 21:48:38 UTC
Wine-vanilla 3.x is no longer supported. Please let me know if you can
reproduce this on 4.x