Jeff Duntemann's Contrapositive Diary Rotating Header Image

August, 2022:

SASM Crashes on “Section” in a Comment

As most of you know, I’m grinding along on the fourth edition of my book Assembly Language Step By Step, updated to cover x64. I’m using the SASM IDE for the example code because it provides seamless visual debugging using a front-end to gdb. Back in 2009 I created the third edition, and incorporated the Insight debugger front end for visual debugging. A month or so after the book appeared, Insight vanished from the Linux world. I tried a lot of debuggers and editors before I discovered SASM. It’s treated me very well.

Until today.

Now, I’ve been programming since 1970, in a lot of languages, on a lot of platforms, and I’ve made a lot of mistakes. Finding those mistakes is what debugging is about. Today, I was working on a short example program for the book. When I finished it, I clicked the Build button. It built as it should. I needed to single-step it to verify something about local labels, but when I clicked the debug button, SASM crashed. As Shakespeare would have put it, SASM died and gave no sign. The whole IDE just vanished. I tried it again. Same thing. I rebooted Linux. Same thing.

Puzzled doesn’t quite capture it. I loaded another example program from the book. It built and debugged without any trouble. I loaded example after example, and they all worked perfectly. Then I copied the source from the malfunctioning example into a file called crashtest.asm, and began cutting things out of it. I got it down to a start label and a SYSCALL to the exit function. Still blew SASM away.

Most of what was left was comments. I did a ctrl-X to cut the comment header onto the clipboard. Save, build, debug–and it worked perfectly.No crash, no errors, no problemo.

Soooooooo…….something in a comment header crashed the IDE? That would be a new one. So I dropped the comment header back into the file from the clipboard and started cutting out lines, one by one. I narrowed it down to one comment line, properly begun with a semicolon and containing no weird characters. The line that crashed SASM was this:

;         .bss sections.

I cut out the spaces and the period. No change. I cut out “.bss”. No change. I was left with the word “sections.” On a hunch, I lopped off the “s”. No change. Then I lopped off the “n”. Suddenly, it all worked.

SASM was crashing on a comment containing the word “section.” I verified by deleting the line entirely and typing it in again. Crash!

I stared at the damned thing for a long time. I loaded a couple of my other examples, and dropped the offending comment header into them. No problems. Twenty minutes later, I noticed something: In crashtest.asm, the fragment of comment header text was below the three section markers:

section.bss
section.data
section.text

; section

Now, in my other examples, the ones that didn’t crash, the comment header was above the three section markers. So I went back to crashtest.asm, and moved the comment header to the very beginning of the file, above the section markers. Suddenly everything worked. No crashes.

WTF? I assembled the offending crashtest binary from the command line without trouble. I loaded it into gdb from the command line and messed with it. No trouble.

I wrote this entry not for answers so much as to provide a report that other SASM users can find in search engines. There are things about SASM that aren’t ideal. Sure. But I’ve never seen it crash before. I’ll see if I can send the crashtest.asm to the people who created SASM. I’m sure it’s just a bug. But it’s the weirdest damfool bug I’ve uncovered in a whole lot of years!

Review: Tangled

TangledBoatScene - 500 wide.jpg

Everybody knows the story: A girl with magical golden hair is kept in a tower by her supposed mother, who somehow climbs up and down the girl’s hair to access the tower. There are a lot of variations, but as with most fairy tales, a clever screenwriter could do a lot with that.

Disney did.

Carol bought me some DVDs for my birthday, including both Cinderella (1950) and Tangled (2010). I’ve always liked cartoon movies, and those were two that we didn’t yet have in the cabinet. We watched Cinderella first. It had been a lot of years since we’d seen it, but I want to say my mother had the VHS tape and I saw it regularly as a young man. The next night, we watched Tangled. We’d seen it in theaters back in 2010, but I wanted to compare how animation had evolved across 60 years.

Wow.

Not that this was a surprise. Cinderella is good fun, but for the most part it’s a funny animals movie. Neither Cinderella nor the prince have much in the line of personalities. The side characters like her stepmother and stepsisters, the king and his grand duke, and all the chateau’s animals steal the show. I suspect that’s because Cinderella and the prince are supposed to be realistically drawn, whereas the others are caricatures. Realism in animation is hard. Caricatures, by contrast, are a snap.

Which brings us to Tangled. It may not be Disney’s masterpiece (my vote on that score is still for Fantasia) but of all the princess films it’s by far my favorite. It has a warmth that the other princess movies try for but mostly miss. The minor-key masterpiece “Let It Go” from Frozen is a remarkably bitter item if you read the lyrics, and a certain chill permeates the whole story. Even The Little Mermaid, as good as it is, depends heavily on its minor characters like Sebastian the crab and its heavy, Ursula.

With Tangled I think we see (at last) true mastery of CGI animation. Rapunzel’s hair is dazzling. This shouldn’t surprise anyone; her hair is what makes the story happen. Disney, in fact, had to develop rendering software specifically for hair. They nailed it, and Rapunzel’s hair might as well be another side character in the story. (There are many more side characters, most of whom are well-drawn yet caricatured ne’er-do-wells.) What surprised me the most was the subtlety of the facial expressions of the main characters Rapunzel and Flynn/Eugene, big-eye characters though they be. (The big eyes keep us out of the uncanny valley, I’m pretty sure.) Cinderella’s face had three or four different expressions. Rapunzel’s face flowed smoothly across a whole spectrum of emotions. Even her pet chameleon Pascal (great name!) could show emotion without speaking a single word. At some point I think the animators were showing off: Rapunzel is barefoot for the whole film, and her feet are animated realistically, right down to her toes.

There are a couple of funny animals, especially the hero horse Maximus, who at times thinks and acts like a dog. The animals, however, do not steal the show. What steals the show are the subtle and dazzling backdrops, especially the scenes with the film’s core motif, the candle-lofted flying lanterns. If you’ve never seen the film, you can see the lantern scene during the big love song “I See the Light” on YouTube. I consider that song, hands-down, the best love song from any Disney animated film. I could easily sing Flynn’s part about Carol.

None of this is to dump on Cinderella. It was the best Disney could do in 1950, and I’ll see it again for the mice alone. But Tangled represents something that animation has been working toward in fits and starts for more than a century: an emotionally engaging fantasy world full of startlingly beautiful things. You may have to mellow out a little bit to enjoy it to the fullest; it’s not an action film at heart. So if you can stream it or buy the disc, pour yourself a glass of wine, kick back and just let it take you.

Highly recommended.

Odd Lots

  • Here’s a longish research paper from the NIH National Library of Medicine exploring studies of the effects of light at night (LAN) on various body functions. One of the most startling is the degree to which night work correlates to obesity and Type II diabetes. Less clear but more concerning are links between LAN and certain cancers. The message appears to be: Sleep at night, in the dark. Carol and I do that, and have all our lives.
  • Hating the Other evidently heightens activity in our reward centers. The late Colin Wilson explored the issue, and claimed that in modern society we have to give ourselves permission to hate the Other…but once we do, hating the Other is delicious and hard to stop. This explains a lot about tribalism in modern politics, 90% of which is about hating the Other–and an important reason why I don’t write about politics.
  • Virginia Postrel has a related article on her Substack, about the role of what she calls “purity” and its relation to cancel culture. She mentions Gavin Haynes’ notion of a “purity spiral,” which I think nails the whole purity business. It’s an effort to outbid others in pursuit of an unattainable ideal. It is thus more evidence supporting my notion that idealism is evil.
  • I’ve always wondered why music in a minor key sounds sad, spooky, or creepy. Here’s one of the better online essays on the subject.
  • I include this (slightly) related item because it asks a question I’ve never heard asked before: What is the most evil chord in music? I would guess it’s the chord that runs around with a chainsaw, cutting treble clefs in thirds, and playing hob in a minor key.
  • I wonder how I got to be 70 without ever hearing about raccoon dogs, which are neither raccoons nor dogs. They’re an interesting, albeit invasive, species of canid found in the Far East. The Japanese call them Tanuki, though I don’t recall them coming up in conversation when I was in Japan in 1981.
  • Speaking of my 70th birthday, my writer friend and collaborator Jim Strickland brought a Cabernet Sauvignon to our dual birthday party on July 16. I tried it and found it…not bitter. That was a first in my wine experience, granting that once I tasted a few bitter specimens, I basically stopped trying them. The wine in question is from Daou, vintage 2020. About $20 at our Kroger-affiliate supermarket. Quite dry, but no oak, which spoils all the other flavors for me..
  • Well. Ever heard “Bohemian Rhapsody” played on several disemboweled scanners and piles of 5″ floppy drives, plus the occasional phone modem? Here’s your chance.
  • In case you don’t yet have enough interesting things to read, here’s the Smithsonian’s history of the hard hat.
  • Back in June, people in San Francisco reported that anchovies were falling from the sky. People did not report anyone running around the city’s streets holding a pizza and hoping for free fish.
  • Hey, this was evidently a banner year for Pacific Coast anchovies. My guess is that with no one putting them on pizzas anymore, their depleted populations have rebounded.
  • After using it since 2005, LiveJournal has canceled my account there. I don’t think anybody was reading it anyway. It was a mirror, and I have better backup schemes now.