-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Application still run after bubblejail fails/exits #76
Comments
Hello @xiota I can't reproduce this. I've set the outbound address to a non-existing name and bubblejail fails to run.
|
Upon further testing, this seems to be only on the first run (most reliably reproduced after reboot). Possibly related to the Seems to occur with GUI applications and X11. Does not occur with shell script. It does not occur with network names that don't exist (eg, random strings). Only names do or should exist.
|
Hmm. I experienced this today but with the limit namespaces service:
|
I should have ran the |
I tried running |
Bwrap still runs successfully so the namespaces should be there. |
I encountered the bug today and checked the namespaces. There was nothing abnormal about them. My current theory is that there is some kind of file descriptor confusion. I am planning on adding the logging module. When set to DEBUG it will print every little detail like the file descriptors that are used. |
Using build from 8477471. After reboot. Desktop environment loaded. Bubblejail not yet run.
After first (unsuccessful) Bubblejail run. (Looks same as earlier output, except nprocs is higher.)
After second (successful) Bubblejail run.
|
So I had a Firefox instance failing today after boot because it could not decode the JSON written by the bwrap:
File descriptor confusion theory seems more likely. |
I finally found time to work on adding logging. Right now it is in a separate branch It adds a new command line option |
Thanks. I tried it. Didn't notice anything indicating what the cause might be. Just to refresh/summarize the issue, on first run of an instance after reboot (Firefox, other web browsers, and GUI network applications), bubblejail usually produces an error that includes the following, which appears to be produced by
Even though bubblejail exits after producing the error message, the program (eg, Firefox) continues to run. When I first reported the issue, this happened every time. Now it seems to happen about half the time. Subsequent runs of the instance seem to work normally. Running a different instance (eg, different web browser) produces the same error and behavior on first run. Command-line programs do not have the issue. Desktop is KDE Plasma. Network is managed by Network Manager. Configuring The first-run error message does not recur after disconnecting and reconnecting the network. toml of an instance that has the problem.
Paths at |
I have a few ideas what might fix these issues. 21a01e5 Use network namespace and NS_GET_USERNS ioctl. This means the slirp4netns definitely be given the user namespace that owns the network namespace. I tested it a bit in the testing command line and previously running an instance more than once would also have had the 8ad588d Check for magic value when reading from ready file descriptor. Looks like reading from closed pipe can return empty string. Previously only reading from pipe was checked. Could you give those changes a test @xiota ? I uploaded them to the |
@xiota how was your experience with those fixes? I plan on releasing 0.8.2 version if they are successful. |
No error messages with the fixes. Error messages return when the old version is reinstalled and computer rebooted. Error messages gone again when fixed version is installed and computer rebooted. |
0.8.2 has been released with the fixes. |
0.8.2 release (12307c4) is working well. Thank you. |
I think I figured out the original bug. It was a concurrency issue with a PID written by a bwrap in to the info file descriptor. It writes the PID as soon as it forks but not all namespaces are initialized. So the original code that used the UserNamespace would either get the owner user namespace or child user namespace based on how fast the code ran. |
Output of
bubblejail --version
AUR-git 0.8.1.r0.g806acc9
Your distro name and version
Arch Linux
Description
After failure, the application associated with the instance is still run. When run from a terminal, the user is returned to the command line after the error messages are printed.
bubblejail
execution appears to have ended, and I don't see anything indicating that the application would still run.Expected behavior is to not execute the application because setting up the sandbox had already failed.
To reproduce, enable
slirp4netns
, which currently fails on first run. (#65)Here are the error messages from a recent run.
The text was updated successfully, but these errors were encountered: