Comments (2)
After some more research, it turns out the GHC threaded RTS and libpsx
are not compatible because GHC creates a thread (the ticker
) which explicitly disables all signals (see the use of sigfillset
in rts/posix/ticker/Pthread.c
). Since this also preempts delivery of SIGSYS
as used by libpsx
, we end up with a deadlock.
There's a work-around: wrapping sigfillset
, and ensure SIGSYS
is not set in the sigset_t
, similar to how libpsx
requires pthread_create
to be wrapped. This could, obviously, cause weird runtime issues if SIGSYS
is used for other purposes...
from landlock-hs.
It's possible to use libpsx
with the GHC RTS. However, while working on a package exposing this functionality, I ran into hard-to-debug issues in the GitHub Actions CI environment, which I could not reproduce at all on my Fedora 36 host.
Turns out the version of libcap
shipped with Ubuntu (up to at least Jammy 22.04) and current Debian, i.e., libcap
2.44, comes with an utterly buggy libpsx
when using psx_syscall6
: instead of passing the requested syscall number and arguments to syscall
, it passes junk, due to a bug fixed in https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=e7e0e1b9e2cf3378d329174ed5b0c716b0539c72 which is included in libcap
2.46 and later.
Hence, this won't work unless
- we include a working version of
libpsx
in the build - we somehow assert a working version of
libpsx
is linked in - we write a
libpsx
equivalent as part of this library
from landlock-hs.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from landlock-hs.