I look forward to the end of capitalism. Capitalism is a disaster that crashes regularly, and the real question is when we stop bailing it out.

Capitalism is credited for all sorts of stuff it simply didn't do. What does Norman Borlaug's green revolution have to do with capitalism (he moved to Mexico to do the work), and we subsidize the heck out of the food and energy industries. What does Moore's Law or the internet have to do with capitalism? (You couldn't even commercially connect to the internet until 1993 when the thing was a quarter century old.) The interstate highway system wasn't created by capitalism. FDR's new Deal bringing electricity and telephones and plumbing to every corner of the country wasn't capitalism. Modern medicine emerged from the US Civil War, Penicillin was developed as part of the war effort for World War II, and national health services have always had better results than private ones. The US public school system making everyone literate and numerate and facilitating so much technological advance is the OPPOSITE of capitalism, as was the boost it got after Sputnik in 1957 (just in time for the Boomers to think that level of spending was normal, and then cut it for those who came after them).

The USA won World War II by SUSPENDING capitalism. We went on a "wartime production footing" instead. Our economy boomed afterwards because the period we spent NOT being capitalist repaired, refreshed and energized everything (after capitalism gave us the Great Depression) despite a large chunk of our work force dying or coming home maimed and/or with lifelong psychological problems, and spending 4 years rationing consumer goods and devoting all available production capacity to making useless junk we couldn't consume in peacetime (factories converted, thousands of tons of raw materials scattered across europe or sunk to the ocean floor)... And yet this non-capitalist mode mobilized half the workforce (Rosie the Riveter on the factory floor, the WACs and WAVEs managing it all) that capitalism was too biased to even access. The war gave us the computer, radar, two way radio, the transistor, nuclear power... When it came to its own nominal metrics for success (production of goods and technological advancement) capitalism SUCKED.

We obviously didn't land on the moon because of capitalism or we wouldn't have raced the Russians there. The only reason our government program (NASA) beat the russian's government program (despite Russia putting the first satellite in orbit, Sputnik, and the first man in orbit, Yuri Gregarin) was Kennedy moved the goalposts by announcing an ambitious (I.E. looney) moon landing when Russia was busy pursuing an orbiting space station, and by the time Russia retooled to pursue a moon landing instead they were behind and rushed to catch up in the new context, and their N1 rocket exploded and destroyed its launch pad. (It's a bit like AMD hiring the Alpha design team from the corpse of DEC in 1996 and leapfrogging Intel with the Athlon and Opteron, and Intel rushing to catch up and producing the Itanium and Pentium 4 in the early 2000s. A leader suddenly having to play catch up often stumbles under the pressure.)

My grandfather (the one who worked for the NSA, which I didn't know about him until mom died and he got suicidally depressed about outliving TWO of his kids, given uncle Bo died in vietnam) was assigned to the apollo program to work with the USA's captured Nazi scientists from the V2 program, and he once said that Werner Von Braun was a stickler for safety protocols, arguing that in a complex system you MULTIPLY the probability of failure for every component (if you bundle together 1000 components that each work 99.99% of the time, the result has a 10% chance at least one of them will fail). The Nazi scientists from the V2 program that the Russians captured when they took east Germany didn't include the QA and testing guys who were so paranoid about safety, and in the face of deadline pressure the Russians had an Unfortunate Incident that derailed their program. But there's no question the Russians could have gotten to the moon under their own power by 1975 or so if "being first" hadn't been the entire goal to the point the USA itself stopped going back after 1972. The russians switched back to their space station program in 1971 and then ran Mir for 15 years. The US responded with its own space station which was a disaster (only occupied for 24 weeks total, crashed back to earth in 1979).

The US waged a massive PR campaign against the Soviet Union during the cold war, and via McCarthyist purges and such we convinced OURSELVES that we were a captialist nation and assigned all sorts of virtues to capitalism that it had never earned. The Boomers were raised on this crap in the 1950's and got heavily brainwashed, but none of it was true. And now, 70 years later, we're being forced to realize this. Capitalism creates plutocrats, now as in the Gilded Age of the Railroad Robber Barons. We yanked ourselves OUT of it after the great depression, and then plunged right back in because we were so scared that communism would win. If the people afraid of communism thought it really didn't work, why would they have spent so much effort opposing it, and warning of its rapid worldwide spread? If even Russia (the one place Marx said communism would never work, still a theocracy of illiterate medieval peasants ruled by a king until 1917 because the european renaisance never made it there) could sort of make a go of it, how powerful would it be in a first world nation? Except step 1 was, as in France, to guillotine the billionaires. And the plutocrats were TERRIFIED...

Huh, it looks like Mozilla is toast. As much as I like chrome (entirely due to "pkill -f renderer"), I'm a bit uncomfortable with a monoculture. Then again, Mozilla's problems are self-inflicted and run deep, in fact the creation of mozilla was damage control in the first place, and the project's direction and sustainability were always problematic. A foundation that can suck down half a billion dollars annually and burn through it has NO BUSINESS being anywhere NEAR open source. A half billion dollars is an ENDOWMENT, at 5% interest that's 25 million per year, enough to support a couple hundred programmers working from home in perpetuity and still grow the principal faster than inflation. And yet somehow they spent it as fast as it came in, and ran out. Why?

Speaking of working from home, it turns out to be a net positive for productivity.

I'm getting so many emails trying to put advertising on my website. (Up to and including wanting to run articles in this blog. I boggle.)

Yesterday I didn't have any caffeine when I woke up, thinking I'd have some in the evening as I was heading out on my walk to UT. So I was tired and listless all day, and instead of heading out I fell asleep and slept through until morning. I didn't have any caffeine today either, and spent most of the day sleeping. It's not exactly a proper detox, but strongly implies I should do one of those at some point. (I usually go cold turkey for at least 2 weeks every year or so, to reset my tolerances.)

That said, I took two cans of milk tea (loire river assam and sunlee thai) and half a bottle of HEB's store brand splenda stuff I added milk to myself along with me on my walk to UT tonight. (And a bottle of normal uncaffeinated water, which I drank most of on the way.) I left behind all the V8 cherry and blueberry flavored energy cylinders though. LESS caffeine is probably a good thing. (I would still be taking the blood pressure medication, but they stopped prescribing it until I got back up to minneapolis for a kidney test. It was less powerful of a diuretic than all the caffeine I've been drinking since, but my logic is if they won't give me blood pressure meds than clearly I'm cured. No, this country does not have a functioning health care system, why do you ask? The proper fix is probably to lose 80 pounds...)

Toybox: I am gonna have to audit soooooo much memory leak stuff. (Well, run it and see what's leaking. I should learn to use valgrind.) My general approach to this is basically a manual garbage collection thing where I'm adding allocations to "delete" linked lists, and then traversing those in cleanup functions later. The question is the lifetime of those; if I have a for loop traversing a million times, I don't want allocations to stay until it exits. But then the way for loop lists work is python-like "expand the list up front and it survives until we finish", which... works on modern systems with buckets of memory? Right now the garbage collection mostly works at block level, so when you exit out of a statement (fi/done/esac) its resources get cleared. And a lot of the rest is at statement level: run a command and its arguments are freed when it returns. So the lifetime isn't so bad, but making sure I don't MISS anything is the hard part. (I can check filehandles via "ls -l /proc/self/fd", modulo the cloexec stuff where it should really be /proc/$$/fd. But checking memory allocations needs tooling.)

This is still a "burn this bridge when we come to it" thing, though. Not there yet...

Sigh. I think it's a given at this point that toysh isn't staying in the 3500 line budget I set for myself. Maybe I could hit it with fewer comments and blank lines, but that's cheating. I'm closing in on 3200 lines and just now adding {a..c} support and haven't even tackled functions and aliases yet, only scratched the surface of job control, have half of wildcard plumbing left to implement... There's a couple hundred lines of debug scaffolding to remove at the end, but my best bet for hitting 3500 is to finish it and then try to do more cleanups to get it DOWN to 3500 later.

Oh goddess, the QEMU build grew something called "meson", yet another new build system which is built on top of ninja _and_ python. So Android uses Soong, QEMU uses Meson, and both of them are built on TOP of Ninja (which was created because the Chrome browser build is a clusterfsck that doesn't scale; I blame C++) which requires python 3 and on at least some occasions hands off to cmake with a make wrapper.

I've ranted about "lateral progress" before. I miss the Linux Luddites podcast, whose motto was "not all change is progress". Scotty said "a good engineer is always a wee bit conservative, at least on paper". You don't reinvent the hammer annually, that's not how physics works.

Sigh. Oh well...

August 28, 2020

Ooh, Shinzo Abe resigned so Japan's racist exclusion policy could end. (Abe's achilles heel is his supporters are nationalists, so he had a hard time pushing back against racism. His political opponents took advantage of his mishandling of coronavirus to create a racism-fueled crisis (keeping all foreigners out of the country until the business community howled and Japan's reputation as a place international companies can do business eroded) that Abe couldn't fix, and exacerbated it until he resigned. (They didn't have to convince the immigration bureau to do that, they just had to stop PREVENTING them. Border patrol is a full-time job keeping "those people" out of the country, as with ICE it's a magnet for racists at the best of times. You need to constantly push back against overreach, and his opponents in the tug-of-war let go of the rope so Abe's nationalists sprawled in the mud.)

In theory, this means Jeff and I can go back to Japan soon. (I can't blame Japan for having a racist Boomer problem when my country is putting kids in cages, school to prison pipeline, kidnap vans...) But early voting in texas starts October 13th and I'd like to stay here until then because absentee voting and mail-in voting are the same thing so that's been completely sabotaged. Hmmm... (I flew back from tokyo to hold my nose and Vote For Her in 2016, can I delay my trip back for a month to hold my nose and vote for the Geezer and Good Cop now? It's still a vote against not for, but that's the 2 party system for you.)

The Linux Foundation sent out a "5 sessions you can't miss at $RANDOM_FUNDRAISING_EVENT" and... Sure I can. In fact, since you phrased it that way, missing them now qualifies as an _accomplishment_. Go me. (No idea what the sessions actually _are_, I've configured thunderbird not to load external HTML tracking data from emails, and all the actual content is in the empty rectangles it would pull from their advertising tracker. That makes it even EASIER to miss these sessions.)

Yesterday I accidentally kicked the cat's water bowl and spilled some of the water on the floor, but thought "it'll evaporate". Walked through it multiple times going "Aah! Oh, right. It'll evaporate." Somebody knocked on the door wanting to speak to me and I started to answer the door and then ran to the kitchen to grab my mask. Doing a running pivot through the puddle of cat water, on a tile floor.

On the bright side, I didn't break anything. But after a minute or so of lying on the kitchen floor yelling "AAAAAAHHHHH!" repeatedly, Fuzzy told the person at the door it wasn't a good time, and got me some ibuprofen. The bruise on my right knee is kind of impressive, and I landed with a lot of weight on my left wrist (the one that's been bothering me since the mysterious illness after Jury duty that we can't prove was Covid-19, merely that AFTER I flew back from Japan which was already in full-blown covid panic, I was in a room with over 50 jury candidates for 3 hours before being selected for actual jury duty, and then a little over a week later I had a couple weeks of fatigue and terrible muscle aches to the point there was no comfortable position I could sleep in because lying down meant it hurt to breathe, and I was perpetually out of breath after until I started walking to UT every night to try to get some stamina back.)

Anyway, the weird soft-of-arthritis symptoms I had in my left wrist and left knee after that (the knee cleared up after a couple weeks of walking, the wrist comes and goes, typing was sort of trying to turn it into an RSI for a bit there)... That wrist is the one I landed on. It's unhappy with me. The knee I landed on is the OTHER one, and it's also unhappy with me.

Walked to UT anyway (very slowly), and trying to work on toybox. The function expand_one_arg() is returning NULL for error (ala ${abc?error message}) but you can also get NULL from the variable simply being unset and unquoted, such as expanding $i without quotes. In a redirection expanding to null results in an error (you'd think "echo hello > $i potato" would write to a file named potato, but it dies with "ambiguous redirect" instead), but when assigning x=$i it becomes an empty string "" ala:

$ x=$i env | grep ^x= x=

But what I'm trying to do right NOW is case expansions, which have two contexts: the "for $X in $Y) ..." stuff. And both of them expand to "" rather than erroring on NULL, but they do NOT use the SEMI_IFS logic because I tested that specific case in the email I sent Chet: IFS=z;echo "$*" expands with z, not space. So I need ANOTHER flag for this.

Yes, I broke down and emailed the bash maintainer again.

I'm aware that today's entry has technical content spliced at the end of lots of other stuff. If I still had twitter to vent the politics at I could do an even/odd alternating for technical/nontechnical, but twitter decided to be part of the problem. *shrug* It's 2020. "And we will be restoring normality as soon as we're sure what is normal anyway."

August 27, 2020

So many youtube videos abruptly stop partyway through I'm losing interest in the platform. (Any time a midroll ad comes on, I close the video and switch to something else.) It's seriously incentivising me to pay more attention to crunchycrunch and netflix and prime video and hulu and audible and such. It had replaced me "what happened today, better check twitter" for a while, but... not anymore. My phone hasn't exactly got a shortage of content, and none of the others are as broken as youtube's become. No, I'm not adding Disney+ or paying money to BBC iplayer or anything else paywalled. Your explicit announcement of annoying me into paying you money gets a "death first" response. I will not pay danegeld. (I feel I should install tiktok on general principles, but don't want a chinese app on my phone? The Resident's hatred of it could be reverse psychology to get people to install spyware. Not on HIS part, he's a dementia patient trivially manipulable by anyone physically nearby, but on the part of whoever gave him the idea.)

The sad part is most of the ads are for things like youtube premium (literally "pay us to stop this ad, this one here right now, this ad serves literally no other purpose, nobody else is giving us money to show it to you or anything"), and Google stuff like chromebooks. I'm pretty sure that Jerry Lewis lookalike who doesn't know about Mt. Everest is also advertising a google service, but I always either skip right at the 5 second mark or turn down the volume and look away before I get far enough for it to tell me any details. (You don't have to look back EXACTLY when the ads end, you can rewind the video back to the start.) The point is, Youtube's vastly increased the amount of ads but obviously hasn't sold the extra space and has to run filler.

There are no self-made billionaires and we should guillotine the lot of them. (By which I mean change the law so that hoarding a billion dollars is capital offense.) But fixing the racism gets us halfway to guillotining the billionaires, so focusing on fixing the racism first makes sense. It's been the main defense of plutocracy in the USA ("he's stealing your cookie") for over 300 years.

When the Minneapolis police chief says "It's my city, I will not tolerate that"... he doesn't own the city. The people living in the city are not his property, and yes that statement includes the black people. And the mayor who refuses to defund the police needs to be recalled. The police have become armed gangs, they should not be publicly funded.

Police in wisconsin are rioting, and the GOP kidnap squads are there now. The Resident announced his intention to cause riots back at the start of his candidacy, before the dementia reduced him to a husk. (Even then he was barely literate, so his "mein kampf" is old fox news interview tapes.)

The GOP's new policy is that people without symptoms shouldn't be tested, and the CDC passed that while Fauchi was under anesthesia.

Boomer Journalism continues to equivocate with "good people on both sides" while the right-wing loons target journalists at the very top.

The GOP is killing people intentionally. Not just the people ICE puts in cages, not just the people the police gun down in the streets: every school shooting is something the GOP defends, the pandemic is something the GOP allowed to run rampant because they thought it struck harder in blue states. The GOP is a death cult, powered by Boomers furious that everyone ELSE isn't about to die of old age like they are. (The unfairness of anyone ELSE suriviving! Can't be allowed.)

August 26, 2020

Got an updated bitstream toolchain build script posted, which involved shoveling out one regression introduced by standard bit-rot (a package's download URL moved) and another that's sheer developer hubris (explained in the linked message, the rot13 is inexcusable). I need to add two more packages to get a proper bitstream rather than just a simulatable netlist thingy.

Over on toysh, I need to expand case's argument with NO_SPLIT but not quite NO_PATH: it needs to COLLECT the wildcard metadata (it's resolving quotes as it goes so needs to note which wildcards were active when the cursor went past). So the existing plumbing should collect the wildcard info, but return it instead of processing it (since it's used to match a supplied pattern rather than search the filesystem). So I need to introduce a deferred wildcard processing mechanism. Hmmm...

$ x() { case "$@" in "a b") echo hello; esac;}; x a b hello $ IFS=z; x() { case "$@" in "a b") echo hello; esac;}; x a b hello $ IFS=z; x() { case "$*" in "a b") echo hello; esac;}; x a b $ IFS=z; x() { case "$*" in "azb") echo hello; esac;}; x a b hello

Darn it, I need more granularity than SEMI_IFS. (And the bash man page is wrong when it says it doesn't perform quote removal. Those are quotes, they got removed. azb != "azb" unless you remove the quotes.)

August 24, 2020

The students have returned to UT, which like the swallows returning to capistrano means that Covid-19 distancing is kinda dubious now. The tables outside the geology building are still generally free late at night, in part because no matter how many times I email facilities they won't reset the timer to turn the lights on at 8pm instead of midnight so nobody gets into the habit of hanging out here except me, who learned about it BEFORE the lights bugged out. (For a few years they would adjust forward for daylight savings time, but not back. When they hit midnight they got stuck.) But if I get here at 9pm there's a lot of foot traffic 20 feet away for the next few hours, close enough I feel I should wear my mask, which gets really damp really fast. Oh well, the USA continues to crit-fail handling the pandemic...

I'm making good progress on toysh case/esac handling, although it's one of those "many hours of pondering to produce few lines of code" things. Which is kind of toybox in a nutshell. (Ken Thompson's quote "One of my most productive days was throwing away 1000 lines of code" continues to be true.)

August 22, 2020

Fade heads back to Minnesota tomorrow. Not sure when I can head back to Japan, they're having a bout of politics. At this point I hope I can stay until October 13th to do early voting, since absentee voting and mail-in ballots are the same thing and that's totally borked right now.

(I THINK the travel thing is because Shinzo Abe's political opponents are trying to get him to resign by exacerbating a crisis he's personally ill-equipped to fix. Border patrols everywhere attract racist loons because who else wants to spend their lives keeping "Those People" out of the country as a full time job, but the people they REPORT to are supposed to keep them on a short leash so they don't run rampant destroying everything. Except Abe's political base is "nationalism and nostalgia" courting Japan's Boomer vote, and he's relied on his political opposition pushing back to temper the destructive effects of that. But after his mishandling of coronavirus weakened him politically, his opponents have basically let go of the rope in the tug of war until he steps down. So even though Abe's probably not directly personally causing the current bout of racist exclusion, it's aimed at him and the question is literally "when will Abe step down so Japan can allow immigrants back in". Of course I live in a glass house full of ICE so I don't get to throw stones here: Japan isn't separating kids from their families and putting them in cages like we are, they still have the relative moral high ground by a HUGE margin here. I'm just trying to figure out when the localized political weirdness clears so I can get back to work.)

Elliott suggested I try to get more sleep because it's affecting my toybox work, but I'm having to become a USB low level protocol domain expert for $DAYJOB, which may involve moving back to japan or may involve moving to singapore depending on how long japan's immigration ministry can sustain the racism. The new hardware arrived the day before yesterday but I haven't got a bitstream build that wires up a connection to it yet, and the old ghdl toolchain I had working back in november has bit-rotted and I need to figure out how to build the new package versions.

Toybox is not my day job. I would LOVE for it to be my day job, but the only people who want to pay me to work on it are on my patreon, which I'm grateful for but what I make from that in a year doesn't pay my mortgage for a month, let alone the rest of the household budget.

August 20, 2020

Oh goddess, Wikipedia[citation needed] says that switch_root is basically chroot. That's very much not true: switch_root does an rm -rf on the old directory, which is why switch_root checks to make sure that directory is initramfs and won't work on anything else. The point is to switch from initramfs to a persistent root filesystem while freeing the memory used by initramfs, where freeing means deleting the files on the way out.

And chroot doesn't change the "apparent" root filesystem it changes the "active" root filesystem. It would be really nice if you could bind mount a directory onto / and unmount the old mount point with the bind mount staying live, but last I checked Linux didn't have the resource tracking granularity to get that right. Possibly umount -l would work though? Haven't checked recently...

This would address the main problem with chroot: with system calls you can easily escape a chroot() because chroot() doesn't chdir(), and "cd .." just checks that the current directory equals the chroot dir (or top of the actual mount tree), so mkdir("sub"); chroot("sub"); chdir("../../../../../.."); chroot(".") and you're out. (Basically each process has two filesystem reference points: "." is what chdir() changes and getcwd() returns, and "/" is what chroot changes. If "/" is UNDER "." then chdir("..") never hits it, and you bubble "." up to top of tree.

But the --bind mount trick creates a new mount point that has a subdirectory as the top of the mount, if you cd .. from the top of that mount point you go to whatever directory it was mounted in, and if it's mounted on "/" (I.E. mounted over initramfs, which you can't unmount for the same reason you can't kill pid 1: the kernel uses that entry as a known pointer to start/end traversal of doubly linked lists and either can't find the list at all or loops endlessly looking for it) and you stop (loop) there.

Having chroot() trace the ->parent links from the "." dentry until it hits the new "/" node, and if it doesn't then set "." equal to "/", would also fix it. But I've been told that's crazy talk. And the kernel guys refuse to address this while you can mknod the relevant /dev node and mount a fresh instance of it, escaping the chroot that way. (Which won't work to get initramfs or a credentialed network mount back, but try telling the kernel guys that. This is not a perfectly complete 100% fix of every problem, therefore why bother?)

This is like 15 to 20 year old noodling, from back when Linus had time to explain things to newbies personally. LONG before containers showed up and they started to actually try to SECURE all this stuff. It's also why contianers use pivot_root() instead of chroot(), since that basically does two simultaneous mount --move atomically. And has special case magic behavior if the first argument is actually the top of tree in the global namespace where it traverses the process list and moves the "/" and "." links of each process that points to the old one you're pivoting off of, so you can actually umount the old filesystem despite kernel threads otherwise having their "/" point to it...

August 18, 2020

I have been reminded of the README markdown conversion. That tab didn't survive my laptop's last reboot (back when it turned itself on in my backpack and ran down the battery), and I'm not entirely certain where I left the directory with the files I'd tracked down...

I ran on a bit long in a github comment, because I went down a couple ratholes. The first is about Android not using "git describe" for toybox --version, and the second is about commands commonly having an identifier line before usage: in their --help text.

First line of --help identifying the package and giving a version seems to be the common case, anyway, but I don't understand this "no date/hash" policy, so need guidance. (If it was up to me I'd just have android use the normal "git describe" plumbing for the version, since they already tag their releases and building a tagged version would just emit the tag name verbatim as the version. Plus whatever they do is going to have a unique git hash anyway because their history has extra commits in it and each git hash includes the previous git hash in its calculation, since long before anybody thought "chaining hashed blocks" deserved a unique name. Torvalds published 3 years before Nakamoto. But I assume Android has their reasons. For one thing, if you tag a release _after_ you build it, the commit you built wasn't tagged when you ran "git describe" so it's gonna show oldtag-count-hash unless you override...) IF we make the ID line before usage standard (still an if), sticking a version there seems to be what people expect, but that wasn't part of this request, just consistent with... basically the entire debian command line, it turns out? Ah: "dmesg --help" does not start with a package/version line. Nor does insmod --help, man, xxd, git... ok, maybe about 10% of the commands don't. And hg (mercurial) has a one line what-is-it before usage: but doesn't have a version in that. And parted --help says "mail bugs to thingy@gnu" at the end but has "usage:" as its first line...

I tried to check what my current debian system has, ala:

$ for i in $(apt list --installed | sed 's@/.*@@'); do dpkg-query -L $i; done 2>/dev/null | egrep '^/(bin|sbin|usr/bin|usr/sbin)/' | while read i; do echo -n "$i "; $i --help 2>&1 | head -n 1; done

Which ran until some horrible bluetooth gui tool ignored the --help and popped up a window, at which point the command line was frozen when I dismissed it (ignoring ctrl-c and ctrl-z), so I closed the tab. (This is why I carefully did NOT run it as root.)

August 16, 2020

Still under the weather. I asked a question on the mailing list and got referred to AT&T streams. Not immediately helpful, but yay community engagement.

I rebuilt the "make root" targets and they don't boot at all now because I added error checking but didn't implement ${a/b/c} support yet, so the script dies with "sh: i: /,*/}" which isn't a very good error message to be honest. (It's what I told it to produce, but it should probably be "sh: bad ${i/,*/}"...) Anyway, the easy fix is to finish adding support for that, but I hadn't yet because it uses wildcards and I'm halfway through doing those, but went down the "I can add case support, that should be easy" rabbit hole and the "a) blah;;" parsing of intentionally unmatched parentheses is not easy.

Well, I can sort of punt. The parser will essentially put ) at the start of a new line, but "case x in

a b c

) blah;;" is understandable. Bash doesn't currently accept it, but "toysh accepts input bash doesn't" isn't a deal breaker, it's "toysh does not accept input bash does" that's unacceptable. Similarly "abc|" gets broken into a new line/block by the pipe, but that's also ok? I can interate through the resulting chunks trying each wildcard... No I can't, +(abc|def) applies here too. Hmmm. Ah, wait, +() quotes it so | within that won't get broken the same way "abc|def" won't split. That means I have to _handle_ | in two places, but that's probably acceptable. (It's mostly just a for loop.)

The tagging is funky either way, when I break "if true; then echo; fi" into blocks the "if" is type 1, "true" is type 0, "then" is type 2, "echo" is type 0, and "fi" is type 3. This lets code traverse disabled blocks without caring about their contents ala "[ false ] && if..." and also has distinct start, gearshift, and end sections. (Gearshift is kind of "end test" although in for loops it's usually "end list"...)

But "case" has multiple gearshifts. The the initial "case x in" is sort of type 1 (which can have a newline between the x and the in because of course it can), and then each pattern|pattern|pattern) chunk is a "test" followed by a conditionally-run "body" section if the test matched, which ends in ;; (or ;& or a couple other variants). What I can do is make each "pattern" be type 2, and then the runnable section afterwards be type 0. The block skipping code in run_function() is only looking at types 0 and 1 anyway (where it jumps to pl->end->next for disabled blocks, so the contents don't matter), and we only execute enabled if (!pl->type) blocks. What I'd need to do is teach the gearshift (pl->type == 2) blocks about "case" so they know to jump to pl->end->next when we hit the next one (or fall through as appropriate), but they need new "test this pattern" plumbing for this anyway...

I also KINDA have a hack for the "$(case $x in; abc) echo hello;;)" which is if I see ) eventually followed by ;; I can back up and glue that ) onto the previous $( statement with one extra parentheses level. Which is HORRIBLE and probably won't work, and when do I ask for more input if I've hit end of line? It doesn't entirely solve it but it may let me limp along a bit further before ripping out and redoing the $() parsing plumbing to actually recursively traverse its contents which means storing the data in a different format and then having other functions that consume that data do something else... Blah, it's kinda horrendous. How/when do you FREE the nested function structures hanging off of a normal word? Whole new set of lifetime rules. Maybe I can have it parse but not KEEP the results? Grrr...

August 14, 2020

Microsoft Linkedin keeps telling me to congratulate people for not updating their profile for X years. (It thinks it's a work anniversary, but offers no evidence.)

Under the weather. Not getting a lot of programming done today. Poking at getty cleanup since that's reasonably low brain.

August 12, 2020

Maybe toybox needs a str_is(a, b) and str_isnt(a, b) to separately handle the "a && strcmp(a, b)" and "a && !strcmp(a, b)" cases. (I want to call the second str_aint() but that's the kind of sleep-deprived name I edit out again later.) The problem is in the first NULL a does not match b, and in the second NULL a matches b, and if "what does null a mean" changes you can't just ! the return result and call it good, you need two functions.

Jeff got a new binary from the minisniff guys, and they told him they used wxwidgets version 3.1.1 (of the modified "unofficial" codelite releases). So he needed a wxwidgets "unofficial" 3.1.1 for buster, and the 3.1.3 directory we'd been looking at (3.1.4 is in development so that's the newest release, but the directory includes older versions) only had 32 bit 3.1.1 binaries and we need 64 bit binaries.

So I looked in the earlier 3.1.1 directory which did indeed have a 64 bit version of the library we need... built for "stretch", which is debian 9.x and we need "buster" ala debian 10.x. (The debian wiki has a name to version translation table, with release dates.) I'd hoped the 3.1.2 directory between them might have what we needed, but no: that also only had 32-bit versions of 3.1.1 and only built 64 bit versions of the newer release. (Versions plural because there's "unofficial" and "unofficial3" versions of both... the first links against gtk2 and the second links against gtk3, we need gtk2 here.)

So we tried the "stretch" (debian 9) version of the 64 bit, gtk2, 3.11 library package and got a NEW error:

dev@dev-vm:~/work/bugblat/install/miniSniffer$ LD_LIBRARY_PATH=/home/dev/work/bugblat/2/usr/lib/x86_64-linux-gnu:/home/dev/work/bugblat/3/usr/lib/x86_64-linux-gnu ./minisniffer

Fatal Error: Mismatch between the program and library build versions detected. The library used 3.1.1 (wchar_t,compiler with C++ ABI 1002,wx containers,compatible with 3.0), and your program used 3.1.1 (wchar_t,compiler with C++ ABI 1011,wx containers,compatible with 3.0).

Aborted

Remember how I said combining C++ and shared libraries was fundamentally broken in multiple ways? The C++ ABI changes periodically because it's profoundly misdesigned and sort of writhes in pain as the standards commitee thrashes ineffectively to fix one thing while breaking another so they have to do it again a couple years later. It's like when you push down a fold of carpet that pops up somewhere else in the room because it doesn't fit. This is a perrenial surprise to C++ developers, and then they get stockholm syndrome about it.

So a program built by a compiler using the newer ABI can't use shared libraries built by a compiler using the older ABI, and it changed between Debian 9 (released in 2017) and Debian 10 (released in 2019). Because of course it did, this is C++.

In 2004 I did a contract at Dell supporting a project stuck on an ancient version of Red Hat Enterprise, which they'd already paid Red Hat an uncomfortable amount of money to support another year. The problem was a much earlier iteration of this same issue: all the functions exported in their shared library were declared "extern C {" but then they passed pointers to class instances as arguments. The C++ developers didn't understand how NOT to leak the full horror of symbol versioning, so they'd deployed an application with shared libraries that their customers built their own extensions which linked against those libraries. And now the only build environment they could update their app with had been end of lifed by the upstream vendor, and if they updated the shared libraries their customers had to rebuild all their own extensions which Dell had promised they would never have to do.

This was an unfixable problem that was still going on when I left at the end of 6 months, although the consensus was "pay another ungodly amount of money to Red Hat Enterprise for another one year service contract for RHEL 2, and THEN make customers upgrade their shared libraries" because clearly this is a one time thing that will never happen again. Clearly this was fallout from gcc 2.95 (I.E. the EGCS reunification where gcc development stalled and forked, and then the FSF handed over the name to the new development group on condition they set up a "steering committee" that could be politically hijacked)... and Dell management was confident that it would never happen again, and they faced a one-time problem rather than a chronic issue with C++.

Meanwhile, I can link against a 15 year old C shared library no problem, as long as it has the right symbol names and I disable the gnu/gnu/gnu/all/hail/stallman symbol versioning nonsense. (Linux switched from a.out to ELF in 1995, and switched from 32 bit to 64 bit in 2005, but has not actually changed HOW SYMBOL NAMES WORK even once since its creation in 1991.)

August 11, 2020

Google Fiber went down for a couple hours today, promptly at 1pm which is not "backhoe cut the line" but "somebody scheduled something that didn't work". Power cycling the router didn't fix it, and of course the website where you enter your address said "no problems reported in your area" without EVER PINGING THE ROUTER. (Guys, is you can't talk to the router then SERVICE IS DOWN. If your website can't do that automatically then you really realy SUCK AT THIS.)

I called the phone number, which gave me a recorded message about high call volumes, kept me on hold for 5 minutes, and then gave me some message I didn't really listen to (it was robot voice, not human) and hung up on me. And when I called back, I got a BUSY SIGNAL. Then when I called again, "your call cannot be completed as dialed". (No, my phone was not associated with the router, this was t-mobile. I'm guessing their call center is VOIP based and ALSO had something scheduled at 1pm, although it was half an hour later by this point.) The status website was still up, and still giving me a green checkmark half an hour after the service went down.

So I tried the interactive chat thing (which linked to a third party domain that had nothing to do with google and sounded like a scam, does Google really need to outsource this), which also had a wait queue, but eventually got (what I assume was) a human named Brian, who I once again gave the street address to and HE could confirm the service was down. And the website changed to notice! He said that was coincidence, although it really seems like I manually had to manually tell a human that my router was no longer pingable from Google's server because their website would not ping THEIR router. I am using a Google-supplied router that was throbbing red this entire time and their system couldn't figure out there was a problem. BRAVO!

So anyway, they were now aware of it, and we had phone tethers, and Fade said it was back up a couple hours later when I went to bed. I was awake for all this because my sleep schedule is terrible, it advances forward an hour per day if I left it, which means I'm now going to bed at 3pm and getting up after our ex-24-hour HEB closes; I am sad about coronavirus hours at HEB and suspect they're using it as a permanent excuse to just not be 24 hours anymore, since we're never going back to Boomer Normal. We are in Boomerdamarung and I strongly suspect there's a revolution between us and a new normal where solar+batteries provide electricity that literally is "too cheap to meter", raise property taxes on investment AND RENTAL properties at least 4x what "home I own and live in" gets charged (ala Austin's homestead exemption, bleed the slumlords dry, cheap condominiums are a thing it just means apartment you own rather than rent), acknowledge that Norman Borlaug's "green revolution" quadrupluing the world food supply combined with fertility rates declining below replacement rate in any country that educates women but does NOT provide basic income so You Must Have A Career And A Baby Will Permenantly Derail That... well, white people going extinct isn't the worst thing that could happen at this point, but the near term point is "food is not currently in short supply". A program to feed everyone Government Cheese and Ramen as a basic human right not to starve would be maybe the size of "the department of education".

So the home fiber connection going down was before I went to sleep. Now it's Late Night At UT (5 mile round trip according to my step counter, 12000 steps per day is pretty much all the exercise I'm getting), and now my cell phone internet tether is being stroppy. Some sites (like gmail) work fine and others are insanely slow or time out. I suspect the sprint/tmobile merger has brought a sudden end to tmobile's net neutrality from when they were owned by Germans and acted as if subject to EU law, and now places like github that haven't paid their "let us not block you" tax to the carrier are on their own. My phone can watch youtube videos at full speed normal resolution, but trying to get to MOST websites through the USB tether is sucking ice cream through a straw. That is not a signal issue, the one hop the signal deals with is doing video on the phone itself just fine. That seems like a late stage capitalism issue.

If you wonder why my working style involves downloading all my email to the local machine and NOT involving crap like github in the productive flow... I have multiple emails from Elliott where he closed a github issue with a comment and I can't load the link to the github thread to see the context for this new comment. I was trying to load the getty page off of man7.org to see if maybe getty.c should link to that as its standard and I can't load it. But google.com comes up instantly.

You can sing "cloud rot" to the tune of Love Shack. I don't want to depend on third party services, long-term all websites eventually go away in my experience. This is why I mirror stuff I care about, because even archive.org has a suicidal streak. (I assume that's a relevant link, google.com loads instantly and arstechnica.com times out. Wheee.)

Darn it, HEB decided to consolidate its "V8 Energy" from 2 shelves to 1 shelf, meaning it clearanced one of the caffeine cylinder flavors I like (the cherry, which is also Fuzzy's favorite, sold out before I got there) and is out of stock on the other because they filled the blueberry/pomegranite slot with overflow mango/peach. (Flavors that are theoretically good juices don't necessarily hide the bitter caffeine taste; strawberry/banana was particularly disappointing in that regard.) It's not hard to get more but I'd much rather give my money to a well-run local business that treats its employees well than the richest billionaire in the world who treats employees terribly and is who's doing everything he can it can to prevent unionization until his company can replace them with robots. (I don't just want Amazon broken up, I want Jeff Bezos personally broken up. Guillotine the billionaires. Remaining a billionaire is a choice, you can always stop being one as his own ex-wife is demonstrating. She's aiming for maximum impact so it's taking a while, but her stated goal is to give "until the vault is empty" and she's giving multiple billions per year to good causes with no strings attached. I.E. here is large pile of money to do what you think is best without micromanagement. I have no qualms with her.)

August 10, 2020

The strangest "google for a thing I did and hit a WEIRD page mentioning me" today was because malware people used my old aboriginal linux arm toolchains and thus build paths of my old work directories leaked into their binaries somehow, and then those paths were used as an example virus signature in a patent application a chinese guy made in california (as with most modern patents, about doing obvious things that shouldn't be patentable).

Spent most of today catching up on email and editing almost a month of accumulated back blog entries I hadn't posted yet. Reading USB stuff, but not programming.

August 9, 2020

Time magazine interviewed Portland medical personnel on how they're being targeted by police at protests, the video is 7 minutes 18 seconds. This is our generation's vietnam. The superhero origin story of an army of activists.

There was also a very informative thread about how the USA has no self-made billionaires, just a lot of spin doctors sprinkling "public relations" over billionaires' backstories. (Due to the way twitter collapses threads and makes you hunt for tiny expand links easily lost in the noise, it may be easier to start from the end and scroll up.)

August 8, 2020

Ooh, the Lumper potato is back. As with the Gros Michel banana: limited availability, but it's good to know it's not extinct. (Modulo the whole bit about potatoes not really breeding true via seed, but it's nowhere near as bad as it is with apples, so...)

Today I wound up almost linking a guy on github to papers on the dunning-kruger effect, at which point I backed off and stopped replying. I believe the start of the reply I deleted did accurately summarize his current position:

So you're escalating from saying the self-selected set of users interacting with the android command line (not the GUI) regularly won't know how to google for a project page (and that Google going away so the internet is no longer searchable is an important consideration), but now you add that they won't know where the non-AOSP OS image they're using came from, and you believe this to be a common enough problem you're suggesting we add a required manual setup step in the build process and impose it as an external constraint upon fortune 500 corporations to identify the vendor in toybox specifically (not in the larger OS image).

But... I wasn't HELPING. I am not the best open source maintainer because I'm not polite enough. I'm aware that sometimes I just shouldn't engage. But the difference between educating someone (or at least trying to) about the Layers Of Wrong in their position (and the iceberg of backstory/context/politics) so that they can learn and do better, vs getting into an argument with someone who Needs To Be Right and Must Have The Last Word... sometimes what I need to do is LET THEM. They'll be happier if they can go and be wrong somewhere else. And I'm not always good at spotting the cutoff, it's a heck of a grey area.

(The best summary of the differences between the american Hitchhiker's Guide movie and the BBC miniseries is comparing that last link with its equivalent. British comedy needs british delivery, or you get into "american red dwarf" territory. Tangent, can of worms.)

I dunno how much of the "helpful vs non-helpful" cutoff is somebody just feels backed into a corner by repeated "no, because..." and thinks I'm trying to insult them or challenge their self-worth or something. This implies I handled the situation wrong, but as I said, "I'm not the best at this". Sitting in front of a computer teaching it to do tricks was the alternative I chose to embarassing interactions with other human beings (most of whom I didn't like) level grinding social skills. My parents moved from Kwajalein to New Jersey when I was 10, which involved a bit of culsture shock on my part. My plans to go away to college out of state got derailed by their divorce (and me leaving high school early to go to community college because I couldn't stand to stay another year), and I went to the state college at in-state rates living with my mother and didn't move out on my own until I was 23. Add in about 15 years of depression in there and I didn't do a wide range of socializing, and yes have somewhat of a deficit here. It took me until about 30 to establish basic social competence interacting with people I _know_. "You want to engage in science/technical/academic mode? Great, here's an infodump! Ah, no you didn't really want that, you really wanted someone to navigate your emotional state, on our first encounter when I don't know you, and the infodump's gotten us into a bad place."

Speaking of Dunning-Kruger, it's NOT about being stupid, it's about being ignorant. Ignorance is not stupidity. Everybody starts ignorant and it's something you need to humbly work through. (The humility part helps, without it you get colonialism and white savior complex.) This is the most frustrating part about the best summary of dunning kruger I've seen: you have to skip the first 19 seconds of him talking about "stupid" and the title of the video using the word "stupid". But Dunning-Kruger was never about stupid. It's a call for humility, and a reminder that the ignorant newbie revolutionizing the field is like lottery winners: yes it happens but it's not the common case. Beginner's Mind is lovely, and it's also a thing you can cultivate. (See also the importance of play in creativity.)

I have advanced far enough in human emotional interaction to now know how BAD I am at it. To be aware I utterly suck at it, by my standards. Not the "you didn't react properly, what's wrong with you" of days long ago (when I blamed "everyone around me is broken" on being in New Jersey, still not sure I was wrong there), and not the hopeless incomprehension of the vast majority of humanity of my 20's, or the domain-specific "I know how to play a role: I am Consultant, I am Teaching a Class, I am Organizing a Convention..." of my 30's. Now I've reached a sort of resigned "I'm sure there was a way to salvage this interaction, but I'm clearly not up to it, I wonder if there's somebody I should delegate this sort of thing to" where I want to... post warning signs? I KNOW I'm doing it wrong, as I'm doing it, but my choices are generally Not Doing It (which generally means nobody does it so it doesn't get done) and trying to see it through best I can.

Until it's time to disengage, usually too late, because I'm Not Helping. Oh well, back to programming. That part, I understand.