Jeff Duntemann's Contrapositive Diary Rotating Header Image

None Of The Above

Anything that doesn’t fit into existing categories

More Things That Are Slowly Vanishing (Or Gone)

Back in January I published a list of things that had once been common and are now fading into the mists of history. It got a lot of attention, so here comes another one. A few of these came from readers and posted in the comments.

  1. Typewriters. Ok, these may already be well and truly vanished, but there are times when I miss them. I kept my IBM Selectric until we left Arizona in 2003. Mostly I used it to type up adhesive labels and addresses on business envelopes. All of that stuff comes out of my laser printer now.
  2. Wing-tip dress shoes for men. I admit, I never had these myself, but I was still seeing them here and there until ten or fifteen years ago.
  3. Pantyhose. Apart from older women who may have been wearing compression stockings, I almost never see sheer hosiery anymore. Weirdly, the last place I saw it regularly was at dog shows, where male handlers wore business suits and female handlers wore skirts and pantyhose. This was true well into the teens, but we haven’t been to a dog show in some years now.
  4. Car keys. Our 2014 Durango was our first car with fobs instead of keys. All the rental cars I’ve driven since then were the same thing: Key fobs without keys. It took some getting used to, but now when I try to drive Carol’s 2001 4Runner, I almost always try punching the (nonexistant) button on the dashboard rather than twisting the (real) car key.
  5. Women wearing hats in (Catholic) church. Back when I was a kid this was a very serious business. I saw teen girls wearing a sheet of Kleenex atop their heads during mass when they forgot their hats. Girls at our Catholic grade school had beanies to wear during mass before school started.
  6. Paper routes. I delivered papers for a little while when I was 13 or so. It was a weird little paper that was ad-supported, but I was asked to ring doorbells and see if people would pay for it. Almost no one did, and it was enough of an embarrassment that I stopped after just a couple of months. (Thanks to Rick Kaumeier for this one.)
  7. Penny (or nickel) toddler rides in supermarkets. Usually by the front windows, usually a horse, though I’ve seen ones where the ride is a stubby little airplane or even a cowbow-style covered wagon. (Again, from Rick Kaumeier.)
  8. Card parties. (Yet again, from Rick Kaumeier.) My father had these now and then with his gang from work. They all smoked so much that the air was mostly unbreatheable on the first floor of our house. My mom slept upstairs with my sister and there were a lot of open windows for a couple of days.
  9. Ash trays. These used to be almost everywhere, because when I was a kid almost everyone smoked. There were even ash trays in my college classrooms, and a few students smoked. (Tthankfully, only a few.) (Thanks to Jim Tubman for this one, which should have been obvious to me.)
  10. Cigars. The last time I saw anyone smoking a cigar it was a couple of people in my writers group in Colorado Springs, circa 2014. Tobacco kills. (It killed my father.) I think maybe we’re finally catching on.
  11. Mercury blood-pressure cuffs. And, for that matter, needle -gauge blood pressure cuffs. It’s all electronic now.
  12. White-wall car tires. I had totally forgotten about these, which were in decline even in the 1950s. (Thanks to reader TRX for the reminder.) It makes me wonder what people who restore classic cars do for white-walls.
  13. Newspaper vending machines. (Thanks to Rich Rostrom.) Not only the machines, but the papers themselves are getting scarce. Now I only see them at the customer service counter in supermarkets.
  14. Neighborhood mailboxes. (Again, thanks to Rich Rostrom.) We had one at the corner of our street, near Edison grade school. Now you only see them in high-traffic areas like in front of supermarkets.
  15. Balsa-wood model airplanes. (Thanks to Spencer Arnold.) We used to get balsa gliders for a quarter at Bud’s Hardware Store in the Sixties, and you could get a balsa plane with a prop and a rubber-band “engine” for 50c. My father built a lot of balsa planes when he was kid, and built a few when I was in grade school. These may still exist, but see the next item:
  16. Hobby shops. There was always one within reasonable biking distance when I was a kid. There was still one in Colorado Springs circa 2012, but that was the last time I saw one. They varied in emphasis; some sold stamp albums and sometimes stamps, others did not. Most sold model airplanes, and the .049 engines that I couldn’t afford. Craft stores absorbed some of that business. The bigger Ace Hardware stores still have small brass & aluminum sheet and tubing. Beyond that, most of the business has moved online.
  17. Reel-type power mowers. These were just like hand-pushed lawnmowers, but they had engines. My grandfather Harry Duntemann had one. Once the rotaries came in around the early 60s, the reel models quickly slipped away. My uncle gave me a rattle-trappy old one about 1966 and my friends and I made a bizarre go kart out of it.
  18. AM radio. (Thanks to Tom Byers.) As a teen in Chicago I listened to AM a lot, especially WLS and WCFL, the rock stations in their time. As rock got harder, I listened more to WIND, which played a gentler kind of music that I preferred. Of course, once I had an FM radio (college) I dropped AM and never looked back.
  19. DJ chatter. DJs were celebrities when I was a kid. They’re now an endangered species, especially those who did a sort of fast standup comedy between songs and commercials. Radio is heavily automated these days, and most announcements are prerecorded. Weather and traffic reports are mostly gone as well.
  20. Cable TV. (Thanks to Bill Beggs.) We still have cable, but internet-only. People are moving their TV viewing to streaming sites in droves. Carol and I don’t watch a lot of TV, with a smidge off the air, and rest from streaming sites.

There are a couple of things that I thought had vanished that are coming back. Whether this is a good thing or not is an open question:

  1. Bell-bottom pants. Yes, they’re coming back. I’m of seventeen minds about this.
  2. Big glasses. And I mean big, mid-late ‘80s big. I had those, and used to joke that my cheeks had 20-20 vision.
  3. Vinyl records. (Thanks to Don Doerres & Rich Rostrom.) The reasons I dumped vinyl were pragmatic: CDs did not wear out and you didn’t have to turn them over. Now Wal-Mart and Target have racks of vinyl. Wow.

There may be more, but 20 is a good round number. Maybe we’ll come up with enough to do a third installment.

Odd Lots

J and C - 5-27-2023

  • Our longtime friend David Stafford stopped in for an evening on 5/27, and we took him to Tutti Santi restaurant at 64th & Greenway. It’s one of our favorite eateries here, high-end Italian, and we ate on the patio. David took some photos, which turned out pretty well, as you can see above.
  • Could the ancient Greeks see the color blue? This is evidently a massive, long-term fistfight in certain circles, as ridiculous as it sounds. Mostly, the best guess is that the Greeks didn’t have a word specifically for blue tints. Matt Iglesias posted the best discussion I’ve found. It’s apparently more about linguistics than color vision.
  • I’ve posted some of my weird experiences dealing with modern AI here. AI images often have the wrong number of fingers or toes, and sometimes bizarre body proportions. Now an AI has created an entirely fictional governor of South Dakota, whose term in office was 1949-1951…in its imagination, or whateverthehell creates AI weirdness like this.
  • Carol and I have three Intel NUC computers, which are both small and quiet and yet still manage to do pretty much anything we do in terms of computing. (We are not gamers.) I’m not entirely sure why, but you can now buy a lid for a NUC machine that is a Lego base plate. I gave what Lego I had to our nieces years ago, or I’d be sorely tempted.
  • I’m a sucker for robots, so an article stack-ranking the top 100 movie robots was a must-read, even though my all-time favorite film robot, Kronos, only made it to #57. (I do agree with the very high quality of #1, which may be my second favorite movie robot.) Some of the robots are very old and/or very obscure; I think there were fifteen or so that I’d never heard of and another four or five that I’d simply forgotten.
  • A study published in the Lancet shows that natural immunity to COVID19 is equal to and often greater than what the supposed vaccines offer. The paper is a real slog if you’re not a researcher, hence the link to City Journal‘s overview.
  • And another City Journal piece I enjoyed, about Rod Serling and some of his struggles during the rise of television as the premier form of American entertainment.
  • A cow got loose in Carol’s thoroughly suburban hometown of Niles, Illinois (just north of Chicago) and CBS News described the results as “Udder chaos.” Points for that one, guys.
  • Some lunatic stole two million dimes from the US Mint in Philadelphia. That’s not as much money as it sounds like (do the math) but the bigger problem is how to spend it. Unless you’re getting a burger and fries at McDonald’s, paying for things by the pound (of coins) will attract a great deal of unwanted attention.

STORMY Vs. the AI Doom Kvetchers

I follow the AI discussion to some extent (as time permits, which it hasn’t lately) and from initial amusement it’s pivoted to apprehension and doom-kvetching, as if we didn’t get a bellyful of doom-kvetching as COVID passed through. The AIs I’ve played with have had peculiar failure modes, among them expressing that 128-bit registers are larger than 512-bit registers. Numbers aren’t their forte, even down at level of counting on their fingers, since AI image generators don’t have any clear idea how many fingers a hand is supposed to have. (More on that topic here.)

I get the impression that our current generation of AIs have their own way of proposing solutions to problems. What seems obvious to them isn’t always obvious to us. The danger, if there is any, lies in giving them more responsibility than something that can’t count fingers or toes should rightfully have.

Which brings us to an SF flash story that I wrote in 1990 and published in my magazine PC Techniques about that time. Most of my regular readers are familiar with “STORMY Vs. the Tornadoes.” It was designed as a humor piece, and a satire on the concept of AI as it was imagined thirty years ago. A few days ago I realized that I had, in a sense, predicted the future: That AIs will do ridiculous things because those ridiculous things make sense to the AIs. STORMY, a National Weather Service AI, was asked how we might reduce American tornado fatalities.

And STORMY took the question very seriously.

Here’s the whole story, for those who haven’t seen it, or haven’t read it in a long time.


STORMY Vs. the Tornadoes

By Jeff Duntemann

“Mr. Petter, in the last six months, that computer program of yours cut Federal government purchase orders for 18,000 ‘uninhabitable manufactured housing units,’ to a total of 21 million dollars.” Senator Orenby Ruesome (R., Oklahoma) sent the traitor Xerox copies skittering over the Formica tabletop.

U.S. Weather Service Programmer Grade 12 Anthony Petter winced. “Umm…you gave us the money, Senator.”

“But not for rotted-out house trailers!”

Petter sucked in his breath. “You gave us 25 million dollars to create a system capable of cutting annual US tornado fatalities in half. We spent a year teaching STORMY everything we knew about tornadoes. Every statistic, every news item, every paper ever published on the subject we fed him, and we gave him the power to set up his own PERT charts and plan his own project. Umm…I preauthorized him to cut purchase orders for items under $2000.”

“Which he did. 18,000 times. For beat-up, rotted-out, abandoned house trailers. Which he then delivered to an abandoned military base in west Nebraska a zillion miles from nowhere. And why, pray tell?”

Petter keyed in the question on the wireless terminal he had brought from his office. STORMY’s answer was immediate:

TO KEEP TORNADOES FROM KILLING PEOPLE.

Petter turned the portable terminal around so that the Senator could see it. A long pause ensued.

Ruesome puffed out his red cheeks. “Mr. Petter, be at my office at 8:00 sharp tomorrow. We’re going to Nebraska.”

The two men climbed out of the Jeep onto scrubby grass. It was July-muggy, and it smelled like rain. Petter gripped his palmheld cellular remote terminal in one hand, and that hand was shaking.

Before them on the plain lay an enormous squat pyramid nine layers high, built entirely of discolored white and pastel boxes made out of corrugated aluminum and stick pine, some with wheels, most without. The four-paned windows looked disturbingly like crossed-out cartoon eyes. Petter counted trailers around the rim of the pyramid, and a quick mental estimate indicated that they were all in there, all 18,000 of them.

A cold wind was blowing in from the southeast.

“Well, here’s the trailers. Ask your software expert what made him think stacking old trailers in the butt end of nowhere would save lives.”

Lightning flashed in the north. The sky was darkening; a storm was definitely coming in. Petter propped the wireless terminal on the Jeep’s fender and dutifully keyed in the question. The cellular link to STORMY in Washington was marginal, but it held:

TORNADOES ALWAYS SEEM TO STRIKE PLACES WHERE THERE ARE LOTS OF MOBILE HOMES.

Petter read the answer for the Senator. Ruesome groaned and kicked the Jeep hard with his pointed alligator boot. “Goldurn it, son, you call this ‘artificial intelligence?’ That silly damfool program bought up all the cheap trailers it could find and stacked them in Nebraska to get them away from tornadoes in the midwest. Makes sense, right? To a program, right? Save people who don’t live in empty trailers, right?”

The force of the wind abruptly doubled. Lightning flashed all around them, and huge thunderheads were rolling in from all points of the compass. Petter could hear the wind howling through cavities between the trailers.

“I’m sorry, Senator!” Petter shouted over the wind.

But Ruesome wasn’t listening. He was looking to the west, where a steel-grey tentacle had descended from the sky, twisting and twitching until it touched the ground. Petter looked south—and saw two more funnel clouds appear like twins to stab at the earth.

The programmer spun around. On every side, tornadoes were appearing amidst the roiling clouds, first five, then a dozen, and suddenly too many to count, all heading in defiance of the wind right toward them. The noise was deafening—and Petter could now feel through the soles of his feet that unmistakable freight-train rumble of the killer twisters.

Petter had felt all along that he had never quite asked STORMY the right question. Now, suddenly, the question was plain, and he hammered it into the terminal with shaking fingers:

STORMY: FOR WHAT PURPOSE DID YOU BUY ALL THESE TRAILERS?

The answer came back as a single word:

BAIT.

The winds were blowing him to the ground. Petter dropped the terminal and grabbed the Senator by the arm, pulling him toward a nearby culvert where the road crossed a dry creekbed. He shoved the obese man into one three-foot drainpipe, then threw himself into the other.

A moment later, the tornadoes converged on the trailers, all at once. The sound was terrifying. Petter fainted.

Both men lived. Local legend holds that it rained corrugated aluminum in Nebraska for several weeks.

And it was years before another tornado was seen anywhere in the USA.

Odd Lots

The End of the Bluecheck Blues

Yesterday was the end of the line for the Twitter bluecheck. You can still get one, but you’ll have to pay for it. And anybody who has a bluecheck but won’t pay for it will lose it, as of (ostensibly) today. If you can pay for it, you can get it. (I believe you only have to prove your identity.) It will cost you eight bucks a month. What’s that? Two lattes at Starbucks? Cheap! But as it happens, paying for it isn’t the point.

Duhhhh.

There are a couple of problems with the pre-Musk bluecheck. It was free, but bestowed only upon those judged worthy, via a process completely opaque outside of being politically slanted. This led to a noxious side effect: It created a sort of online aristocracy with a built-in echo chamber that dominated the whole platform.

Elites are always a problem, because they consider themselves above the condition of ordinary people and not bound by ordinary people’s limitations. On Twitter, they’re mostly just stuffed shirts who lucked into Harvard and scored a job in a newspaper somewhere. (Or just happen to be celebrities famous mostly for being famous.)

Much bluecheck dudgeon has been hurled around about having to pay for what was once free, or (way worse!) knowing that any prole with 8 bucks to spare can have the same badge. The connotation of the badge changed, from “I‘m a demigod” to “I support the new Twitter.” OMG! NO WAY! I’M LEAVING!

The big question now, of course, is whether the malcontents will actually leave the platform. We all know how many people threatened to quit Twitter when Musk bought it. The Atlantic has an interesting article on the phenomenon. (Nominally paywalled, but they will give you a couple of free articles.) I’ve posted here about the supposed mass migration from Twitter to Mastodon. Mastodon grew hugely after the beginning of the Musk era, to the annoyance of a lot of long-time Mastodoners. The open question is how thoroughly the emigrants burned their bridges as they went.

This month we may finally find out.

Flashback: Delores Ostruska 1924-2013

Carol’s mom left us ten years ago today. I miss her; she accepted me into her family quickly and the warmth I felt in her presence never faded as long as she lived. I wrote an entry in her memory on February 4th, 2013, which I will republish here verbatim, to remind myself and all of us how truly good people affect everyone and everything around them for the better.


Carol’s mom has left us. She died quietly this past Saturday after a long illness, at a nursing facility near her Crystal Lake, Illinois home. Her daughter Kathy was by her bedside, and her two grandsons Brian and Matthew had visited her earlier that day. She was 88.

Most people in our time are lucky to have two loving parents. Somehow, incredibly, I had four. I met Delores on August 2, 1969, when I came by their house to pick up Carol for our first date. I was 17, a little scruffy, and undoubtedly, well, odd. No matter. Delores smiled and welcomed me, a welcome that never faded. Carol’s dad was a slightly harder sell, but I won his esteem by treating his daughter with respect and kindness. When I bought a lathe in 1977 he stabled it in his basement, and over time he taught me what he knew about its use, which (considering that he could grind a carbide die to a ten thousandth of an inch accuracy) was pretty much everything.

On many Sundays Delores prepared family dinners for which her sisters Marie and Bernice and her Aunt Marie and Uncle John drove up from the South Side. Pork roast, salad, vegetables, bread, dessert; a huge spread brought to the table hot and perfect in all ways. I had a place at that table, as later on Kathy’s boyfriend/fiance/husband Bob did as well. It was decades before I knew the term for the feeling that hovered all about us in Delores’ dining room, but when I found it, many things fell into place. It was unconditional love.

I had had that from my own parents, of course. And even my own father was a bit of a hard sell, since I bore little resemblance to the rowdy boy that he himself had been and expected his own son to be. All the more remarkable that Delores and Steve embraced me almost immediately as one of their own.

Delores was a child of Polish-American heritage, youngest daughter of a large family, who was born and grew up on the Near South Side of Chicago. She belonged to a group of very close teen girlfriends who called themselves The Comets. They were capable and confident girls, journeying around the city for fun, and even slept on the sand of Chicago’s 31st Street Beach. She quietly rejected the dour Polish pessimism of her own parish church, and far preferred the exuberant Catholic culture of an Irish parish a few blocks away. She believed all her life in an infinitely loving God and the goodness of all His creation. When I began struggling with my own life of faith at the dawn of middle age, it was her example that helped bring me to the unbounded and unshakable Catholic optimism that I hold today.

Delores worked at the US Treasury in downtown Chicago, where she helped trace lost and stolen US Savings Bonds. During WWII she met and in 1947 married Steve Ostruska, one of her brother Charlie’s Navy shipmates. After Carol was born the family moved to Niles, Illinois, where Delores lived for over forty years before moving in with her daughter Kathy in Crystal Lake.

Every summer while the girls were small the family vacationed along the lakes near Hayward, Wisconsin, where Steve fished for walleye and city girl Delores learned to love the outdoors. The photo at the head of this entry is from a vacation that she and Steve took to Clam Lake in July 1948. It’s not fair to picture her as an elderly woman when she has already broken the bonds of this Earth and risen triumphantly into the arms of the God she so strongly believed in. I prefer to recall her as the beautiful, vigorous person she was most of her life. In truth, all the time I knew her she glowed wth the quiet, invincible light of unconditional love, and if there’s anything closer than that to the ineffable light of God, I don’t expect to see it in this world.

Excerpted from Old Catholics: Christmas Eve II

I have about 38,000 words down on a (mostly) mainstream novel about a tiny Old Catholic community in Chicago, which has a 1920s bungalow with an altar and a few pews in the livingroom, with the clergy (a bishop and a deacon) living in two small rooms on the second floor. A good part of what I have down takes place just before and on Christmas. I’ve published excerpts here before on Christmas Eve. I don’t entirely know how the rest of the story goes. I don’t know if I’ll ever finish it. But people have told me they’ve enjoyed the excerpts. So today on Christmas Eve, let us return to the Church of St. James & St. Julian of Norwich, just south of Devon Avenue at Campbell. The chapter posted on Christmas Eve 2018 comes immediately before this year’s chapter, so if you’ve never seen any of the story before, you might skim through them before reading further. There are mild fantastic elements in the story, especially a little old Polish lady who can read hearts and predict the future–and talk to dead people whom she considers saints. It’s a gentle, hopeful story about eccentric religious people who have no place in the larger Catholic world, banding together to worship God and heal one another of life’s inevitable traumas. Let me know what you think.


Bishop Hughes led them from the kitchen to a small round table standing a few feet in front of the bungalow-church’s front windows. The advent wreath Rob had seen on the Formica kitchen table on Gaudete Sunday was set on the table. All of the candles had seen some use, now that all four Sundays of Advent had passed. Rob remembered the ritual from his childhood: Family members took turns throughout Advent lighting the appropriate candle and reading the prayer before the evening meal. On Christmas Eve, the head of the household had candle duty. So it was that Bishop Hughes struck a wooden match on the side of its box and held it in his left hand while raising his right in blessing:

“In the name of the Father, and of the Son, and of the Holy Spirit, we gather for one final meal before the birth of our Messiah, the Lord God Jesus Christ!” Bishop Hughes reached out with the match and lit the shortest purple candle, then the one beside it, then the pink candle of Gaudete Sunday, and finally the tallest purple candle. He held out his hands to Mrs. Przybysz and Mother Sherry, who took them and in turn reached out to take hands with the others to complete the circle.

Bishop Hughes tipped his head back, and spoke the prayer as he spoke nearly everything, with force and exultation:

“O Lord, stir up Thy might, we pray Thee, and come!
Rescue us through Thy great
strength so that salvation,
Which has been hindered by our sins,
May be hastened by the grace
of Thy gentle mercy.
Who livest and reignest for ever and ever! Amen!”

“Amen!” they replied in unison. Bishop Hughes turned and gestured toward the table. Eight places had been set, and atop each china plate was a folded card bearing one of their names-all but the setting at the foot of the table. It bore no card. As only seven people had gathered at St. JJ’s, Rob did wonder why the eighth place had been set at what was already a crowded table. He bent down to peek under the table, wondering if a card had fallen to the floor during the continuous bustle leading up to the Wigilia meal.

Bishop Hughes noticed Rob’s search for the card. “The place at the foot of the table is symbolic of those who share our love for God but who cannot be here with us in the flesh. Our departed, now in the bosom of the Most High; loved ones distant in space and time; the stranger who has no place at any table-“

“And saints,” Mrs. Przybysz interrupted as she bent to place a bowl of cucumber salad and a smaller bowl of horseradish on the table. “St. Ernie and St. Mona both showed up last year. Ernie warned me of evil brewing somewhere and had to leave to go look for it. Mona said we would need a much bigger table soon–and that the fish could have spent another few minutes in the pan.” The old woman sighed. “I do my best.”

“We all do our best,” Bishop Hughes said from behind her, smiling. “God asks no more of us than that. The challenge is to discover the inner strength that few of us realize that God has given us.”

Bishop Hughes pulled Mrs. Przybysz’s chair back. The old woman sat. Rob reflected that it was a signal. He pulled out Suzy’s chair, and helped her scoot in once she was settled. PJ pulled out Mother Sherry’s chair and did the same. Deacon Dan sat, and made a down-patting motion at Rob, who sat beside Suzy. PJ took the last seat, and set his battered leather briefcase on the floor beside him. He looked spooked, and kept glancing at the empty chair at the far end of the table.

PJ sat across from Suzy. Suzy took a library card and a pen from a pocket and wrote quickly in her lap. She poked Rob and handed him the card.

I feel something weird, she wrote. Rob made just a hint of a nod and handed it back. His first impulse was to grin. But…huh? An odd prickly feeling arose in the back of his head behind his ears, like something approaching–or something that was already among them, gathering power.

Rob shivered. He had told himself a thousand times that he did not believe in demonic forces. Whatever he felt did not feel evil. It felt powerful, not angelic but somehow rooted in the Earth beneath their feet. Hell was at the center of Earth, according to Dante and probably half of Christian humanity. Rob tried to focus, desperate to get away from the impression that something malign was creeping up on him.

Then, deep in his mind, a single word, stated quietly but with the conviction of everything high and holy, resolving Rob’s confusion plainly and beyond all question:

“No.”

A libc Mystery…Solved

We have solved the mystery described in yesterday’s entry…

…mostly. I’ve found down the years that inside any big mystery are likely one or more smaller mysteries. And so it is. I would have figured this problem out a whole lot sooner if the symptoms had been consistent.

They weren’t. And those symptoms made me nuts for several days. Eventually I decided to yell for help.

I got a lot of very good help. If you haven’t read yesterday’s entry (and if you’re actually interested in assembly language programming) go read it now. I won’t repeat all the details here.

In short: I wrote a small demo program for my new book, x64 Assembly Language Step By Step. It didn’t work. Several of my readers took the code I posted in yesterday’s entry, built the executable, and…it worked.

That’s what made me nuts. I ran the damned thing on three different Linux instances, and the problem manifested on all three of them. But a couple of my friends ran the executable and had no trouble at all. It worked perfectly.

WTF?

That’s actually the small mystery inside the big mystery. The big mystery we figured out fairly quickly. Bruce, a new Contra commenter, built the executable and it failed. He changed one line in the program, and it worked. I tried his fix. It worked. Mystery solved.

But…why? Bruce cleared register RDI to null (i.e., 0) before calling the libc time function. I had cleared RAX, as part of an earlier test to try and pin down the symptoms. I intended to remove that line from the program. But it gave Bruce an idea: clear RDI instead. He did. It worked. I tried it, and…victory! Clearing RDI to 0 completely eliminated the problem, and I spent another hour trying various things to crash the executable. No luck. It was a consistent fix, in that once I cleared RDI to 0, nothing else would make the executable malfunction.

I think it started to dawn on several of us at once. Supposedly, the time function doesn’t take any parameters. Or so I supposed, based on my reading. But that was wrong. The Linux time function takes one (understated) parameter: The parameter can either be 0, or it can be an address. If it’s an address, time will put the current time_t timestamp value at that address. If it’s 0, time will return the time_t value in RAX.

In stepping through the demo program’s execution in a debugger, I noticed that after a call to the puts function, register RDI would contain a memory address. It wasn’t always the same, and it wasn’t generally useful, So un-useful, in fact, that the garbage addresses being left in RDI would cause either a hang or a segmentation fault. In the x64 calling convention, the first parameter is always passed to a function in RDI. I didn’t think of time as having any parameters at all, but clearing RDI to 0 before calling time guaranteed that time would place the time_t value safely in register RAX…instead of crashing.

So the big mystery was solved. I spent an hour and a half trying to get the program to crash. As long as RDI was 0 when time was called, it did not crash. Halleluia! The big mystery was solved.

The small mystery remained: Why did some of my readers built the executable and have it work perfectly, while the exact same program on my Linux machines went belly-up? That remains an open service ticket. I’m mildly curious, but as long as I know that RDI has to be either 0 (preferably) or the address of a suitable buffer to hold the time_t value, all will be well.

Let me wrap up by abundantly thanking everyone who took part in the bug hunt:

  • My friend and SFF collaborator Jim Strickland
  • Linux expert Bill Buhler
  • New commenter Bruce
  • Long-time reader Jason Bucata
  • X64 programming expert Jonathan O’Neal
  • Contra regular Keith

You guys were brilliant. I will cite you all on the Acknowlegements page in the book, when it comes up (with some luck) next summer.

Again, thanks. In a weird but satifying way, it was fun. Now I have to get back to work.

A libc Mystery

As most of you know by now, I’m hard at work on the x64 edition of my assembly book, to be called X64 Assembly Language Step By Step. I’m working on the chapter where I discuss calling functions in libc from assembly language. The 2009 edition of the book was pure 32-bit x86. Parameters were passed to libc functions mostly by pushing them on the stack, which required cleaning up the stack after each call, etc.

Calling conventions in x64 are radically different. The first six parameters to any function are passed in registers. (More than six and you have to start pushing them on the stack.) The first parameter goes in RDI, the second in RSI, the third in RDX, and so on. When a function returns a single value, that value is passed back in RAX. This allows a lot more to be done without fooling with the stack.

Below is a short example program that makes four calls to libc functions: Two calls to puts(), a call to time, and a call to ctime. Here’s the makefile for the program:

showtime: showtime.o
        gcc showtime.o -o showtime -no-pie
showtime.o: showtime.asm 
        nasm -f elf64 -g -F dwarf showtime.asm -l showtime.lst

I’ve used this makefile for other example programs that call libc functions, and they all work. So take a look:

section .data
        timemsg db    "The timestamp is: ",0
        timebuf db    28,0   ; not useed yet
        time1   dq    0      ; time_t stored here.

section .bss

section .text

extern  time
extern  ctime
extern  puts
global  main

main:
        push rbp            ; Prolog    
        mov rbp,rsp

        mov rdi,timemsg     ; Put address of message in rdi
        call puts           ; call libc function puts
               
        xor rax,rax         ; Zero rax
        call time           ; time returns time_t value in rax        
        mov [time1],rax     ; Save time_t value to var time1
        
        mov rdi,time1       ; Copy pointer to time_t value to rdi
        call ctime          ; Returns ptr to the date string in rax

        mov rdi,rax         ; Copy pointer to string into rdi
        call puts           ; Print ctime's output string
        
        mov rsp,rbp         ; Epilog
        pop rbp
        
        ret                 ; Return from main()

Not much to it. There are four sections, not counting the prolog and epilog: The program prints an intro message using puts, then fetches the current time in time_t format, then uses ctime to convert the time_t value to the canonical human-readable format, and finally displays the date string. All done.

So what’s the problem? When the program hits the second puts call, it hangs, and I have to hit ctrl-z to break out of it. That’s peculiar enough, given how many times I’ve successfully used puts, time, and ctime in short examples.

The program assembles and links without problems, using the makefile shown above the program itself. I’ve traced it in a debugger, and all the parameters passed into the functions and their return values are as they should be. Even in a debugger, when the code calls the second instance of puts, it hangs.

Ok. Now here’s the really weird part: If you comment out one of the two puts calls (it doesn’t matter which one) the program doesn’t hang. One of the lines of text isn’t displayed but the calls to time and ctime work normally.

I’ve googled the crap out of this problem and haven’t come up with anything useful. My guess is that there’s some stack shenanigans somewhere, but all the register values look fine in the debugger, and the pointer passed back in rax by ctime does indeed point to the canonical null-terminated text string. The prolog creates the stack frame, and the epilog destroys it. My code doesn’t push anything between the prolog and epilog. All it does is make four calls into libc. It can successfully make three calls into libc…but not four.

Do you have to clean up the stack somehow after a plain vanilla x64 call into libc? That seems unlikely. And if so, why doesn’t the problem happen when the other three calls take place?

Hello, wall. Anybody got any suggestions?

Monthwander

SpaceX With Crescent Moon-500 wide.jpg

Last night, when I took the dogs out at about 6:20 PM, I looked toward the crescent moon and immediately saw the unmistakable trace of a rocket about to go by above it. Rockets are fast, so rather than run in and try and find my Canon G16 and risk missing it, I pulled out my phone and did my best. It turned out reasonably well, with even a sort of Halloween-y color cast in deep dusk.

It was a SpaceX launch of still more Starlink satellites, from Vandenberg AFB. Before I could get my phone out to take a shot, we saw the first stage drifting down toward a landing on an unmanned landing barge that Elon Musk has whimsically named Of Course I Still Love You.

Although the shot I took wasn’t bad, there is a site detailing the Vandenberg launch schedule, and next time I’m going to be out there with a tripod and my G16.

_…_ _…_

Elon Musk, yeah. He apparently closed the deal to buy Twitter earlier today, and has already fired top management. One of the first corporate directives he’s going to issue is to un-ban all banned users. He’s also going to throttle way back on content moderation, which for Twitter has generally meant censoring anything Twitter’s management doesn’t like.

That may still take some doing. Ironically, if he succeeds in cleaning house along the lines he’s stated, it could mean that several much smaller social networks catering to those who have been banned or censored by Twitter could lose members to a new “big tent” Twitter. We’ll see how that plays out. Musk knows how to get things done, and if anybody can create a social media network that is open to all sides of the political spectrum, it would be him.

_…_ _…_

All this cooks down to some pretty fundamental questions. What are social networks good for? Twitter seems to be a bottomless well of political derangement, which (as you might imagine) I dodge as best I can. I’m active on Twitter because every time I mention my books there, I sell a few. Whatever else I post there are pretty much what I post here now and then as “odd lots,” i.e., links to interesting things, few or none of them having anything to do with politics.

I’ve stated before that Twitter is an “outrage amplifier,” and it’s still true–but then again, any social network can be an outrage amplifier. Twitter seems particularly good at it, which has always puzzled me. Not long back I began to wonder: Is Twitter what it is because so many journalists are on it? Journalism itself (at least outside of vertical market reporting) seems to draw its energy from outrage. If Musk makes the journalist community run screaming from a network it can no longer dominate, what will Twitter become?

Recent news about Meta’s financial crisis suggests that Twitter could in fact become the new Facebook–especially if the old Facebook becomes insolvent. Zuck seems to be pouring all his energy and free cash flow into a virtual world that nobody asked for and nobody wants. Abandoning his Metaverse would be the ultimate humiliation; one has to wonder if he would pull back before the company crashed for lack of cash.

I have an idea that I think I covered here some time back: a social network server into which many independent social networks could connect and trade information according to rules established by each participating network. If people wanted an echo chamber, they could build an echo chamber. If they wanted a wide-open discussion board, they could build that too.

_…_ _…_

I haven’t posted much over the past month because I’ve been beating hard on the 4th edition of my assembly language book. It’s coming out reasonably well, though I really miss the much-maligned Insight debugger, which I featured in the 3rd edition back in 2009. Most Linux debuggers are designed for C and C++ and don’t have an assembly source code view like Insight had. The source for Insight is available online, and if any of you are capable of creating an installable package, I encourage you to do so. I understand that the damned thing is weird internally, containing as it does the whole damned Tcl/Tk interepreter for the sake of its widget set. Or failing that, if anybody can recommend a standalone (i.e., not SASM) Linux debugger with an assembly view, please let me know. I’ve looked at a lot of them, including Nemiver, edb, and DDD without much success. I’ve thought hard about trying to teach my readers command-line gdb, or even gdb TUI, but naked gdb is a quadruple handful. My book is for absolute beginners, and I’ve got page-count constraints that wouldn’t allow me to teach enough of it to be truly useful.

Insight would be my first choice, but I also described Kdbg in the 2009 edition, and although the source is available and I’ve tried to compile it for modern distros like KDE Plasma and Linux Mint Cinnamon, the make failed for reasons that I don’t understand. Nor do I understand why it was pulled from all the Linux repos to begin with. It was robust and relatively easy to use. Could it be built as an appimage? That would be way cool.

Beyond that I’m certainly open to suggestions.