Solved Wine sometimes cannot allocate memory.

I have a spare hard drive with 32bit FreeBSD installation dedicated only for playing some games.

Interesting thing is that when i try to set game at high resolution and other graphics stuff i get this very early:
wineserver: file_set_error() can't map error: Cannot allocate memory
And the game crashes. That will be the only output after/before crashing. I was monitoring RAM usage while in game, it does not exceed above 1G of RAM, my GPU has 2G of VRAM i think its enough for these games(STALKER series). Is there any "kernel tuning" for this maybe? Anyone experienced similar problem?

Also, i can easily play in 1024x768 its not a problem, but i am just curious.
2021-09-09-021205_1280x1024_scrot.png


EDIT:
After i have set kern.ipc.shmall=1310720 with sysctl and this problem did not occur again. Nvidia driver port recommends this and warns the user after installation but i did not set that variable. Case is solved and closed.
 
Last edited:
Code:
wineserver: file_set_error() can't map error: Cannot allocate memory

Seems to be FreeBSD specific problem as i have not seen it on any other operating systems. This message appears for me mostly only with web applications such as Origin that then also does not work. I have also seen that an update from 5.8 to 6.x have hit Anno 1404 with that too.
 
Code:
wineserver: file_set_error() can't map error: Cannot allocate memory

Seems to be FreeBSD specific problem as i have not seen it on any other operating systems. This message appears for me mostly only with web applications such as Origin that then also does not work. I have also seen that an update from 5.8 to 6.x have hit Anno 1404 with that too.
So according to wine source code wine cannot get error code, maybe there is some permission file issue?
Screenshot_2021-09-19 wine file c at e909986e6ea5ecd49b2b847f321ad89b2ae4f6f1 · wine-mirror wine.png

So basically wine is unable to create a file from a file descriptor. And then drops an error.
Screenshot_2021-09-19 wine file c at e909986e6ea5ecd49b2b847f321ad89b2ae4f6f1 · wine-mirror wi...png


Shall we open a bug on this?
 
So according to wine source code wine cannot get error code, maybe there is some permission file issue? View attachment 11385
So basically wine is unable to create a file from a file descriptor. And then drops an error.
View attachment 11386

Shall we open a bug on this?

I had already created a bug with this error message, this has not been answered yet. Maybe it helps if you create a new one with your description.
 
After doing some tests, I was able to run some stuff increasing memorylocked to a higher amount in /etc/login.conf. Try 64M, 128M or 256M and don't forget to cap_mkdb /etc/login.conf.
 
Hi all,
I just want to say that increasing kern.ipc.shmall to 1310720 via sysctl and increasing memorylocked in /etc/login.conf did not solve anything in my case. I still have a crash on big games like Call of Duty or Assassin's Creed (funny to call them big nowadays). Those crashes never occur on Arch Linux with the same hardware.
I am still facing the issue. It is an issue that was never solved for ten years (I was already having this when I started FreeBSD in 2013) and I do have changed my hardware over the years (always with an NVIDIA GPU) and I always had this.

I can run older games or 2D games, even recent indie games which are in 2D, it always work very well. Only games that seems to demand a lot of "memory" crash.
 

Attachments

  • 2023-05-06-171102_1920x1080_scrot.png
    2023-05-06-171102_1920x1080_scrot.png
    118.7 KB · Views: 134
  • 2023-05-06-170949_1920x1080_scrot.png
    2023-05-06-170949_1920x1080_scrot.png
    37.1 KB · Views: 149
wine-devel maintainer here.

You installed Wine how, through Ports? Which version? Also what does "uname -a" say?

Try set all these sysctls to 0:

kern.elf32.aslr.stack: 0
kern.elf32.nxstack: 0
kern.elf64.aslr.stack: 0
kern.elf64.nxstack: 0

And where is this bug report?
 
Ohh, yes it is. But 32bit version of wine on my main 64bit OS installation cannot initialize opengl. So i installed 32bit FreeBSD on another drive and thus i avoided problem solving.

For 32 bit Wine apps on a 64 bit FreeBSD (kernel and base system), you have to set the LIBGL_DRIVERS_PATH environment variable to the directory with your 32 bit OpenGL drivers.
 
Back
Top