maybe i am remembering ancient unix but isn't the zero the inter-variable separator?

-Steve


On 4 Jun 2025, at 5:37 pm, ron minnich <[email protected]> wrote:


anyway, I found it, when you do this in rc:
x=y
rc writes a trailing null. 

Not sure that's needed, but it's what it does. I'm going to strip trailing nulls in the cpu command.

On Wed, Jun 4, 2025 at 7:55 AM ron minnich <[email protected]> wrote:
I'll be submitting a PR to fix it, we'll see how that goes, because the code, as written, doesn't even give you some idea how many variables had the problem. 

I don't see that exposing those names is that big a deal, but we'll see.


On Tue, Jun 3, 2025 at 5:15 PM Daniel Maslowski via 9fans <[email protected]> wrote:
The author of that error message might have chosen to not expose/disclose the information.

Anyway, interesting - would be really nice to see both systems integrate seamlessly!
I have a good collection of hardware by now that would really like to see this.

On Wed, Jun 4, 2025 at 1:57 AM ron minnich <[email protected]> wrote:
well, here's a fun one. 

I've got my golang cpu command working on plan 9. So I'm working to have my plan 9 cpu connect to a linux vmx guest running my golang cpud.

The linux kernel has the initramfs builtin, so ... one file for vmx to worry about, and 0 disk images.

side note: qemu was choking on this kernel somehow, but vmx ran it just fine. I like vmx much more than qemu at this point. I prefer to test these linux kernels on vmx now.

The goal is to have a linux appliance process, where it is easy to (e.g.) run python3. So the only thing embedded in the linux kernel is u-root programs and a cpud. You should be able to cd to the root of a linux file system, and say
linux usr/bin/python3
where linux is a wrapper for vmx, and have it work. We had this on akaros. It's handy. 

The only big problem will be the plethora of symlinks in linux images, but I have a workaround for that, so we'll see. 

Anyway, plan 9 cpu was connecting to linux cpud, mounts were happening, and so on, then I got this on the cpud side:
"exec: environment variable contains NUL"
and the cpud exec failed.
WTH? Well, it turns out, it's this in src/os/exec/exec.go.

                // Reject NUL in environment variables to prevent security issues (#56284);
                // except on Plan 9, which uses NUL as os.PathListSeparator (#56544).

The problem is, this doesn't work if you are communicating plan 9 environment variables to Linux, and that's what we're doing. You kind of have to for cpu. I will guess I'm the first person to see this ... kind of funny. Working on it. 

I'm a bit annoyed that whoever wrote the test and error did this:
err = errors.New("exec: environment variable contains NUL"
instead of this:
err = fmt.Errorf"%q:exec: environment variable contains NUL", kv)
since it's always kind of nice to produce useful error messages :-)
but at least I got something!

btw, my talk, the paper, and the code for vmthreads is mirrored to github.com/rminnich/vmproc.



Reply via email to