Commit Graph
4 Commits
Author SHA1 Message Date
MaxsTechReview 183cbd9351 fix(preload): start apps that check for a single thread and stop the first-call allocation hang (#2995)
* fix(preload): look up the native glibc symbol version first so wrapped calls never allocate

On x86 the first dlvsym lookup asked for GLIBC_2.17, which only exists on arm64. The failed lookup makes glibc allocate, which deadlocks when the first wrapped call happens inside a program's own allocator setup. Each architecture now asks for its base version first.

* fix(zram): start the page-out worker per request instead of keeping a thread in every process

Every process that loaded the session preload carried a resident zr-worker thread from its constructor on. Programs that check they are single-threaded before forking or before unshare(CLONE_NEWUSER) failed, for example Chromium's zygote, which could not start its GPU process.

The signal handler now starts the worker with a raw clone on a stack the preload maps itself. The worker makes only raw system calls and exits when no request is left, so starting it from the handler is safe and idle processes stay single-threaded. When the worker cannot be started, the process trims inline in small steps as before.

* fix(preload): start the page-out worker with the same clone flags as a thread

Programs that filter clone to the flag set threads use, as browser
sandboxes do, now accept the worker. The kernel clears the stack-busy
word and wakes waiters when the worker exits.

* fix(preload): page out inline in single-threaded and self-sandboxed processes

A process with one thread may be about to check that it is single-threaded
before fork or unshare, and a process that added a seccomp filter after it
started may trap system calls into its own handler. Neither gets a worker
thread now; both trim inline in small steps as before.

* fix(preload): check the signalled thread's own seccomp filters before starting the worker

Read Seccomp_filters from /proc/thread-self/status so a thread that installed its own filter
without TSYNC trims inline instead of calling clone under that filter, and fall back to the
inline path when the signal mask cannot be changed.

* test(preload): start parked threads with SIGURG already blocked

* test(preload): count only page-out workers when checking for leftover threads
2026-11-21 20:11:18 -05:00
Kurt Himebauch 9925873764 revert(input): restore pre-overhaul controls (#2958) 2026-11-20 19:43:09 -05:00
Kurt Himebauch a3e8b44145 fix(input): Remote Play connects again with the virtual pads present (#2946)
Since #1593 every process except the Steam client gets DroidDeck's udev
answers through dlsym. Steam's Remote Play client, streaming_client, is
an SDL3 program: for each input node it treats as a joystick, SDL3 asks
udev_device_get_driver for the device that udev_device_new_from_devnum
returned. The preload answered new_from_devnum with its own handle for a
virtual pad but did not answer get_driver, so the real libudev read the
handle as its own and streaming_client crashed before the stream opened.
It reaches that call whenever it can stat a pad node: the Xbox 360 pad,
Steam's own uinput gamepads, and since #2033 the pads it reads.

streaming_client now keeps the real libudev like the Steam client, and a
virtual pad answers get_driver with no driver, so other SDL3 programs no
longer crash on it.
2026-11-20 13:19:12 -05:00
kingokksa c4f4e18f87 fix: the virtual pads reach non-Steam programs, where udev is resolved through dlsym (#1593) 2026-11-19 08:37:43 -05:00