[GH-ISSUE #3628] "Cannot alocate memory" error when trying to copy/paste in MPV #2280

Closed
opened 2026-05-05 08:58:11 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @Unser395 on GitHub (Sep 9, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3628

Bug and expected behavior

  • Describe the bug. Pasting a youtube link through a keyboard shorcut in MPV doesn't open the video. The keyboard shortcut was configured by a Lua user script.
  • What did you expect to happen? To have the shortcut work and be able to watch the video

No profile or disabling firejail

  • What changed calling firejail --noprofile PROGRAM in a shell? It works

Reproduce
Steps to reproduce the behavior:
1- sudo firecfg
2- Install user script "SmartCopyPaste_2_2 "https://github.com/Eisa01/mpv-scripts#smartcopypaste-ii-script"
3- Open MPV
4- Copy paste a youtube link into MPV with a keyboard shortcut
5. See error [SmartCopyPaste_2_2] Lua error: /home/user/.config/mpv/scripts/SmartCopyPaste-2.2.lua:73: xclip -selection clipboard -o: Cannot allocate memory

Environment

  • Linux distribution and version : Manjaro Linux 20.1
  • Firejail version (output of firejail --version) exclusive or used git commit (git rev-parse HEAD) : firejail version 0.9.62.4
  • What other programs interact with the affected program for the functionality? SmartCopyPaste_2_2 user script
  • Are these listed in the profile? I've tried to whitelist the script folder but mpv couldn't be launched anymore

Additional context
Other context about the problem like related errors to understand the problem.

Checklist

  • The upstream profile (and redirect profile if exists) have no changes fixing it.
  • The upstream profile exists (find / -name 'firejail' 2>/dev/null/fd firejail to locate profiles ie in /usr/local/etc/firejail/PROGRAM.profile)
  • Programs needed for interaction are listed.
  • Error was checked in search engine and on issue list without success.

Thank you very much for all your work !

Originally created by @Unser395 on GitHub (Sep 9, 2020). Original GitHub issue: https://github.com/netblue30/firejail/issues/3628 **Bug and expected behavior** - Describe the bug. Pasting a youtube link through a keyboard shorcut in MPV doesn't open the video. The keyboard shortcut was configured by a Lua user script. - What did you expect to happen? To have the shortcut work and be able to watch the video **No profile or disabling firejail** - What changed calling `firejail --noprofile PROGRAM` in a shell? It works **Reproduce** Steps to reproduce the behavior: 1- `sudo firecfg` 2- Install user script "SmartCopyPaste_2_2 "https://github.com/Eisa01/mpv-scripts#smartcopypaste-ii-script" 3- Open MPV 4- Copy paste a youtube link into MPV with a keyboard shortcut 5. See error `[SmartCopyPaste_2_2] Lua error: /home/user/.config/mpv/scripts/SmartCopyPaste-2.2.lua:73: xclip -selection clipboard -o: Cannot allocate memory` **Environment** - Linux distribution and version : Manjaro Linux 20.1 - Firejail version (output of `firejail --version`) exclusive or used git commit (`git rev-parse HEAD`) : firejail version 0.9.62.4 - What other programs interact with the affected program for the functionality? SmartCopyPaste_2_2 user script - Are these listed in the profile? I've tried to whitelist the script folder but mpv couldn't be launched anymore **Additional context** Other context about the problem like related errors to understand the problem. **Checklist** - [x] The upstream profile (and redirect profile if exists) have no changes fixing it. - [x] The upstream profile exists (`find / -name 'firejail' 2>/dev/null`/`fd firejail` to locate profiles ie in `/usr/local/etc/firejail/PROGRAM.profile`) - [x] Programs needed for interaction are listed. - [x] Error was checked in search engine and on issue list without success. Thank you very much for all your work !
Author
Owner

@rusty-snake commented on GitHub (Sep 9, 2020):

Programs needed for interaction are listed.

Likely not, the error message says something about xclip, which is not in mpv's private-bin.

Can you try firejail --private-bin=xclip mpv ....

<!-- gh-comment-id:689471448 --> @rusty-snake commented on GitHub (Sep 9, 2020): > Programs needed for interaction are listed. Likely not, the error message says something about xclip, which is not in mpv's private-bin. Can you try `firejail --private-bin=xclip mpv ...`.
Author
Owner

@Unser395 commented on GitHub (Sep 9, 2020):

Thank you for the quick answer !

I've tried to launch mpv through the command you gave me and still gives the same error.
Adding xclip in the config file didn't help either.

<!-- gh-comment-id:689499842 --> @Unser395 commented on GitHub (Sep 9, 2020): Thank you for the quick answer ! I've tried to launch mpv through the command you gave me and still gives the same error. Adding xclip in the config file didn't help either.
Author
Owner

@rusty-snake commented on GitHub (Sep 12, 2020):

Ok, played a bit with it. Seems like lua always uses a shell.
firejail '--noblacklist=${PATH}/sh' --private-bin=xclip,sh mpv …

<!-- gh-comment-id:691492172 --> @rusty-snake commented on GitHub (Sep 12, 2020): Ok, played a bit with it. Seems like lua always uses a shell. `firejail '--noblacklist=${PATH}/sh' --private-bin=xclip,sh mpv …`
Author
Owner

@Unser395 commented on GitHub (Sep 13, 2020):

Thank you very much, it fixed the issue !
Have a nice day, rusty-snake

<!-- gh-comment-id:691733862 --> @Unser395 commented on GitHub (Sep 13, 2020): Thank you very much, it fixed the issue ! Have a nice day, rusty-snake
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#2280
No description provided.