by dkarl · 6y ago · 0 comments
This gives me an idea: Hell Linux. In Hell Linux, the operating system does its best to pretend that nothing is wrong, so it takes you as long as possible to realize that you've made a mistake. Commands ignore all unrecognized flags. In shell scripts, if one branch exits with a nonzero exit code, the other branch is taken. stderr is always redirected to /dev/null. 0 exit code is reported for all processes, no matter how they terminate. If you try to exec a file that doesn't exist, it runs a process that does nothing and immediately exits, unless it is part of a pipeline, in which case it consumes standard in. If you try to read a .json file that doesn't exist, you get the bytes "{}". When you read a log file, any lines containing "ERROR" or "WARN" are skipped. If you try to connect to a port that nothing is listening on, it does its best to behave like the service that should be listening there. Oh, the possibilities....
The idea is, if your code builds and works on this system, it'll run anywhere, correctly, because the system leaves no room for "oh, everybody does it this way, so it's fine to rely on this non-standard behavior".
Now, set up your CI system so that your "POSIX build" builds N times, each time in a new one of these randomly-generated "technically POSIX" chroots.
I needed 2 computers to fix that one.
But AFAIK z/OS is the only UNIX[1] variant that offers a "POSIX" environment
Where no subset of the native character set even resembles ASCII.
Where "everything is a file", but where many of these "files" — including, notably, both shared libraries and executable programs — are mostly inaccessible using anything resembling traditional byte-oriented UNIX utilities, library functions, and system calls.
Where process creation is not only "not cheap", but where it can in fact be so cripplingly expensive vis-à-vis conventional UNIX systems that the z/OS designers have (wisely) not only resurrected something akin to the traditional meaning of the "sticky bit" on executables, but have also made extensive provisions to allow both "subshell" scripts and executable subprocesses to be created within one's own address space, both via system calls and from within the POSIX shell itself[2].
On a related note, I was thinking the other day that an "evil", yet at least minimally standards-compliant filesystem in the spirit of your system might actually useful to have around for testing. Or, if not, would at least be fun to design.
Think a filesystem that imposes random per-directory length limitations on filenames and or file sizes, and occasionally allocates space for files in terms of random, per-file allocation unit sizes just because it can.
Or imagine a filesystem that flushes the overwhelming majority of data to disk promptly, but which also maintains a large "evil cache" containing a few blocks out out of the middle of every few million write calls that is flushed as infrequently as is permissible by the relevant standards.
And why let previously-allocated free space go to waste when, given careful planning, its contents could be used to present stale, yet technically "valid" data to applications that use I/O operations whose ordering with respect to one another is not formally defined for IPC (e.g., POSIX only explicitly defines ordering between its own read() and write() calls, so I/O by any means not passing through particular versions of these functions explicitly designated as POSIX-compliant can, in terms of standards-compliance, be "safely" ignored).
And so on.
[1] https://www.opengroup.org/openbrand/register/ [2] Google "_BPX_SHAREAS" for details.
Just like the web (W3C?) was a front for microsoft taking over from Netscape, and now Google taking over from everyone else, the linux foundation et al are just fronts for Google et al to have whatever they want on the kernel and to prevent any and all GPL3 "corruption" of their take-take-take business practices.
GNU/Linux is old news, everyone runs BIGCORP/Linux today. You probably have more code from Google/Amazon/etc than GNU in any modern distro.
Just look at all the effort devoted to systemd (which is a blatant copy of oracle/windows service management) or everyone eating up the hype of zsh on macs (which is nothing but a spin from apple: Look how this new shell is so much better, oh bash is going to be GPLv3, no this has nothing to do with it, look how shiny is zsh!)
GPLv3 will set you free!
Systemd is really just the most blatant of these kinds of efforts.
1. If you manage to "beat the system", and bend the web to your will, those invested in it will label you an outlier or accuse you of being like Richard Stallman.
The Suicide Linux idea, and in fact, all "rm -rf /" jokes, are still perplexing to me because I always made systems where one could accidentally rm -rf / (still have not done personally that after 20+ years) and would not lose anything of importance, because / is an overlay and any long-term user data is stored on external media, separate from executables, which I unmount after a periodic save completes. I guess I could describe it as a minimal system booted from USB and running in RAM, overlayed with a more complete system (downloaded from the network then extracted), also running in RAM, with a workspace consisting of 100% RAM. The only way to destroy the system is to mount the USB stick read-write, chattr -i on everything and then try to rm -rf /. Impossible to do that by mistake.
The guy I was working on it with dropped out of academics for a career of spirituality. He went off to a monastery so I also abandoned the project as well. We never even got a publication out of it :-/. These days you could probably make a very expensive product out of it.*
Someone else may have picked it up, I don't follow the literature anymore
---
* - I just realized maybe he went off to become a spook - I don't know how I never thought of that - even to this day many of my colleagues from the era work for these nebulous companies with names like "The Adirondack Group" who just have a basic website with a single email address. I never understood why they even try, just say "we are spies" - everyone knows it. Maybe it allows them to live otherwise normal social lives where they don't have to lie about the superficialities of their job? I dunno. It can't be actually project based - that'd be super retarded - instead of knowing "he works for the CIA" everyone would also know what project they work on - super dumb - that can't be it. I'll probably hit up one of my old friends to see if that monastery was real. He can probably say "yes" or "no".
If I has asked him if he knew the name of the monastery as opposed to whether the entire story was a canard, I probably could have gotten further. By foolishly asking if it was a story, I think he fell back on the "zero information" strategy - as in, even if it's real and he's living a solemn life of meditation, don't say anything. Me effectively going "Hey man, I gotta question about spies" was in retrospect, pretty dumb.
Initially, I though you were talking about the lastest MacOS. You had me there for a second.
As someone who accidentally moved /etc recently, I have been into the valley of darkness and wish for no further OS pain.
I recently fixed a family computer that crashes randomly after a RAM upgrade. Removing the RAM didn't help, and it was totally a wild goose chase. The BSoD stop codes indicate some types of crucial system errors or memory corruption, sometimes in drivers, sometimes in kernel, but nonspecific. Finally I installed WinDbg and opened the crash dumps, and all dumps have the same error, and it became obvious immediately,
KERNEL_DATA_INPAGE_ERROR - This bug check indicates that the requested page of kernel data from the paging file could not be read into memory.
RAM was fine, the kernel simply cannot swap from the bad hard drive, no wonder it crashes. But the SSD was known-good, so I checked voltages, and saw the +5 V had a huge voltage drop. Upon closer look, found a loose wire at the power supply.(Which would be pretty likely, since when qualifying a new driver, you'd be stupid to use anything but the most bog-standard hardware and drivers for everything other than the particular device-under-test.)
0x0000000A: IRQL_NOT_LESS_OR_EQUAL
or... 0x0000007E: SYSTEM_THREAD_EXCEPTION_NOT_HANDLED
It corresponds to whatever the last operation kernel was executing before it fails, but without information on how it fails, and only indicates that something is wrong in the kernel or in a driver in general. You can chase these stop codes and check for bad RAM or bad drivers forever without real progress. Don't spend too much time on these codes, it's a waste of time. Enable memdump and get WinDbg. In comparison, analyzing the crash dump in WinDbg gives real information. KERNEL_DATA_INPAGE_ERROR - This bug check indicates that the requested page of kernel data from the paging file could not be read into memory.The only message for all syntax errors, is:
WHAT?
The only message for all runtime errors, is: HOW?
And the only message for legal but unsupported operations (e.g. out of memory) is: SORRY
See the source code here: https://github.com/ancientcomputing/8080_8085/blob/master/Ti...Syntax Error
This message appears when the assembler is too confused to know what went wrong.
:(
- - -
But yes, if Hell Linux exists, it'd make a great candidate for a future QEMU Advent Calendar[1] submission.> if one branch exits with a nonzero exit code, the other branch is taken
That's called the Amb operator. It's actually fairly useful! Presuming you tended to write side-effect-free shell scripts, I could see enjoying this one.
> If you try to read a .json file that doesn't exist, you get the bytes "{}"
I would actually appreciate some little intermediary utility that would inject "{}" to stdout iff stdin was empty. It'd make piping maybe-JSON documents through to jq(1) work a lot more smoothly.
> If you try to connect to a port that nothing is listening on, it does its best to behave like the service that should be listening there.
I love the idea of the xinetd(8) equivalent to Busybox. A multi-protocol stub server, that knows how to speak literally every protocol, and listens on every port it can, but does nothing much over any of those protocols. It could serve as a way to slow down a Metasploit scan, by offering it an endless variety of things to try to exploit!
> 0 exit code is reported for all processes, no matter how they terminate.
These two things are mutually exclusive - shell script branching is usually based off of exit codes.
But then I decided that the GP was probably throwing out suggestions, not developing an internally-consistent model for the final design. :)
There is already a major OS with this characteristic.
Aka “the PHP design philosophy”?