-
gitomat
[illumos-gate] 16211 fexecve tests fail if output is redirected -- Andy Fiddaman <illumos⊙fn>
-
bahamat
rmustacc: Follow up to my nvme question the other day, they were on a PI before that issue you pointed me to.
-
rmustacc
OK, great. Hopefully if they can update that should work.
-
bahamat
Yeah, they did and reported that it's resolved.
-
rmustacc
Even better.
-
rmustacc
Glad it was that simple bahamat.
-
jbk
i was just saying earlier, the simples fixes are great :)
-
jbk
... as i'm about to get dragged into iscsi hell (which is somewhat of a redundant term :P)
-
jbk
though speaking of which, i should probably add decoding of it to snoop
-
ptribble
Ouch. The fexecve() change looks a lot more damaging than originally expected
-
ptribble
When I looked at the review it was a simple wrapper, but turn your back for a moment and it's quite a different thing entirely
-
rmustacc
What's wrong?
-
rmustacc
And/or why is it damaging?
-
rmustacc
Special casing parts of the VFS namespace in the kernel isn't exactly a simple wrapper.
-
rmustacc
Given you're changing the semantics of what exec() meant.
-
ptribble
If I understand the fallout on OI correctly, then a zone or chroot with a pre-change libc will fail
-
ptribble
And one of my common zone usages is to run older/different illumos distros in zones
-
ptribble
And while we've never said that would work, for it to fail without warning would be a surprise
-
ptribble
I haven't actually tested this, just catching up on the mailing lists and looking at the final commit.
-
ptribble
(Been slightly busy on the day job, which is currently porting Java back to Solaris/SPARC.)
-
sommerfeld
ptribble: only if you use the OI-special "nlipkg" zones
-
sommerfeld
which let libc in zones get out of sync with the kernel.
-
rmustacc
Uh, wait, you're letting libc and the kernel get out of sync?
-
rmustacc
I guess we've been operating under different assumptions. We definitely treat the constraint as libc and the kernel must be in sync.
-
rmustacc
You have ABI compat for user software definitely.
-
ptribble
But if I'm running an OI or OmniOS or XStreamOS zone on Tribblix (or an older version of any on a current version), which has worked perfectly for years, then I get into trouble
-
rmustacc
I know this doesn't happen often, and it's certainly frustrating regardless.
-
ptribble
Generally, as long as the zone is older than the host compatibility is just fine
-
rmustacc
That's definitely not always true for core software.
-
rmustacc
That is, the expectation is that the consolidation is in sync. At least from a design constraint perspective.
-
rmustacc
Otherwise you basically are requiring us to make the system call ABI and not libc static.
-
rmustacc
I get that it doesn't break often and I don't want to say won't fix as it's important we figure out stuff here.
-
rmustacc
But at least from a constraints we've told people in the past and committed to it's been around libc/kernel and similar things with unstable interfaces being in sync.
-
rmustacc
Admittidly the last super obvious case of this was the pipe system call changes many, many years ago.
-
andyf
There was a more recent one, when a structure used over a door between the kernel and dlmgmtd changed.
-
andyf
I thought that nlipkg zones (and ipkg in OmniOS, which is the equivalent), enforced a minimum set of packages to be in sync with the GZ
-
sommerfeld
was completely unaware of this until today but OI has a "nlipkg" brand which evidently doesn't enforce enough:
docs.openindiana.org/handbook/systems-administration/#zones
-
jclulow
Yeah that's totally unsafe
-
jclulow
I expect lots of subtle changes we've made in the last few years will _seem_ like they're working, too, while potentially causing a bunch of silent data corruption
-
jclulow
(any time you rearrange a struct for an ioctl, etc)
-
andyf
I need to refresh my memory, but that's what these are all about:
-
andyf
-
andyf
Until right now, I thought these in the gate manifests too
-
andyf
*were
-
andyf
-
jclulow
I think if you want to be able to use zone images as-is you probably need to be a lot more like Solaris 10, basically: in your distribution, tightly manage releases and binary compatibility. Then you can make a brand like the s10 brand which is a mixture of replacing components that have changed, and doctoring system calls to create a kind of partial syscall stability against a specific era
-
jclulow
But it is not really feasible to do that for an arbitrary set of foreign distributions that may have their own local patches, etc
-
jclulow
What we're prototyping at Oxide is a little different from that. We have zone images, but we're treating them more like layers. The base system provides things like libc, and your zone image is an overlay on top of that of files that are _not_ base system files; e.g., your application, maybe a PostgreSQL client library, etc.
-
jclulow
It's a bit like Docker, basically, except that instead of just depending on the kernel as an unseen artefact that happens to be outside your container, you're really depending on quite a lot of files and processes that are _inside_ your zone, but which didn't come from your image
-
ptribble
The layered approach is how I've built production zones since day 1, essentially.
-
jclulow
SmartOS does that too, with the caveat that you can't modify /usr so all of the zone-delivered software has to be in /opt instead etc
-
ptribble
But the other use case is for building software against an older release, essentially the zone is like a sysroot rooted at /, so I can't modify the local libc
-
jclulow
I think for that, you either need a built that understands how to use "gcc --sysroot" or similar: essentially a cross-compiler. Or, you need VMs running the older software release.
-
ptribble
I'll have to look at the s10 change to see how hard it would be to mirror that
-
jclulow
s/built/build process/
-
rmustacc
I definitely tripped over just assuming that the old libc would run in the past with software with the pipe change.
-
rmustacc
It definitely sucks compared to the convenience, but I don't know a good way to solve it.
-
jclulow
If you just want to unwind this specific change inside zones, the s10 brand is a good model, I think. e.g., here is a filter on pwrite() --
github.com/illumos/illumos-gate/blo…_brand/common/s10_brand.c#L711-L736
-
sommerfeld
so it seems that the reason why you might want to do that is so that the build doesn't see new features in libc that wouldn't exist in the older system.
-
rmustacc
sysroots for that kind of thing are fine. The hard part is being able to *run* it.
-
sommerfeld
but even if you had a magic linker that produced a filter that limited the new libc to just the endpoints visible in the old libc, there could still be new kernel behavior detectable by configure which would give you something that wouldn't work on the old kernel.
-
jclulow
Yeah you have to cross-compile. Your software needs to know it's cross-compiling and cannot do run-time tests.
-
jclulow
That's why we have
github.com/illumos/sysroot -- originally so that the Rust project can build rustc/cargo/etc binaries that run on illumos, but because of their infrastructure requirements they do that build on a Linux machine.
-
jclulow
So they have a cross-gcc and cross-binutils configured to use the headers and libraries from illumos/sysroot for building and linking.
-
jclulow
(and their build does not use autotools)
-
jclulow
I could imagine actually some option to ld that would make a binary as something you're not allowed to execute on this system
-
jclulow
*mark a binary
-
sommerfeld
yeah, either cross-compile or run in a VM.
-
jclulow
so that if a cross build _accidentally_ tries to do a runtime tst
-
jclulow
*test
-
jclulow
you'd know about it; a core file etc
-
jclulow
Or I suppose just mount your build directory noexec maybe, even?
-
sommerfeld
Filesystem W^X mode - at mount time, choose either ro or noexec for all filesystems..
-
jclulow
haha
-
jclulow
Yeah I guess you would need to make all the /tmp and /var/tmp stuff noexec too
-
jclulow
alternatively, a procfs-based supervisor for a build that monitors all execs
-
sommerfeld
or dtrace
-
jclulow
You could do DTrace but you'd have to be careful to make sure there were no drops
-
jclulow
Which are more likely the harder the machine is working on the build etc
-
sommerfeld
-
andyf
I think that if OI add those self dependencies to package manifests, then nlipkg zones would also have received at least the key packages like system/library. It looks like danmcd added them to OmniOS when he added linked zones, but I don't know the history there.
-
andyf
sommerfeld - thanks for those emails links, I wasn't aware there was fallout from the change.
-
jbk
just as a sanity check, is there any good reason to use a semaphore like a mutex (e.g. init to 1)?
-
sommerfeld
(speculative = I haven't reproduced it myself)
-
sommerfeld
andyf: is there any good reason to not add those self-dependencies to illumos-gate?
-
jbk
it seems like the fact that you can't (easily) track who actually has the lock would be a downside, and I can't really think of any upside
-
andyf
I don't think so, no. Except that it becomes no longer possible to shoot yourself in the foot quite as easily. I'm hoping danmcd might have a bit more context on how they came to be in OmniOS, since I know the linked images landed there some time after OI
-
sommerfeld
jbk: some people learned about semaphores first, and didn't move on to newer abstractions?
-
jbk
this is in the iscsi initiator code, i guess they didn't look at any of the other code in the module?
-
sommerfeld
but, yeah, hba_sendtgts_semaphore looks like it could be a mutex.
-
sommerfeld
(assuming that's what you're referring to..)
-
jbk
actually iscsid_config_semaphore
-
sommerfeld
that one too.
-
sommerfeld
-
danmcd
So early on ipkg zones (even upstream in Oracle Solaris) didn't properly link ngzs with GZs.
-
danmcd
Once linked-images came along I asked Theo: "Do I keep ipkg unlinked or change it to match upstream?" He told me to keep them (presumably for least-surprise reasons). So I introduced `lipkg` into OmniOS.
-
sommerfeld
see also
hyrumslaw.com/: "With a sufficient number of users of an API,
-
sommerfeld
it does not matter what you promise in the contract:
-
sommerfeld
all observable behaviors of your system
-
sommerfeld
will be depended on by somebody."
-
andyf
danmcd - I think I remember you asking us all on the mailing list too, at the time.
-
danmcd
Oooh, there's receipts then.