LaurieWired Profile picture
Dec 26, 2024 5 tweets 2 min read Read on X
“My wife complains that open office will never print on Tuesdays”

A bizarre sentence; which kicked off one of the most interesting bug hunts in Ubuntu’s history.

It all starts with some goofy pattern matching. Image
It’s not a bug with the printer, or OpenOffice, or the printer driver.

It’s a mistake in the way the “file” utility parses file signatures.

When printing from OpenOffice, a PostScript file is created with the creation date. Image
CUPS, the Common Unix Printing System, then uses the file utility as part of its pipeline to determine the type.

But if "Tue" appears at byte 4 (Tuesday's creation date), it's mistakenly identified as an Erlang JAM file, causing the print job to fail.
Essentially, the logic in the file utility for recognizing Erlang JAM files were too broad.

Looking for a single static string position is an extremely fragile detection method.

Simply changing the creation date to “XTue” completely solves the problem! Image
After some back and forth, the logic in the file utility was improved, and the bug was fixed.

It’s a good lesson for us programmers to not blindly dismiss “implausible” sounding issues.

Next time someone makes an outlandish claim; take a closer look. You might just be onto a bizarre edge case!

Here’s the original bug report:
bugs.launchpad.net/ubuntu/+source…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with LaurieWired

LaurieWired Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @lauriewired

Jun 3
A squadron of F22’s was once taken out by an imaginary line.

On a mission to Japan, an unforeseen software bug occurred crossing the international date line. Longitude swaps from W179.99 to E180 degrees.

Navigation, comms, and even fuel management went down! Image
Image
This wasn’t a simple "turn it on and off again” fix; something was seriously wrong. Reboots weren't helping.

According to Maj. Gen. Sheppard:

“…all systems dumped and when I say all systems, I mean all systems...they could have been in real trouble." Image
Thankfully, the squad of 12 F22’s were accompanied by a KC-10 tanker, who they followed visually back to Hawaii safely.

Details are sparse, but these issues aren't uncommon in aviation!

It's extremely difficult to notice subtle bugs over millions of lines of code. Image
Read 4 tweets
May 27
Want to recognize a song from just a few seconds of distorted audio?

Use Constellation Maps.

The math is brilliantly simple.

With just a handful of bytes; discarding 99% of the waveform, you can recognize a unique fingerprint across hundreds of millions of tracks. Image
Image
First, chop up the audio into few-second windows.

Take an FFT of the waveform, then extract the local peaks. Each maximum becomes a “star” on an xy plot of time vs frequency.

Pair nearby stars into clusters and hash the result. Boom, a noise-resistant fingerprint. Image
Constellation maps were the basis for Shazam.

Shazam today is a polished iOS/Android app, but the tech actually started back in 2003!

The early marketing was kind of hilarious; dial a phone number and get your Nokia to "listen". The ID'd track was sent back via SMS. Image
Read 4 tweets
May 23
I miss the insanity of 80s processor design.

Intel’s iAPX 432 was a “micromainframe”.

It had no general purpose registers, supported object orientation *directly*, and performed garbage collection on-chip.

It was also 23x slower than an 8086. Here's why it failed. Image
Image
Intel targeted Ada so aggressively that C support was an afterthought.

Problem was, particularly at the time, the Ada compiler was extremely untuned and immature.

Scalar instructions were basically never used; *everything* was huge object-oriented calls. Image
Image
The “micromainframe” moniker wasn’t just marketing. One I/O chip could stitch together 63 CPUs on a single bus.

Essentially memory safe in-hardware; dangling pointers were impossible at the ISA level.

Partners like BiiN suggested using the CPU for nuclear-reactor control. Image
Image
Read 4 tweets
May 22
NTIRE is the coolest conference you’ve never heard of.

Deleting motion blur? Sure.
Night Vision? No problem.

Every year, labs compete on categories like hyperspectral restoration, satellite image enhancement, even raindrop removal (think car sensors)! Some highlights -> Image
Low-light enhancement is always popular.

Retinexformer, shown here got 2nd place in the 2024 contest.

A *TINY* transformer-based model, it runs in about 0.5 seconds for a 6K image on a single 3090. Only 1.6M parameters (<2MB weights at INT8)! Image
Maybe motion blur removal is more your thing.

UAVs are often used to examine wind turbine blades for early failure warning. Movement of drone + rotational velocity pose a challenge.

Here’s the 2021 winner DeblurGANv2, taking ~0.19s of processing per image. Image
Read 5 tweets
May 21
What if an OS fit entirely inside the CPU’s Cache?

Turns out we’ve been doing it for decades.

CNK, the OS for IBM’s Blue Gene Supercomputer, is just 5,000 lines of tight C++.

Designed to “eliminate OS noise”, it lives in the cache after just a few milliseconds of boot. IBM Blue Gene
Kernels that “live” in the cache are common for HPC.

Cray’s Catamount microkernel (~2005) used a similar method for jitter free timing.

Huge Pages, Statically Mapped Memory, and a lack of scheduling are all typical aspects of these systems.

What about the modern era? Cray XT2
Modern CPUs are *insane*.

L3 sizes exceed GIGABYTES per socket (see Genoa).

Many HPC labs run the hot path in light kernels (LWKs), outsourcing file I/O and syscalls to separate nodes; all with the intent of reducing µs-level jitter. Determinism is the name of the game. Image
Read 5 tweets
May 13
TDP (Thermal Design Power) of CPUs is a garbage metric that misleads consumers.

In the Pentium era, a 89W TDP meant just that; expect to dissipate 89W of heat in the worst case.

With Alder Lake, a 125W CPU can draw ~241W indefinitely!

Here's the goofy math: Image
Image
CPU’s didn’t really know how to idle until the early 2000s. They just kinda ran full bore all the time.

With the introduction of C-States, various parts of the processor could be shut down, saving power when the computer was doing nothing.

Of course, this was HUGE for laptops. Image
Image
If you temporarily downclock a CPU, why not upclock it as well?

Around ~2008, Intel came up with the concept of Turbo Boost and the “energy bucket”.

Short spikes *above* TDP are allowed, as long as the 28 second moving average stays <TDP.

Okay, nothing too crazy yet. Image
Image
Read 5 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(