io12 / userland-execve-rust Goto Github PK
View Code? Open in Web Editor NEWAn implementation of execve() in user space
License: MIT License
An implementation of execve() in user space
License: MIT License
To cut a long story short, I'm trying to use userland-execve
to wrap various compiler components. Specifically, I'm following along with Linux From Scratch 12.0, using the tools from earlier chapters wrapped with userland-execve
. So far, I've made it up to GCC pass 2, and this is where the story begins.
Somewhere during this build, make
fails because one of the subcommands wrapped with userland-execve
failed. Specifically, cc1plus
(the internal GCC program for compiling C++ to assembly) ended up segfaulting. Originally, I assumed that something went wrong with an earlier build step that caused the segfault, but I narrowed it down and found that I could reliably get cc1plus
-- when executed exactly the same way-- to segfault under userland-execve
, but not to segfault when executed normally. Other invocations of cc1plus
with userland-execve
succeed, even within the same make
invocation, so something goes wrong during this specific command invocation.
I spent some time creating a script that reproduces this issue in isolation, and here's what I ended up with: https://development-content.brioche.dev/files/userland-execve-segfault.tar.gz (SHA256: 9b74194f54c9a83cb601015da72390f567da2ed98b78ff9955528d737f0c1138
)
This tarfile contains a repro.sh
script which, when run, executes cc1plus
through userland-execve
, then segfaults. If you call cc1plus
directly (by commenting out line 7), then the command succeeds. The only requirement for this script is that userland-execve
is available on $PATH
-- everything else is fully contained in the tarfile, so this should run on any x86-64 Linux system.
Also in the tarfile are two strace
traces: one when calling with userland-execve
and one when calling without.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.