flak rss random

effect and cause

I’m reading Most Secret War by R. V. Jones, an English physicist’s account of his intelligence work in the Air Staff during World War II. I’m only up to the beginning of 1941, but it’s been a terrific read so far, with many enlightening anecdotes. A few dealing with erroneous assumptions were particularly good.

more...

Posted 03 Mar 2016 17:26 by tedu Updated: 03 Mar 2016 17:26
Tagged: bookreview thoughts

Red Rising

On the Brave New World of Mars, humanity is segregated into genetically engineered castes, each a different color. Beneath the surface of this inhospitable Dune like world lives Darrow, a young miner. The Helium-3 must flow. But rebellion is afoot, and Darrow undergoes operation Gattaca to transform his lowly Red body into that of a Gold. Then it’s off to the Institute, where he competes in the Hunger Games to crown the next Ender. Soon he’s caught up in a Game of Thrones as the great houses vie for power. Along the way he makes some quirky friends, all the while remembering his dead Braveheart wife.

more...

Posted 08 Feb 2016 19:53 by tedu Updated: 09 Mar 2016 15:33
Tagged: bookreview

when preloads go sideways

How hard is it to preload a PC with the software it needs to work? Really fucking hard.

more...

Posted 22 Jan 2016 21:09 by tedu Updated: 22 Jan 2016 21:09
Tagged: bugs rants security software windows

trump

Time and Esquire both went full Trump this week, with cover titles of “How Trump Won” and “Hater in Chief”, respectively. Not to mention very similar red, white, and gray color themes.

more...

Posted 20 Jan 2016 22:51 by tedu Updated: 20 Jan 2016 22:51
Tagged: magreview politics

outrageous roaming fees

Unexpected roaming fees are the worst. You’re just cruising along, having a jolly old time, and then boom. $20 per megabyte??? Should have read the fine print. Of course, if you had known to read the fine print, you probably would have already known about the roaming fees, and therefore not needed to read the fine print. And so it goes, in life and in ssh.

more...

Posted 15 Jan 2016 14:55 by tedu Updated: 19 Jan 2016 04:17
Tagged: c openbsd programming security thoughts

openbsd laptops

OpenBSD 5.9 won’t be out for a little while, but it may be helpful to plan ahead, especially since there’s been some considerable progress on hardware support. Here are some notes about what works in general and a few particular models.

more...

Posted 13 Jan 2016 18:24 by tedu Updated: 13 Dec 2018 22:11
Tagged: computers openbsd

moderation in moderation

William “the Jar” Mason is a semi famous programmer. Mostly retired, but his website still has some classic postings from early days working on essential software tools like vi and lynx. Unzealous Association is a link aggregator popular among people who like to read Mason’s articles.

The trouble begins one day when wjm decides that UA sends too much traffic his way. Like a denial of service. And so wjm responds by redirecting anyone with a referer of UA to a picture of a roast ham. (This is probably an overreaction. It’s not really the UA users at fault, but the many aggressively stupid bots that scrape all linked sites. But it has the desired effect of keeping links to wjm’s site off the front page.)

This action is not without collateral damage. It’s not just that headline links disappear, but also less trafficked links in comments are affected. This then incites an unhelpful mini thread on UA about how the internet works.

The UA response is to autokill any comments linking to wjm. The comment is hidden from most users, but remains visible to the author without any indication of what went wrong. (Also Known as hellbanning, the nuclear option of troll containment.)

There are a couple other ways this could have played out. Possibly, if the UA software can detect wjm links in order to kill them, it could also skip adding the <a> tags. Users who cut and paste the link don’t have referer headers. Problem solved. Another option might be to simply ride it out and see if the complaint threads dissipate. Maybe wjm will even change his mind some day.

Unfortunately, when all you have is a trollhammer, all you see are trolls.

Posted 21 Dec 2015 15:35 by tedu Updated: 21 Dec 2015 15:35
Tagged: rants web

SIGPIPE can happen to you

Some recent flak outages were mysterious. One day things would be working, but the next they wouldn’t. All the flak.lua processes had disappeared. No error messages were reported in any observable location. No unusual looking requests were observed in any recorded location. Sometimes a process would survive days of heavy traffic. Other times it would die after only a few hours of light traffic. It was as if the process involved simply lost the will to live.

more...

Posted 02 Dec 2015 16:06 by tedu Updated: 02 Dec 2015 16:06
Tagged: network programming

sometimes syscalls restart

Yesterday Reyk fixed a tiny bug in vmd. It wasn’t possible to kill the process by pressing ^C. As explained in the commit, the accept4 system call was being restarted after the signal.

By default, most signal handlers that a program establishes have the SA_RESTART flag set, which causes an interrupted system call to be restarted. Actually, by default signals are either ignored or cause the program to terminate, so this isn’t a problem at all, but any handler installed by calling signal sets this flag. More control over signal actions is possible using the appropriately named sigaction function.

On the kernel side, system calls that need to block call tsleep which usually waits for a corresponding wakeup or a timeout to expire. However, it may also return an error (ERESTART) if it’s interrupted by a signal. Most system calls don’t inspect the error code, they simply pass it along. But when the kernel is about to return to userland, it will notice this error code and run the syscall again.

Among the system calls that handle ERESTART specially are poll, select, and kevent. All of them check for ERESTART and immediately map it to EINTR so it gets returned to userland.

Back in vmd, it had installed a SIGTERM handler that set a quit flag variable to true, but was getting stuck in accept. The code looking at quit never had a chance to run. The fix was to add a call to poll before accept.

Most of the time the default behaviors make sense. Restarting system calls prevents a lot of spurious failures from propagating. Applications that install signal handlers usually use one of the interruptible functions in the core of their event loop. vmd happened to be an exception, that only needed to handle one event and tried to take a shortcut.

Additional commentary about history of EINTR.

Posted 24 Nov 2015 17:52 by tedu Updated: 20 Jun 2019 01:08
Tagged: c openbsd programming

going full pledge

Looking at Theo’s status of pledge update there’s a lot of programs on the list, including some which may seem a bit silly. But the effort has turned up some interesting bugs and misfeatures along the way.

more...

Posted 20 Nov 2015 18:33 by tedu Updated: 20 Nov 2015 18:33
Tagged: openbsd software