ManMachine
@max@manmachine.me
Reminded of this in conversation recently: possibly the nastiest piece of abuse of the C switch statement rules I know of that _wasn't_ done by either me or Tom Duff. This was contributed to #PuTTY's terminal code in 2000 as part of a much larger patch (and removed again in a 2001 rewrite).
The switch is processing the final character of one of the terminal escape sequences ESC#3, ESC#4, ESC#5, ESC#6 and ESC#8. Four of them do something very similar: they set an attribute on the current terminal line (indicating whether the text is double-width or double-height). The fifth is the odd one out. So you want a switch statement in which four of the five cases share _most_ of their code: each sets the line attribute to a different value, but the code for actually writing it into the terminal is the same.
You could write four case statements sharing a handler, and have a secondary switch inside the handler to choose the attribute. Or you could have four separate handlers that choose an attribute value, then hold your nose and write a 'goto' from each one to the shared code that writes it into the terminal data. Or you could put the shared code in a subroutine a long way away from here, and have four independent case handlers all call it with a different parameter.
Or you could do this, which complies with the letter of 'don't use goto', but makes you wish it hadn't! Control enters at one of the four case statements, and after setting the attribute variable, it then skips over each of the following case labels because of the if (0) { ... }. Then all of them fall through to the shared handler.
This code was in PuTTY for less than a year. But in that time it managed to expose a bug in a C compiler.
It was a small, independently written compiler (none of the huge code bases everyone's heard of now). We had an email from its maintainer to let us know – and to ask us what the code was _meant_ to do, because fair enough, it isn't obvious to everybody at first glance!
The bug was that the compiler optimised away if (0) { ... } statements, on the theory that they were unreachable. But the code in these if (0) statements _is_ reachable, via the case labels related to the containing switch. So the compiler had thrown away code that was actually needed, and then got confused when it couldn't generate the jump for those switch cases.
(The more usual strategy is to start by turning the whole function into a control-flow graph, i.e. blocks of straight-line code in a directed graph connected by edges that are effectively gotos. Then you can optimise conditional branches based on a constant into unconditional branches, deleting the never-traversed graph edge out of their block. Then you detect unreachable code by a search through the graph from the function entry point. That strategy avoids this problem.)
The fifth escape sequence in the switch, ESC # 8, is one of the most fun ones in the whole terminal. It instantly replaces the entire screen contents with copies of the capital letter E.
In DEC's documentation it goes by the name DECALN, and is described as an alignment test. I guess the point is that it's a quick way to put text in every part of the screen, if you're about to check that your old-fashioned CRT monitor is showing the whole of the terminal contents, and not e.g. missing half a row or column because it's off one edge of the display.
I was fascinated by that sequence as a child, partly because it's amusing, and also because of the way that it _instantly_ updated the screen, which I didn't know how to do any other way (the machines I was using were slow and I was writing in high-level languages). It stuck in my head all my life for that reason.
And I eventually found a real use for it! Once I wanted to train myself out of the bad habit of using backticks in my shell commands (the synonym $(...) is better, because it nests sensibly and doesn't impose extra escaping needs on its interior). So I bound the ` key in bash to a command that echoed ESC#8, which was just the right level of reminder to not do that again – it didn't make a loud noise annoying my colleagues, or destroy any work, but it definitely reminded me to change that habit. After about a month, I'd got into the new habit and removed the binding.
@simontatham code so bad it makes using a goto statement the more readable variant. what a world we live in.
@simontatham Don't forget that modern compilers with unicode identifiers support camel case
case '🐫':
@simontatham It's unnecessarily verbose. The if (0) { } bits could just be if (0). 😈
@simontatham I've just had a great idea for making code weirder:
if (x >= 0) {
...
...
...
} else x_is_negative:
return FAIL;
@barubary I once experimented with a macro called 'since', which looks like a control flow statement, and has the semantics that it checks its condition by assert() and then unconditionally executes the body.
if (x > 0) {
// do this
} else if (x == 0) {
// do that
} else since (x < 0) {
// do the other
}
@barubary @simontatham this… has me stumped. How do you do that in cpp?
@mirabilos @simontatham I'd have to look up whether assert() is guaranteed to expand to a simple expression, but:
# define since(COND) if (assert(COND), 1)
Edit: It is: "[assert] expands to a void expression", says C99.
@barubary @mirabilos yes, I think that was more or less what I did, although I might have been on the ball enough to avoid leaving the if unbalanced:
# define since(condition) if (assert(condition), 0); else
But I didn't have to go as far as the alternative technique I invented much later, which would have looked something like this:
# define since(condition) \
if (1) { \
assert(condition); \
goto MAKE_LABEL; \
} else \
MAKE_LABEL:
where MAKE_LABEL in turn creates a label name by token-pasting on to __LINE__, so that you can do this more than once in a function without getting duplicate label errors.
(Doing it this way you wouldn't be allowed to write more than one 'since' on the same source line. Probably nobody cares, but it is a weakness of this technique in principle. The simpler approach with the comma operator is better, in cases where it works.)
@simontatham @mirabilos Or in GNU C, __COUNTER__.
@simontatham @barubary not my version of GNU C yet
@mirabilos @barubary it's in gcc 13.3, on my Ubuntu 24.04 system.
If I remember rightly, __COUNTER__ was originally an MSVC-ism. But of course any compiler with a sufficiently thorough MSVC compat mode would have to implement it for that mode. And then they might decide to turn it on everywhere, on the principle that it's easy, compliant (we're in the __ namespace) and might well come in useful.
I've occasionally wondered about changing over the case-generation macros in my coroutine system to use it (where available), eliminating the restriction about two yields on the same line, and also packing the case values more tightly so that the compiler is more likely to be able to generate an efficient dispatch table. But eliminating that restriction is a double-edged sword, because if not _all_ C compilers support __COUNTER__, it puts you at more risk of writing code that works for you but not for everyone else who needs it.
And __COUNTER__ still isn't in standard C, as of C23.
@mirabilos in the email introducing Duff's device, Tom Duff mentioned the (mis)feature of C that switches don't automatically break after case labels. ("This code forms some sort of argument in that debate, but I'm not sure whether it's for or against.")
In fact, I think the _more_ critical (mis)feature of C switches is the way that the labels are allowed to appear inside sub-blocks. _All_ switch abuse concepts I know of make use of that: Tom Duff's unrolled loop, my ad-hoc coroutine mechanics, and this. But not all of them depend on the lack of implicit break – if that were different, my coroutine system would still have worked fine, I'd just have to add an extra goto in the macro implementing 'yield' to jump past the case label.
@simontatham @mirabilos it really messes with my mental model of the switch statement. Jump to a case, and... run into a closing bracket for a block you never saw opened?
I see how the language got here but I hope it wasn't on purpose.
@barometz @mirabilos yes, it is one of those features where you wonder what the reasoning was!
In one sense I can see the logic. You're writing a compiler. It sees a case statement. It has to figure out what switch to associate it with. You can do one of these things:
• Check the surrounding control flow statements for the innermost switch.
• Check the surrounding control flow statements for the innermost statement of any kind, and it had _better_ be a switch, or else.
I can see how someone throwing together an early C compiler in a hurry might have done the former: writing error messages is hard work compared to just choosing an answer that won't actually cause a crash, and carrying on.
But when you come to write down the language definition in words for other people to learn from, you have to decide whether you really meant to do that or whether it was just a corner cut in implementation. And, well, some of us _have_ ended up finding uses for this feature, but even I will admit that the useful applications are small compared to the number of opportunities it introduces for making mistakes!
@simontatham This reminds me of one of the GDI calls in the Win16 API for Windows 1 involving a jump table into the middle of a machine code instruction. The 8086 would see an invalid instruction and do nothing but advance to the next. I don't recall any more details, I'm sorry.
@static I hadn't heard of that being done in Windows in particular, but certainly it was a common dodge in general on all the old architectures with variable-length instructions and not too much effort on the part of the CPU to try to be too clever. Z80 and maybe even 6502 as well as x86-16.
More fun than that is writing polyglot machine code which will run on more than one totally different CPU architecture, by using a similar technique to write code that looks like a NOP to one architecture and a branch to the other, and then you've diverged control, and can put machine code specific to each architecture at the place where that CPU will look next.
I also don't recall any _completely_ exact way that this is done, but the kind of thing I have in mind is to take one architecture to be something RISC with 32-bit fixed instructions, stored little-endian, and pick an instruction whose low 2 bytes encode an immediate value of some kind. Then you can make those 2 bytes also an x86 short branch. The code at the branch target will run on x86, and the code after the initial instruction will run on the RISC architecture, with only the small side effect that some register has been filled with a useless constant.
(I _think_ I saw this trick done for x86 / DEC Alpha, back in the day. I'm sure it's also been done on x86 / Arm, and probably others.)
@simontatham its such a nice solution to a fairly common problem.
Its a shame wed probably have to fire anyone who actually used it :)
@simontatham I'm more interested into the theme😄. Could you tell what window decoratins theme and font do you use?
RE: https://hachyderm.io/@simontatham/115372921751382450
@WencesByte you're not the first person to ask! Here's the answer I gave last time.
in reply to »@domi re sidenote: thank you!
The window decorations are the 'Crux' theme from the Sawfish window manager, which I mostly use for its programmability rather than its looks (although I agree Crux is pretty nice).
The font is my own work, on my website but still in "unfinished" status: https://www.chiark.greenend.org.uk/~sgtatham/technicality/
The choice of PS1 is designed so that it turns into a no-op shell statement, so that I can copy-paste a whole line from one terminal to another without having to carefully not select the prompt at the start. It's coloured using something that isn't one of the standard 8 ANSI colours so as to be easily distinguishable from _most_ other terminal output, in the expectation that most things will stick to the usual 8.
(ok, and also because purple is cool)
@simontatham Turn Your Imagination into Animated Scenes with MagicBox!
Imagine turning your ideas into stunning drawings and captivating animated scenes that grab everyone's attention. All you need is your imagination, and MagicBox will help you bring it to life!
Download MagicBox: https://play.google.com/store/apps/details?id=com.kirolosfarag.magicbox&pcampaignid=web_share
@simontatham FWIW: I've heard this structure called "Claire's Device". I have zero idea who Claire is/was or when.
@mbr I had never heard of that, and neither had my usual search engine, but https://marginalia-search.com (which I only heard of recently) stepped up to the challenge and found https://open-std.org/JTC1/SC22/WG14/www/docs/n3195.htm
which indeed mentions a similar thing under that name.
In their case it's an if (0) followed by a goto label instead of a case label, so not specific to PuTTY's use case of sharing a common tail between cases of a switch. But it's still an if (0) with a label to jump into the block anyway.
However, the link in the references section titled "Claire's Device" goes to https://web.archive.org/web/20210203022142/http://www.clifford.at/cfun/cliffdev/ which describes it as "Clifford's Device", in both the URL and the text!
@mbr … ah, but mystery solved, the front page of that website says "Claire Wolf, formerly known as Clifford Wolf". Phew, nobody has stolen someone else's idea after all!
@simontatham When I first saw the if(0) { statements in the screenshot I thought that the screenshot is somehow broken. 😂
This is maybe legal code, but it's also really hard to read. If I would get this in a merge request, I'd send it back.
@simontatham I've seen a similar thing back in the day. IIRC I was told it was some nokia device source code, either a network device or pre-symbian mobile phone..
it was supposed to highlight how optimized some of the code might be.
@simontatham Oh gosh!
I think it would be easier to follow if the lines started with the "if", then the case, and the assignment. Then you could see that the case is jumping inside an otherwise null if block...
@simontatham Yesterday I found in some legacy code the switch case "defeault:". Because it was misspelled, the compiler thought it was just an unused goto label and ignored it. Fortunately, it was followed only by a break; so the code ultimately worked as intended.
dwagenk [I'm used to he/him. It's not really correct, but I haven't found anything to replace it with, yet] » 🔓
@dwagenk@chaos.social
@simontatham that's cursed!
@simontatham The fact that that even compiles is a language design error. That one should not take advantage of.
@simontatham I really want to believe that that's a sawfish screenshot from 2000. :-)
@elb is it better or worse that it's a Sawfish screenshot from this morning?
@simontatham I'm going to have to think about that, but I definitely fully respect it. I really liked sawfish back in the day. I'm enjoying nucleotide (Wayland window manager for the River compositor, in Common Lisp) on my Pocket Reform these days.
@elb thanks for the recommendation! I haven't yet found a Wayland environment I'm happy with, but the River sub-ecosystem definitely looked to me like a good direction to head, and 'nucleotide' is a thing I hadn't already heard of. I'll give it a try.
@simontatham Yeah, my overall life in Wayland has been ... tolerable, at best. Nucleotide improved that situation significantly.
What little artefact of your parents/caregivers taste in music/tv/movies/pop culture do you still carry with you now?
My mum is 81 today - November 21, so I've been remembering the pop culture she raised me on that rubbed off on me.
Bob Marley, ABBA, Battlestar Galactica, ST:TOS, Duane Eddy, Doctor Who, The Goodies, Marty Robbins, The Wombles, Hart to Hart, The Love Boat, Bonzo Dog Doo Dah Band, and The Muppets.
@max HE HAS TASTE!
My mum had a few tapes of instrumentals she likes, including some early electronic stuff. I can't remember much more than Popcorn, Song For Guy and lots of Duane Eddy on them - but that lead me to my love for Kraftwerk, Jarre and Vangelis.
I got to share Equinoxe with my mum in the 90s, and she loved it too.
@NanoRaptor specific cds that they kept playing in my taste-forming years...dirty dancing soundtrack, beach boys greatest hits, phil collins serious hits, cher's love hurts ...
@NanoRaptor A whole bunch I’d say. But my mom taught me to love books, and my dad was a big fan of Queen. Which always was one hell of a band.
@NanoRaptor My dad used to rock me to sleep to Uriah Heep. I still have it on rotation. No-one I know have ever heard about Uriah Heep.
@NanoRaptor Carry with me, as in such that I would like myself, too? None, really.
@tml Not so much like, but that there's a meaning from it. Perhaps something you can't stand, or something that lead you to find another kind of music/film, or something that affected what you watch now for good or bad.
the apple homeview is out apparently and I have shitposts I want to make about it but legitimately I keep forgetting it came out
and also for this post I had to look up what it was called
so uh is anyone or anyone’s grandparents enjoying this piece of shit
scintillating
?????
the wikipedia article on this thing is hilariously thin for an apple product but here’s a chart fully exploring how not all colors can be wall-mounted, for some reason: https://en.wikipedia.org/wiki/HomeView
> The HomeView runs an operating system called HomeView software, a forked version of iOS, iPadOS and tvOS.[citation needed] The HomeView ships with HomeView software 26.5 at launch.[14] The operating system does not have the App Store, but media from third-party apps can be streamed from an iPhone via CarPlay.[15]
pardon? you can carplay into the homeview? why? why can you carplay into the homeview
apple already had a proprietary protocol for this and it was airplay, why can you carplay into the homeview
why did they fork iOS *again*
did they skip the app store cause they figured people wanted and needed the homeview so bad they’d overlook that, or cause they gave up on this shit and decided to ship it instead of shutting down the project for some reason?
why is the homeview
im stumbling around the streets covered in blood mumbling “why can you carplay into the homeview”
the police have been called but am I really the one that committed the crime
apparently you can’t just wall-mount a homeview. the wall-mounted homeview is an entirely different model from the tabletop one. for some reason
they seem to be almost identical and they cost the same, but the wall mounted one doesn’t seem to have a subwoofer, so the audio is worse for the one you lovingly integrate into the wall of your house instead of the one you keep next to your cooktop so you can FaceTime your grandma while your pasta explodes
you can carplay into the homeview
apes can drink more than one slurp juice
I looked up photos of the thing wall-mounted and there’s barely any even though it’s an apple product that’s been out for a week
anyway please enjoy the aliexpress aesthetics of the homeview in its full glory. this fucking thing looks like a digital thermometer from a Sharper Image catalog and I’m really not sure what kind of wall or room layout would make it look aesthetically pleasing. it really is just a gigantic wristwatch on your wall, and it’s my least favorite wristwatch at that.
shit I looked too close at the second wall mounted pic and now all I see is an oversized smart thermostat, send help
the tabletop one at least looks kind of like a budget streamer mic? so people might think you bought a device that at least does something
my platform is too unique for you, traveler, you cannot handle having an app store on a device that appears to be a non-mobile ipad at best
it is January 2027
jensen huang has revealed 5 more affairs
dario amodei has bought an armed megayacht named Financial Crimes and is spending as much time as possible in international waters
construction has finished on one of the holy water fusion plants that will power Vatican III, the Pope’s bipedal weapons platform
the homeview is discontinued and now extremely popular, as it’s $50 on eBay and someone has figured out how to jailbreak it and install a classic mac emulator
@zzt "How many forks of iOS is Apple on" is the new "how many copies of Python do you have installed"
youtube comment from dmwalker24:
> Massive amounts of AI coded patches for security vulnerabilities supposedly found by AI, patching mountains of AI coded features that didn't work well before, and work even less-well now. Digital Kessler Syndrome.
god yes. digital Kessler syndrome.
Seeing Avian Intelligence Everywhere
Bonus speedpaint: https://www.peppercarrot.com/en/miniFantasyTheater/079.html#bonus
Security teams: We should prioritize vulnerabilities that really matter and are actually exploitable
AI firms: But what if we didn't
vendor: "do you want to win a DGX spark???"
me: "no"
vendor: "you're the first person to say no"
me: "ok"
walking slightly faster through the expo
My discord has an emoji named "tech debt" - which is just the angzarr, ⍼, the symbol famous for having no known use or agreed-upon meaning but somehow appearing in unicode and now it's just a part of unicode forever.
With so many enormous tech debt bills coming due recently, perhaps you, too, would like to take a moment to appreciate the tasteful angles of the angzarr.
@0xabad1dea the sleuths figured this one out, it turned out to be used to represent azimuth.
@tedmielczarek I am aware but that's only half an answer because afaik there remain zero (0) attestations of it in the wild aside from the typesetting catalogue that has it as "azimuth"
@0xabad1dea I love (read: do not actually love) the fact that my phone renders this symbol *not* as a sharp, angled zigzag but as a smooth curve.
The name of the symbol is "RIGHT ANGLE WITH DOWNWARDS ZIGZAG ARROW", and it completely removes the zigzag!
@0xabad1dea thanks for teaching me about the #angzarr. I was unaware of it and look forward to finding a method to employ it. ⍼
@0xabad1dea Looks like a death metal band logo. I can totally see it on the stage backdrop, plus black/red T-shirts in the crowd. 🤘💀🤘
@0xabad1dea I think I'm going to start using this in my passwords when someone insists that they have to contain a "special character".
I support your proposal!
For those who haven't seen it, here's XKCD's comic with alternate names for some weird unicode characters
@0xabad1dea
didn't know it was used for this!
i like it very muh and used it quite often in what jimpunk called "crashtxt" (he coined the term) and i crafted quite a lot around 2014 2023, as this one e.g.:
.
̅̄̄̄̄̄ ̅༶ེེེེེེེེེེེ≣≡ٖٖٖ⚌⚌⚌ᅞᅞᅞᅞᅞᅞᅞ▘ ▖
◄⃣◸༿̅̅༾░▂▁ ▁྄྄྄྄྄྄྄྄྄྄྄྄྄྄྄྄྄▗ᅞ▝
⬊⥦⍼Ҩᓇ؎؎؎҂ᅞ⸻๋๋๋๋๋⤇ᓐᓪᔈֻֻ᷂⁾
﹆🌢🌢̷̸̶🌢Ꙅͯͯͯ.ͯͯͯͯͯɀᵅּּּूूूᔥ༎̶༎̶̥̥̥̅̊̊̊̊̊͞ Ⴠߞ ⛀ʦԅªم ⸺
⌜⌋́́́̓̓̓̓̓ɻ┥◂∿̨╭⃜╮╭┗⎛⧹̓̓̓◟⦦∵̈̈་̈̈̈̈̈̈̈̈̈̈̈㉠↳༝ٖٖٖू
ᅞ⸻⸻⸻⸻⸻
@0xabad1dea I know that symbol is used as a Sigil in Chaos Magik.
It name Ellis and works like a conection in between them. Everyplace Ellis is drawn is connected to other Ellis, conecting the magic of all thouse places together. a powerful linking sigil for magic.
Furbland's Very Birthday Month Account™ [He/Him (or anything else, really)] » 🌐
@GroupNebula563@mastodon.social
@0xabad1dea i propose we make this the anti-ai Unicode symbol since we don’t have one already :P
@0xabad1dea aah... #discord.
The #IRC for kiddies too brainfried to use NickServ…
Addendum: Reply confirms this to be true…
@Netzblockierer I'm a well-known early 2000s hacker who grew up on IRC, you ridiculous asshat, and I am thoroughly too old to take shit from randos who have been limited by their own moderators for serial public asshattery over which fucking chat app I use to talk to my actual friends who are all an actual pleasure and delight to talk to
@0xabad1dea I'll identify as an angzarr from now on: I have no known use, and yet I'm still here extisting. 😅
@0xabad1dea This. Looks an awful lot like a rune sigil. Coincidence? I think NOT. I am sneaking this on to my vuln mgmt docs STAT.
@0xabad1dea
Just doubled back to say that THIS ^^^ thread is the kind of thread that keeps me on the Fediverse and Mastodon.
Thank YOU everybody for helping to make it happen.
@0xabad1dea perhaps someone can recognize this symbol that I came across from revolutionary war documents in South Carolina. I believe the symbol is similar to “@“, but I’m not sure and I don’t have any name for the symbol. Sorry for the blurriness, but I had to blow up the image.
@0xabad1dea I did not know about this symbol and I feel my life is richer for having had that corrected, so thank you 😅
@0xabad1dea Never seen that before but when I squint I can sort of see an X axis and a Y axis so you could think of that as, for example, the start of a profit chart, maybe, and then the rest of the symbol looks like an arrow indicating a relentless move into the negative.
Am I overthinking this? 🤪
@0xabad1dea
About half, or, I guess one third of the mystery of that symbol has been solved.
Monotype did offer to make special matrices for your glyphs, and this one show up in their old listings.
What is still unclear is who wanted that originally – and there is a documentation that probably shows that, but is somewhere hidden in a big collection.
So, tech debt is apt.
Also not clear why Unicode included just this glyph.
@0xabad1dea You inspired me to write about this more! https://unsung.aresluna.org/no-one-knows-what-angzarr-is-meant-to-represent-or-where-it-originated-from/
@mwichary @0xabad1dea Also FWIW, searching for “angzarr” in the macOS Character View doesn’t find it. When I search for “⍼” it of course works, where its description is “RIGHT ANGLE WITH DOWNWARDS ZIGZAG ARROW”.
@theory @0xabad1dea Yeah, I noticed that! Yet another example of creeping complexity? But I didn’t want to overload the piece.
@0xabad1dea @theory Oh, like an HTML entity kinda thing…
@mwichary @0xabad1dea why is the horizontal stroke so long in the inset version? It extends very far to the right!
@glennf @mwichary @0xabad1dea Horizontal line is the same length as the vertical. Consistency!
It’s only circular financing if it comes from the Santa Clara region of California. Otherwise, it’s just revenue recognition fraud.
New phone. Looking forward to all the time I’ll save dialing by storing my contacts… on punch cards!
In light of the Lemon Squeezy news, I'm making my theme-based Mac utilities free to download. I am happy with what I've created, and I'll continue to use and update them, but it isn't worth the effort to find a new merchant of record right now.
https://motorcycl3.com/retroStrip
https://motorcycl3.com/incidental
oh yeah, wave ceptor
“you know what would improve this discussion? a shitty xkcd you’ve seen before” GEE THANKS
maybe I’m allowed to think we should legally require a connectivity standard for smart home devices because otherwise they’re just horrible profiteering spy devices. I’m not even proposing we create a new standard. whatever fucking wireless PHY and MQTT is fine. was your takeaway from the comic really that standards should never ever happen? fuck off.
maybe I’m allowed to think the sudo logo is fucking ugly and horrible and so is the comic it was inspired by.
rick & morty is family guy for engineering dropouts who love musk
xkcd is rick & morty for people who work in the industry
come at me motherfuckers you know I’m right
Source code is a theoretical representation of what runs on your system. Compilers may add security boundaries, or (because you've accidentally triggered undefined behaviour in C) remove them. The binary is the only true representation of what's exploitable. Do we have any figures on whether analysis of source code is better or worse than analysis of the binary, especially if the binary is accompanied by debug symbols?
@mjg59 I tell the customer to PLEASE give me both. And then I flag UB that isn’t exploitable in the current binary but is going to randomly explode at some unknown point and they just shrug and say they haven’t touched the toolchain in 13 years so why would they ever
@0xabad1dea @mjg59 Reminds me of the one guy (I forget the name) in comp.lang.c who was actually able to use gets() safely. (Because he only compiled his code on DOS, which has some hard upper bound on standard input, or something like that.)
One of the major vendors in the automotive space said that they couldn't adopt CHERI because having traps on bounds failures might violate their realtime requirements. They had a notion of a 'benign' memory-safety bug, where the undefined value that they read is not important or where the corrupted value is not used later. As long as their test vectors work, they are happy. I pointed out that, if their test vectors trapped with CHERI they could fix it. I argued that if they changed their compiler / linker, or any unrelated bit of code in the same component, then the memory layout might change in arbitrary ways and make their benign bugs malign. They did not find either argument convincing.
@mjg59 The binary also might not tell the whole picture, as the various microarchitecture dependent speculative execution vulnerabilities that have come up in the last decade.
a long time ago, i made a static verifier for Python that converts source code into "formulas" (z3 theorems) and then proves them. at some point, i experimented with doing the same with bytecode but there is more of it, so proving that requires more resources.
it's a bit different to the binary analysis that you describe (there is still Python interpreter running that bytecode), though.
@mjg59 I guess you saw this? https://deepmind.google/documents/36/Formal_Verification_of_Signal_4.pdf
@mjg59 Waiting for the day compilers will be swallowed by slop code that then ship binaries with "quirky" behaviour.
@mjg59 the Veracode team certainly thought so back when I was in that space and looking at appropriate static and dynamic analysis tools. Unfortunately we didn't get the opportunity to test their claims as they required our binaries, which wasn't going to happen due to classification. We ended up with Klocwork, then some early fuzzing tools..
@mjg59 This is basically the reasoning behind static and dynamic analysis. You run the first (with a good strict tool and serious rules) to check your source code, then you run the second one to verify the produced binary code.
If you apply for ISO 26262, IEC 61508, and other safety standards, you are required to do it on 100% of code - besides a ton of other rules, of course.
@mjg59 Not a scientific measurement, but people were using all sorts of source-code based analysis before to find timing side channels in RSA, and then Alicja came along with better statistical tools and binary analysis, and found timing side channels in just about *every* implementation of RSA again: https://people.redhat.com/~hkario/marvin/.
So yeah, from anecdotal evidence, look at the binary.
are you interested in buying/playing
| block game: | 296 |
| you have died: | 235 |
in case you don't know what you have died is its a part dating/life sim part old school dungeon crawler for DOS (and windows/linux) https://mastodon.gamedev.place/@eniko/117118076133387293
Eniko Fox boostedand that's the combat system all done for You Have Died (And Been Reincarnated As A Fox Girl), a sapphic dungeon crawler/dating sim for windows, linux, and 486 MSDOS. check out this combat demonstration, keeping in mind that the values being plugged in are still all placeholders
@eniko do you have a placeholder site I can send people to, or just the post?
@eniko do you have a post explaining the gameplay of block game? I remember cool tech posts, but not much about the game itself
@bnut you mean besides the website? (https://enikofox.com/blockgame)
@eniko Both. Both is good. also annoyingly I meant to click you have died as well, but my cat decided then was a good idea to headbump my hand and shift the mouse down as I clicked so -_-
I'm seriously thinking on working on a (commercial!) video game, and I'm somehow really tempted to make it for CGA composite+EGA and PC speaker+SB. It'll work like a charm on all modern platforms because emulating PC is very easy. But I wonder if most players would want richer graphics 🤔 like, would you even buy a DOS game in 2027?
@nina_kali_nina Whether I would buy a video game depends on lots of other factors (how much does it cost? does the concept appeal to me? where is it sold?), but running on DOS in CGA would be in the game's favour and make me more likely to consider it! I have access to a computer with a beautiful orange gas-plasma display, CGA, 1MB RAM, and if I could play a new video game on that, that would be cool
@nina_kali_nina I'd say yes, remember when SKALD: Against the Black Priory launched two years ago? It got raving reviews and I guess sold fairly well. It wasn't technically a DOS game but it was retro enough that you really needed to be into that kind of stuff to appreciate. I made a short thread back then: https://fosstodon.org/@gabrielesvelto/113392694015811842
@gabrielesvelto wow,. it's beautiful
@nina_kali_nina If I get back into game dev I would probably target DOS for much the same reasons. EGA is plenty since you know how to use pallets and whatnot.
"Would you even buy a DOS game in 2027?"
I would, yes.
@nina_kali_nina Although it is not a true DOS game, I bought, played and enjoyed The Eternal Castle, which uses a CGA color palette. So, if the gameplay is good, the concept is interesting and it uses its limitations well, I don't see why I wouldn't buy a game like that.
@nina_kali_nina 8-Bit Guy made a game for DOS few years ago (Planet X-3). From what I've seen, there's more than enough demand for that olde style, so....go for it.
@nina_kali_nina I bought Retro City Rampage twice, once on console and a second on PC so I could get the 486 DOS version. That's been nearly a decade ago though.
I bought The Aching much more recently, specifically to play it in DOS.
Not a fan of the author any more, but I also bought Planet X3 for DOS when it came out.
A few years ago I reached out to the author of a 90s MSDOS shareware title to buy a registered copy of it.
If it's a good game for DOS, you've got at least one sale here.
@nina_kali_nina I wouldn't doubt there's an audience for it, I saw a few PS1-esque games doing well on Steam and Warhammer 40K Boltgun is made in Build Engine
@nina_kali_nina For a (non-commercial) warm-up:
https://itch.io/jam/ms-tres
(You don't have to participate; even hanging out with these folks on their Discord server should be helpful and insipiring.)
@nina_kali_nina
What does Dwarf Fortress run on?
@11backslashes well, I also make games for old platforms, but I'm not sure if targeting an old platform is an advantage (probably not for most players)
@11backslashes so they do, but I feel like it is easier to make appealing graphics using less intense palettes, and graphics sells. For this reason I've been considered GBA as my target platform, but I also love PCs
@nina_kali_nina @11backslashes EGA could potentially be less garish than CGA with its larger palette to pick from.
@nina_kali_nina The Aching is a recent-ish parser adventure game. I bought it on steam, it's actually a DOS game, ships with the emulator. You wouldn't guess it's not a native game.
@nina_kali_nina Absolutely, there are plenty of examples. Starting e.g. with Undertale, which could have been done on EGA more or less.
@nina_kali_nina Whether or not a game has good graphics has been at the bottom of my list of considerations for decades now. The only thing that matters is, is it fun? And retro is in.
That said, expectations are lower in the indie retro space. A quick look through itch suggests you couldn’t charge more than $10 for it.
@nina_kali_nina so @JuliaMinamata released an EGA game a few years ago:
https://store.steampowered.com/app/1098770/The_Crimson_Diamond/
You can ask how it went!
@nina_kali_nina I bought a DOS game in 2026, so I'll probably do the same in 2027 if the right game appears.
@nina_kali_nina I like the look of Dos games but speaking as someone who has played games in emulators for the last 25 years I think of dos as a bit more of a pain to emulate than other systems. I can and would do it but I wonder if it would become too much of a niche within a niche. Definitely a lot easier than Windows 95 though.
@nina_kali_nina Retro-communities still have a rich market of new games on retro-platform; its niche, but there is an active market.
Check for example @thalamusdigital
A proper DOS game has the plus to run anywhere there is an emulator available, and the modern reimplementation of FreeDOS, not only original hardware and configurations.
If I could, I would ship a green CRT as a part of every computer project I'm working on. Look how nice it is! https://ninakalinina.com/notes/win2apri/
@wyatt pretty 😍
@nina_kali_nina @wyatt every time I see an AT&T 6300 I must SQUEEEEE (this was my childhood machine)
@nina_kali_nina Amber or paper-white are my preference, though green is very nostalgic for me (that's what all the Apple IIs I grew up with had).
Hard agree on how beautiful monochrome can be, though!
@nina_kali_nina i wonder if there is worldwide anyone still making monitor-class CRTs (the vacuum tubes) and could perhaps run a batch in green and orange colors
Would perhaps buy two or three to play
Building the electronics is quite easy if the goal is something the works well (and not something as cheap as possible)
@Laberpferd IIRC no one is making CRTs anymore, it is likely a lost technology
@nina_kali_nina @Laberpferd yeah but you can get some high resolution monochrome LCDs, 4k and 8k, for resin printing.
There might be some specialist manufacturers of CRTs left. They were still making them for commercial use until 2017.
https://www.hdtvtest.co.uk/news/chinese-brand-appears-to-be-selling-new-crt-t-vs-online
Specialists
https://moores-glass.co.uk/products/cathode-ray-tubes/
https://www.thomaselectronics.com/manufacturers/
@nina_kali_nina I'm missing the heck out of my little Apple //c monitor right now.
It had composite video in, so I could plug in the VCR and watch TV.
@nina_kali_nina
That's a reasonably high res one I think. I used to have a green Hercules-compatible monitor and it wasn't good, like a C64 had better graphics quality.
How many feeds do you guys have in #TapestryApp?
I feel like I have to be on the high end with 144 😅
@developerjustin @maique For now 30 Feeds like to add more but connector with Reddit is broke, people known an workaround? #tapestryapp @Iconfactory
@DimitryJacobs @developerjustin @maique Reddit has deliberately taken steps to keep apps and services like Tapestry and others that use RSS from working with the service and a workaround is unlikely to be forthcoming unfortunately. We recommend removing or disabling your Reddit feeds from the app sadly. Sorry.
🤔 Hackers can't steal your data if they're still waiting for your annoying sister to get off the landline so your dial-up modem can connect
a cool fact about computers is that it doesn't have to be like this
none of this shit has to be like this
Moon sweater!
https://knityak.com/collections/moon?utm_source=mastodon&utm_medium=social
designed by me using real topographic data of our Moon from public domain NASA LRO LOLA (Lunar Orbiter Laser Altimeter) elevation data. for this particular sweater i picked my own spot on the moon https://knityak.com/products/your-spot-on-the-moon?utm_source=mastodon&utm_medium=social
this is a kid's size classic fit 9/10. it is knit in four color greyscale with pretty dithering. the inside is birds eye double bed jacquard sort of checkerboard looking and smooth. you can see the inside behind the collar.
#Moon #lunar #space #knitting #spacedata #lunarreconnaissanceorbiter #lunarorbiterlaseraltimeter
The Internet was designed for decentralized services.
Personal computers were designed for running things locally and get away from mainframes and terminals.
Laws were designed to prevent monopolies.
Fast forward 30–40 years and we now have like two mainframe rental providers used by essentially everyone: individuals, companies of all sizes, the military, governments.
And of course instead of breaking this shit up we’re stuffing this dependency into every last device remotely possible.
So like all problems this is a social problem, and social problems are political problems: if we don’t forcibly break the fucking giant corporations up this will only get worse.
@thomasfuchs And there's a limit to how much we can do on an individual basis. I mean, *I* can try to avoid this as much as possible in my personal choices, but my employer is making different choices for different reasons. So, yes, other forces must be brought to bear: boycotts, political pressure, whatever is available.
@thomasfuchs
its called capitalism
@Kampfdiestel @thomasfuchs
capitalism ensures there’s a healthy competitive market and ensures governments remain bigger than any single private entity to regulate and prevent monopolies.
We’re way past capitalism now.
Plutocracy and kleptocracy and more like inverted totalitarianism.
@amirbkhan correct
@thomasfuchs @amirbkhan
Get worse? Yeah, you could say that...
❝...These billionaires WILL fucking kill you, to keep doing capitalism on a boiling planet. They're installing fascism so you don't have a choice, they're controlling police states because they mean to preserve their world order, with violence--that's actually why security forces exist, everywhere...❞
- AnarchoNinaWrites
@thomasfuchs
Correct. But it fundamentally contradicts the principles our countries are built upon.
Money always centralizes due to the falling rate of profit. Money is power so it only works this way. Money buys the majority opinion, democracy is majority rule. Democracy does not exist under capitalism.
Sorry. If you want to keep your capitalism, get in line for the food stamps because that is the only future.
Otherwise, you can contact us on https://solidnet.org
@thomasfuchs Them: Capitalism is great, because competition is healthy!
Everyone else: so why is everything run by effective monopolies, or large duopolies that barely compete?
Them: Capitalism, baby!
Sorry, folks, the mainframe is down...
No weather today?
KDF9 => CRAY => Azure
P.s. what happens when the Russian 'trawlers' break the undersea cables?
@thomasfuchs individuals, companies, militaries and governments can choose not to put all their IT eggs in one basket, but most do it anyway. Not sure why but the options are available.
@thomasfuchs
The internet was designed by ARPA, part of the Dept Of Defense in the USA, to allow bases to communicate even if a few were taken out by a nuclear bomb.
Then we turned it over to bigCorp and they have turned it into a system that can be taken down by one third-shift underpaid temp worker making a typo in a config file.
The only upside is the bigCorp are highly profitable.
#democracy is more than voting
@thomasfuchs
Well the internet still works exactly as designed, as do personal computers. There's absolutely nothing wrong with either of them.
So yes, a human issue.
@thomasfuchs Err...my first recollections of the internet (late 70s early 80s) were requiring centralized services. The IBM PC was developed due to monopoly injunctions, due to their mainframe monopoly. I can't say I ever heard any other personal computer company (Apple, Commodore, Atari, Acorn, Heath, ...) express any altruistic intent. The "computing was better back then" sentiment is more about newness of technology, than any imagined moral sentiment.
@thomasfuchs yeah especially laws were design to prevent too big centralization. What happened???????
@thomasfuchs the majority of ppl dont understand how their consumption is keeping them in chains they dont even know they have. one can only start with the self, then family, then friends, then community.
if you want to quicken the pace, sell it as sth cool, convince as many as you can that leaving social media, boycotting, etc will make them cooler and buy them some status, and they will follow. once outside, maybe they will understand on their own.
"Laws were designed to prevent monopolies."
I stopped reading as a libertarian after reading that LMFAO!
@thomasfuchs This is true, but self-hosting is actually a difficult thing to do. Which I hoenstly think a lot of people forget. It's one thing for you or I to do it -- we know how and have al lthe knowledge and tools. But try having some average joe self-host an email server or something. That barrier is the first that needs to go, and then true decentralization will be feasible. Until that does, there will always be a degree of centralization, and the question is more of how much centralization we're willing to tolerate
@draeand There’s other things than “everybody does self-hosting” and “everybody uses exactly 2 large corporations”
@thomasfuchs we can’t have ai in personal computers yet. There’s not enough compute capacity. We need to wait until better computers get affordable to the masses
Das Internet war für dezentrale Dienste gedacht, der PC für die Flucht vom Mainframe, das Kartellrecht gegen Monopole.
30–40 Jahre später mieten alle, Privatleute, Firmen, Behörden, Militär, Rechenzeit bei zwei Großrechner-Vermietern. Und wir stopfen die Abhängigkeit in jedes Gerät mit Stecker.
Kein Technik-, sondern ein politisches Problem. Ich sag's nur: zerschlagen statt zuschauen.
#cloud #dezentralisierung #monopole #schicksalsjahreeineskaisers
@thomasfuchs I think who owns these companies is what matters the most. They could be owned by its end-users and run as consumers' co-operatives or owned by some global institutions and run by citizens (of the world) assemblies, or other forms of management that all the stakeholders can have a say (workers, customers, municipalities where the infrastructure is located etc.).
We should also force rules that make migration from one platform/service-provider to another easier.
@thomasfuchs The Great Oops is inevitable at this point, though I don't think anyone will learn anything when it happens.
@thomasfuchs But yet when you suggest moving email back on-prem, all the IT folks whine that its easier when it's someone else's problem.
We should all agree this was nice, actually, and make No Email, No Calendars, No Meetings Day an international holiday
@0xabad1dea The only way I noticed that outlook was out was that I got a lot of email to my personal email account.
Obviously one of my colleagues is a rat.
@0xabad1dea Looks like I didn't participate in that.. At my work we host everything ourselves, so I really only noticed once I read this news.
Oh no wait, that's actually a good thing.
@0xabad1dea
and use the date, Fri the 13
hence forth fri-13 is international disconnect day; the first true international holiday for all people of all religions and beliefs.
my husband said to me two hours ago “no man cheats exactly twice, it’s one horrible mistake or it’s something he does constantly” and one hour ago a third Allegation hit the video card
@0xabad1dea That's just an application of the zero-one-infinity rule (http://catb.org/jargon/html/Z/Zero-One-Infinity-Rule.html)
@0xabad1dea Yeah, I had a similar thought when I heard number two was a work colleague. The guy hasn’t shown any concern about getting caught or optics.
I mean the fact that the most widely used photo is him signing some woman’s bra says this guy thinks he’s a rockstar with no chance of facing consequences.
@0xabad1dea yeah it was obvious there were more than 2.
to quote someone, "If you find two ants in your kitchen, the best estimate of the total number of ants in your kitchen is not two"
@0xabad1dea i only just now realized that there's a good chance that the spy was sent to exploit him with sex because people at nvidia already knew about this liability
@0xabad1dea I knew someone that went to a hardware store to get a trap because they saw a rat in their basement.
The nice fellow behind the counter said "Lady, you ain't got a rat - you got rats".
This is a story about infidelity.
@0xabad1dea the love of money truly is the root of all evil.. not only avaritia and fornicatio, now he lives up to the namesake invidia
Cow on grass - 2026
If you are using an iPhone and would like to contribute to OpenStreetMap in a very easy and gamified way: @streetcomplete is now out for iOS!
Your contributions will not only improve CoMaps, but a whole range of OSM-based applications:
@CoMaps @streetcomplete I've been using StreetComplete for quite a few months now on Android (although not as much recently for lack of time, sorry), and indeed it's a very fun AND useful app. It makes it so easy to contribute to OSM "on the go". Nice to see it ported to iOS. Congrats for your work!
@CoMaps @streetcomplete It was already available for Android, so Android folks can contribute as well.
@CoMaps @streetcomplete this is surprisingly well made!!
I can finally mark the building across the street as abandoned!
However, I don’t understand how to mark mixed use buildings (shops on lower floor, residential above)
@CoMaps @streetcomplete
Street complete was the tool that got me really contributing to OSM and it's great to see that it is now accessible by more people.
@CoMaps @streetcomplete Is it possible to turn off the gamification part and don't feel pressured to keep adding things? I just want to be able contribute at my own pace.
Not to mention that the app awards the amount, not the quality of contributions.
@CoMaps @streetcomplete I like the idea, but I can’t answer the first one I looked at because it doesn’t have the right answer. The answer should be yes. Is there a way to say “none of the above”?
@CoMaps @streetcomplete It's very cool. I usually use another, more "professional" app, but this one will make it easy to do some in-depth work.
Bravo!
#Developers of Mastodon, I'm curious what kind of software you work on in a *paid* capacity. Please share for reach x
| SaaS & Corporate Products inc bespoke: | 0 |
| DevTools e.g. Visual Studio, Jira, GCC: | 0 |
| Platforms/OS e.g. Apache WS, OpenBSD: | 0 |
| Other - I'll comment (thanks!): | 0 |
@sashabilton i make video games
@eniko B2C? Other? You're a special (awesome) case, as you are an indie who solely works on your games as far as I can tell. I wanted an option for that, but I was only allowed 4.
@sashabilton yeah i wasn't sure so i picked other, but i guess B2C actually applies?
@eniko yes technically B2C, I think.
@sashabilton yeah i think so. sorry, i just saw SaaS and corporate and kinda mentally skipped to the next choice
@eniko I completely understand. I think I might edit to be clearer, actually.
@eniko @sashabilton
yep.. TBH that first answer is way too broad - it even puts open source software (that's no devtool or platform/OS) in the same category as SaaS
yes, mastodon's limit of 4 choices sucks
...but could Yorick's jests be put in a one to one correspondence with the set of natural numbers?
@attoparsec "A fellow of infinite jest" reads to me as a measure of his (continuous) jest, which would presumably have a congruence with the reals. So I would guess no.
RE: https://infosec.exchange/@0xabad1dea/117475066389746858
The post-mortem has finally confirmed my intuition that this was a classic “confuse first byte of array for whole array” data processing bug.
A few people were weirdly hostile about the suggestion that it was probably the same way we’ve been corrupting numbers for 50 years and not the newest, least efficient way to corrupt numbers. Unfortunately, gaining a dreaded new Nemesis has not made all of software engineering’s boring old rogue’s gallery retire
okay, I’m way too late to post xkcd “4” comic and still be funny, so instead I will have to write a serious post
Could this disturbingly severe mistake be because someone asked The Cat for a certificate? Hypothetically, yes. But there’s absolutely no reason to jump to that conclusion with self-righteous confidence when all serious infosec experts have been screaming for THIRTY YEARS that our programming languages are designed to maximize the probability of catastrophic mistakes in cryptographic code even when handled with care by experienced professionals.
Here’s what we know: several signing certificates from the same issuer with private keys that are, in their entirety, just a number below 256, all the way down to the comical “4, just 4, that’s not a typo, the private key is 4.” This strongly suggests a bug where the first byte of the intended key, treated as an array, was used rather than the whole key. A bug that’s absolutely, positively trivial to write in C and its descendants. I’ve seen proposals for how to gotcha yourself like this in Go as well.
I’m not saying The Cat isn’t involved, it could be. But you absolutely, positively do not have to ask a mischievous clawed agent for a random number for it to go this horribly wrong. We’ve always had the human strength within us to fuck up this bad all along
(And I do assume it’s a fuckup and not a backdoor, because there’s no reason to design a backdoor such that the next random enthusiast to run a sanity check script on public certificates will instantly spot it and start screaming)
@0xabad1dea yeah people blaming LLMs for everything with zero evidence is... tiring.
@gsuberland @erincandescent @0xabad1dea yeah I agree. A single test run with normal key values and seeing a round trip failure would've caught it.
(I'm still more concerned by the idea the keys were not in the HSM somehow though???? that's like. a problem for more than just their webroot compliance)
@Lunaphied @gsuberland @erincandescent they were exporting them from one HSM to re-import in a different HSM for reasons that still aren’t entirely clear to me after reading their extremely jargon-heavy postmortem https://bugzilla.mozilla.org/show_bug.cgi?id=2083449#c82
@0xabad1dea @Lunaphied @gsuberland @erincandescent And they did not even test the procedure with the intended target HSM, but with a re-import on the source HSM. While trying to dodge deadlines.
@0xabad1dea kind of an impressive feat to do this mistake in Python, where it’s at least a little bit difficult. I am dying to see the actual code and not just a summary of an “index not a slice”
like somebody needed to do that, then they needed to turn that integer *back* into a buffer to cram it back into the HSM. I really want to know how they typed that line of conversion code without realizing what it meant
@0xabad1dea broke: programming problems solved by AI
woke: programming programs caused by AI
bespoke: programming problems caused AI