garrysmod-issues icon indicating copy to clipboard operation
garrysmod-issues copied to clipboard

[Linux] Text from gmod causes other programs to freeze/crash

Open Riddle1001 opened this issue 1 year ago • 11 comments

Details

I use Linux, Ubuntu, No proton, no betas, just main gmod branch. When I copy any text from gmod and paste it into my browser, vscode, discord, or almost anything else, it causes either a massive freeze for the program or a crash for the program I pasted the text into. I tried using some python code to figure it out and provide more details. I found that copy and pasting Redownloading all lightmaps from console turns into Redownloading all lightmaps\r\n, however, when I manually set my clipboard content to Redownloading all lightmaps\r\n to emulate the crashing behavior it doesn't work. So i'm sort of stumped on what is going on.

If you are going to post crash dumps (.mdmp or .dmp files), please either send them to [email protected] or create a permanent link.

Steps to reproduce

  1. Be on Linux (Perhaps Ubuntu specifically)
  2. No proton/beta
  3. Copy text from the console/in game chat
  4. Paste it into another program e.g Chrome
  5. Watch Chrome freeze and crash

Riddle1001 avatar Jan 25 '24 17:01 Riddle1001

That doesn't sound like an issue with GMod if other programs are having issues? Have you tried the bare minimum of trying to copy test from other programs? From other Source Engine games as a test?

robotboy655 avatar Jan 25 '24 17:01 robotboy655

That doesn't sound like an issue with GMod if other programs are having issues? Have you tried the bare minimum of trying to copy test from other programs? From other Source Engine games as a test?

Yeah, I've used linux daily for a few years now, copy and pasting in all types of programs (especially vscode :+1: ). This is the first time i've seen it happen. It is possible it has to do with the other program's text processing or even linuxs', however copying text from everywhere else i've never encountered this problem, and even when trying to reproduce it programmatically I couldn't reproduce it.

It's probably due to how other programs handle it but something is clearly being done wrong on gmod's side if this only happens through gmod

Edit I didn't try on other source games

Riddle1001 avatar Jan 25 '24 18:01 Riddle1001

It's all source games, not gmod's problem! Tried on TF2

Riddle1001 avatar Jan 25 '24 18:01 Riddle1001

I still don't see how that's possible. As far as I can tell, on Linux SDL is used to set the clipboard text. (GMod uses SDL2 I think)

Unless there's some fuckery with invisible symbols somehow, or clipboard types maybe?

robotboy655 avatar Jan 25 '24 18:01 robotboy655

I still don't see how that's possible. As far as I can tell, on Linux SDL is used to set the clipboard text. (GMod uses SDL2 I think)

Unless there's some fuckery with invisible symbols somehow, or clipboard types maybe?

I have no idea, I tried copying TextureBits from ##### CTexture::LoadTextureBitsFromFile couldn't find materials/maps/surf_utopia_v3_njv/c-14096_0_12872.vtf and it still crashes other programs after pasting into them. After copying this from the source console, I looked at my clipboard text via the python program I mentioned earlier and nothing odd appeared, not even the \r\n (which is right because i'm copying text from the middle of a line). There doesn't appear to be any invisible chars because I would've found them, via python's len() and ord() functions. I don't know much about clipboard types

Riddle1001 avatar Jan 25 '24 19:01 Riddle1001

Well, it appears to be specifically chromium stuff? E.g Discord, Chrome, VScode, so I can paste it into firefox, terminal, and another text editor and it works fine.

Riddle1001 avatar Jan 25 '24 19:01 Riddle1001

Does the chromium issue also happen from other copy sources than the source engine?

Grocel avatar Jan 26 '24 14:01 Grocel

**Grocel ** commented Jan 26, 2024

No

Riddle1001 avatar Jan 26 '24 16:01 Riddle1001

Just wanted to add that my laptop that runs Ubuntu also has the same issue

Riddle1001 avatar Jan 26 '24 21:01 Riddle1001

Does it happen to crash if you copy/paste from one GMod instance to another? 😄

Does It it also happen if you copy the string into a text editor and recopy it from there? Maybe Linux is adding formatting metadata when copied from the game somehow.

Grocel avatar Jan 29 '24 19:01 Grocel

Does it happen to crash if you copy/paste from one GMod instance to another? 😄

Does It it also happen if you copy the string into a text editor and recopy it from there? Maybe Linux is adding formatting metadata when copied from the game somehow.

Yeah, e.g I can paste into notepad++ and then copy from notepad++ and paste into vscode and it works fine

Riddle1001 avatar Jan 31 '24 05:01 Riddle1001