Bottles icon indicating copy to clipboard operation
Bottles copied to clipboard

[Bug]: Error vmtouch mlock

Open reticulis opened this issue 2 years ago • 6 comments

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

reticulis avatar Aug 14 '22 15:08 reticulis

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

axtloss avatar Aug 14 '22 16:08 axtloss

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

reticulis avatar Aug 14 '22 16:08 reticulis

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 avatar Aug 14 '22 16:08 axtloss

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.

axtloss avatar Aug 14 '22 18:08 axtloss

sounds like something we should not

mirkobrombin avatar Aug 14 '22 19:08 mirkobrombin

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

axtloss avatar Aug 14 '22 19:08 axtloss