by Venn1 on 11/11/24, 9:41 PM with 147 comments
by fweimer on 11/11/24, 10:39 PM
At least the first one (the getenv thread safety fix) will hopefully make it into glibc 2.41 and it should be quite safe to backport. It turns out that setenv is easier to handle because glibc already never frees environment strings. It's concurrent unsetenv that is rather tricky. Without some snapshot approach, getenv would return null pointers instead of environment variables values that are actually set. I don't want to introduce locking into getenv because getenv without setenv has been async-signal-safe for so long that it would likely break applications.
The environ handling fixes are a bit more controversial because vfork+execve make it complicated to avoid memory leaks, but these further fixes are less important to the stability of the graphics stack.
by electromech on 11/11/24, 11:42 PM
by vlovich123 on 11/12/24, 4:36 AM
by o11c on 11/11/24, 10:33 PM
That said, GLIBC is pretty good at documenting all the dangerous functions, so it is possible to add locking/copying yourself.
by bhawks on 11/12/24, 7:13 AM
26 years ago people knew this API was broken but didn't fix it due to inertia of breaking buggy programs further.
There really shouldn't be a need to change your own process's envvars. For subprocesses just use the proper exec function. For anything else there should be a clear API to call rather than changing a global variable and hoping some code far away from yours rereads it and handles things correctly.
by josephcsible on 11/12/24, 12:32 AM
Is setenv really a Linux API, since it's neither defined by Linux (it's in POSIX) nor implemented by the Linux kernel (it's entirely in userspace)?
by INTPenis on 11/12/24, 8:02 AM
But the Steam client is really strange. Sometimes it works for months, and suddenly a game won't start, or something doesn't work, and I have to do weird stuff to get it working like purging all files or reinstalling. It doesn't make sense, it's like the Steam client rots.
by accrual on 11/12/24, 3:18 AM
by bhaney on 11/11/24, 9:45 PM
Yes please
by WhyNotHugo on 11/12/24, 11:16 AM
The article mentions that they use exevpe for spawning children processes. So what usages of setenv(3) would remain?
by thrdbndndn on 11/12/24, 6:52 AM
Could someone elaborate this for a non-developer? Why would you use `setenv` (which I assume is functionally similar to `export key=value`, but correctly me if I'm wrong) (extensively) for spawning processes?
by jeffbee on 11/11/24, 10:31 PM
by russnes on 11/12/24, 1:15 PM
by Pannoniae on 11/11/24, 11:27 PM
TL;DR: if you have Steam running for more than a ~day or so, you will run out of window handles so you won't be able to open any new graphical application/window until you restart Steam.
Using Steam Chat appears to make the issue worse (it happens earlier).
This has been documented under https://github.com/ValveSoftware/steam-for-linux/issues/9094 but for some reason that issue has been closed.
I personally just restart Steam every day but if someone else encounters this issue and doesn't know why their windows are not opening, this is why :)
I am using KDE/Wayland but I've observed this under X11 too.
by apatheticonion on 11/12/24, 9:31 AM
by arendtio on 11/13/24, 6:32 PM
https://github.com/search?q=repo%3Aioquake%2Fioq3+ttimo&type...
by DanielHB on 11/12/24, 9:32 AM
by nineteen999 on 11/12/24, 1:44 AM
by matheusmoreira on 11/12/24, 4:46 PM
I shopped around for computer parts with complete IOMMU support just so I could map the discrete GPU to the virtual machine and achieve near native performance... Only to discover they are exceendingly hostile to users who do this VFIO stuff.
Just yet another reminder not to "buy" games on these platforms, I guess.
by Aeolun on 11/12/24, 5:05 AM
If I spam the ‘retry’ button it’ll eventually work, but it’s a massive PITA.
by Dwedit on 11/12/24, 7:26 PM
by AzzyHN on 11/13/24, 3:51 AM
by snvzz on 11/11/24, 11:41 PM