bottlesdevs / Bottles

Run Windows software and games on Linux
https://usebottles.com
GNU General Public License v3.0
6.34k stars 266 forks source link

[Bug]: Error vmtouch mlock #1941

Open reticulis opened 2 years ago

reticulis commented 2 years ago

Describe the bug

Failed start wine apps after turn on vmtouch with "Cache work directory" in Preferences, vmtouch without "Cache work directory" works fine.

To Reproduce

  1. Go to Preferences
  2. Turn on vmtouch
  3. Go to vmtouch Settings
  4. Turn on "Cache work directory"
  5. Run app or any Legacy Tool

Package

Flatpak from Flathub

Distribution

Fedora Silverblue 36

Troubleshooting Logs

vmtouch: FATAL: mlock: /var/home/reticulis/.var/app/com.usebottles.bottles/data/bottles/bottles/battlefield-4/drive_c/windows/system32/spool/drivers/w32x86/3/wineps.drv (Cannot allocate memory)

Display Protocol

Wayland

Display Backend used by Bottles

Wayland

Additional context

No response

axtloss commented 2 years ago

Does the application fail to launch when this error occurs?

Also can you run a program so that this error appears and then run

flatpak run --command=bash com.usebottles.bottles
vmtouch /path/to/problematic/file

and show the output

reticulis commented 2 years ago

Does the application fail to launch when this error occurs?

Yes, any app won't start.

Also can you run a program so that this error appears and then run

flatpak run --command=bash com.usebottles.bottles
vmtouch /path/to/problematic/file

and show the output

>> vmtouch /var/home/reticulis/.var/app/com.usebottles.bottles/data/bottles/bottles/battlefield-4/drive_c/windows/system32/spool/drivers/w32x86/3/wineps.drv

           Files: 1
     Directories: 0
  Resident Pages: 520/520  2M/2M  100%
         Elapsed: 8.8e-05 seconds
axtloss commented 2 years ago

According to https://github.com/hoytech/vmtouch/issues/18 this isn't a bottles issue, but an issue in vmtouch, since Linux automatically limits the amount of memory an application can lock. For now it's probably better to not enable the work directory caching until I find a way to increase this limit.

axtloss commented 2 years ago

After doing some research, I found out that vmtouch would automatically increase the limit when ran as root. The user can also manually increase the limit by modifying the /etc/security/limits.conf file and adding this: <username> - memlock 10000000 this would increase the limit to 10gb.

So bottles would either have to execute vmtouch as root or somehow modify /etc/security/limits.conf to increase the limit or just completely remove the option to cache the working directory.

mirkobrombin commented 2 years ago

sounds like something we should not

axtloss commented 2 years ago

Yeah, we could either completely remove that or make the user do that themselves