HNHacker News
TopNewBestAskShowJobs

cyphar

12,721 karma · joined July 9, 2014

  Aleksa Sarai <cyphar@cyphar.com>
    pub   ed25519 2019-06-21
    C9C3 70B2 46B0 9F6D BCFC  744C 3440 1015 D1D2 D386
    <https://static.cyphar.com/cyphar%40cyphar.com.pub>
U+1F574. Founding Engineer at Amutable. OCI maintainer (runc, umoci, runtime-spec, image-spec) and TOB member (2019-present), Linux kernel developer, openSUSE packager, FOSS guy through-and-through.

github.com/cyphar ; www.cyphar.com

submissionscomments
cyphar··on Better HTTP/1 connection reuse in Go 1.27
This can happen without HTTP, we hit this issue in runc a decade ago[1] -- some container invocations would mysteriously error out with ECONNRESET and if you added a dummy environment variable they would work again.

Turns out that json.Encoder always appends a newline but (as GP said) json.Decoder will not attempt to read it if the JSON is complete at the power-of-two byte boundary (IIRC the buffer doubles for the first few iterations). The extra byte in the pipe when closed then causes reads and writes to go boom. We switched to using json.Marshal because it doesn't output a newline (sadly the encoded form isn't streamed as a result).

I still get twitchy around encoding/json as a result of that experience.

[1]: https://github.com/docker/docker/issues/14203#issuecomment-1...

cyphar··on Anthropic's Scion is heavily inspired by Mononoke
Not about the details but the marketing story is all about how "agents" are building so fast they need to design new infrastructure for the new world, etc. Extra points if you spin it as though the "agents" have built some new never-before-seen architecture that is clearly better than the "human scale" stuff.

The intended audience is obvious from first paragraph alone:

> At Anthropic, coding is no longer the bottleneck to building systems or doing research. Claude is able to autonomously iterate on research loops, micro-optimize complex programs, and build new services from the ground up at a speed and scale we haven’t seen before. The bottleneck, now, is all of the developer infrastructure built for human scale: source control, builds, and CI.

Translation:

> We are so far at the cutting edge we need to build shiny new infrastructure to replace the smelly "human scale" cruft. How could you /not/ value us at $2T?

cyphar··on No portable way to detect string-to-float conversion errors in standard C
I'm not a C++ guy (aside from the odd patch to upstream projects) so maybe I'm missing something but are you talking about structured bindings? AFAICS those were added in C++17, so Rust had them for much longer. Besides, I would argue Python is the real inspiration for C++ here.

In Rust "tuple unpacking" is really just a special case of pattern matching, which is a far more powerful concept and was actually taken from OCaml.

cyphar··on No portable way to detect string-to-float conversion errors in standard C
> In Go, the only way to consume a multi-return is to use a full assignment statement to assign each return value to a variable, and then use the variables.

There actually is another way, but it isn't really that handy (as it is basically just shorthand for multiple assignment):

    func mustInt(v int, err error) int {
        fmt.Printf("got: (%v, %v)\n", v, err)
        return v
    }
    
    func foobar() (int, error) {
        return -123, nil
    }
    
    func badbeef() (int, error) {
        return nil, fmt.Errorf("moo")
    }
    
    func main() {
        vals := []any{
            mustFn(foobar()),
            mustFn(badbeef()),
        }
        fmt.Printf("got vals: %v\n", vals)
    }

You can use generics but it's still not that useful because you are quite limited in what you can do with the return value:

    func mustFn[T any](v T, err error) T {
        fmt.Printf("got: (%v, %v)\n", v, err)
        return v
    }
    
    func foobar() (int64, error) {
        return -123, nil
    }
    
    func deadbeef() (string, error) {
        return "weird name for a cafe", nil
    }
    
    func badbeef() (*int, error) {
        return nil, fmt.Errorf("moo")
    }
    
    func main() {
        vals := []any{
            mustFn(foobar()),
            mustFn(deadbeef()),
            mustFn(badbeef()),
        }
        fmt.Printf("got vals: %v\n", vals)
    }
You could define your own Result[T any] and do sum types (and people do) but the ergnomics for it are completely awful and readability goes out the window. (Insert grumbling about bolt-on features.)
cyphar··on I think I found a planet nobody knew existed. I used Claude Code to find it
The short answer is that there are a lot of stars and even more data.

When I last did astrophysics research half a decade ago (as an undergrad) the workflow for doing research boiled down to writing pipelines to clean the data and then have scripts to find interesting candidates and analyse them automatically. It was necessary to filter stuff to reduce false positives, so it's possible this candidate was just missed by such scripts.

It's also possible this star is in some PhD student's dataset and they just haven't published yet. Astrophysics papers in this vein usually focus on techniques for classification and data science so you'd expect to have at least dozens if not hundreds to thousands of interesting stellar objects before you have something worth publishing unless it was some truly novel technique. A paper just saying "we found an exoplanet" isn't particularly interesting these days, as it turns out there are a lot of them.

(I haven't looked at the data and I'm sure my skills have atrophied by now anyway, sadly.)

More power to the guy who did this (astrophysics is probably the most hobbyist-friendly science since a lot of the data is public and the only lab equipment you need is a laptop) but I suspect "ordinary" folks are far more impressed by this than astrophysics folks. A decade or two ago exoplanets were still thought to be very rare but we've since figured out they are quite common and have moved on to cataloguing them.

cyphar··on Ask HN: What do you run on a $5 VPS that's worth keeping online 24/7?
There is some evidence that Tor has posed significant problems for three-letter-agencies in the past, so it's not like there is nothing to be done at all.

But there is a bigger point to be made: in my experience most privacy activists argue that taking an absolutist stance personally is counter-productive -- just because it is almost impossible to completely eliminate risks from your life does not mean you should give up and not try to minimise them. And of course, the goal for most people isn't to protect against targeted attacks (since that means you already need to take fugitive-on-the-run-level precautions), it's to avoid becoming a target in the first place.

cyphar··on Ask HN: What do you run on a $5 VPS that's worth keeping online 24/7?
"We kill people based on metadata." - NSA Chief Gen. Michael Hayden, 2014[1]

In case you were not aware, spooks have focused on metadata analysis over "full take" (data) analysis for a very long time because they are far more effective and require less data to analyse. This has been the case at least since the early 2000s with Stellar Wind but arguably even the Stasi worked this way -- they cared a lot more about who you were talking to than what you were talking about. The Snowden revelations in 2013 talked almost entirely about metadata-only systems that were being used to invasively surveil the world.

If your point was more "I have nothing to hide" then you can find plenty of articles online to disabuse you of that notion. There's even a Wikipedia article about it[2].

[1]: https://abcnews.com/blogs/headlines/2014/05/ex-nsa-chief-we-... [2]: https://en.wikipedia.org/wiki/Nothing_to_hide_argument

cyphar··on Cloudflare K2: serverless event streams
I worked on OCI for quite a while, the very short and cynical answer is that Docker thought the registry was their moat for a long time and fought tooth and nail to keep it at the detriment of almost everything else. (The longer version is a bit more diplomatic.)

Even better, the OCI distribution protocol (which was Docker distribution until a few years ago) is not a static-blob-over-HTTP protocol! The blob bits are and you can route them to blob storage but you need a smart server for a few key bits of the protocol.

Back in the day I made proposals for distribution formats that didn't have these flaws and were more distributed (and previous proposals like AppC's discovery had similar ideas) but they were roundly rejected by the Docker people.

cyphar··on From Thin Air to Bootable Images: The Tine Build System
Disclaimer: I work at Amutable but not on tine (though we did discuss this internally a fair bit, as you might expect).

Nix does have a similar model in some respects (in particular the idea of input-hashed build graphs) and so solves a lot of similar problems but there were a few important factors that made us not go with Nix (or NixOS) and instead go with Buck2.

As the blog post mentions, the ability to build directly from a wide variety of upstream distribution artefacts and maintain temporary deltas was incredibly important to us. Our team has a lot of old-school packaging experience (I've done packaging for (open)SUSE for over a decade now and we have former and current Fedora, RHEL, Ubuntu, and Debian packaging folks with even longer histories) and our view is that distributions do a lot of thankless and incredibly valuable work and the most painful part of maintaining a distribution is the deltas you have to maintain forever after you've hard-forked packages or repackaged them. Buck2 allows us to create models for these concepts (which are in tine) without needing to boil the ocean repackaging upstream packages. But Daan and Martin are far better equipped to get into the weeds on this topic.

On the more general topic of why not use NixOS, as discussed in one of our other recent blog posts[1] we are make heavy use of sysexts and the /nix/store combined with the general linking model of NixOS (while very technically impressive) does not play particularly well with that model. I should also mention that we have a NixOS guy on our team too so you'd better believe NixOS came up in conversation. :D

[1]: https://amutable.com/blog/it-starts-upstream-kernel#image-ba...

cyphar··on Platform-independent SIMD in Go
> Those a usually wrapped in a mutex, or used with sync primitives like sync.Map.

The same can be said of C or C++ constructs (and many "anti-Rust" people have historically said that) -- the point is that their use is not enforced by the language and so bugs can lead to panics.

I write a fair amount of Go and Rust so I really don't think either language's flaws are fatal, but it comes off as weirdly defensive to redefine memory and data safety to be "well if you use it properly it's safe". It's totally fine to say this is a problem the Go language did not find important enough to require compile time enforcement and so solving it is done by convention and testing with the race detector (which a similar answer C and C++ give to this problem).

cyphar··on WordPress: Unauthenticated path traversal leading to conditional RCE
This kind of bug pathology is incredibly common in all sorts of programs and is the reason (disclaimer: self-plug) I wrote libpathrs[1].

Sadly, almost all language standard libraries do not provide the right abstractions for dealing with files (the primary focus is on global paths as opposed to scoped paths or file descriptors / file handles) so it's little surprise bugs like these just keep popping up every few weeks.

To eliminate these from your codebase you need to rethink and really focus on being aware of how you deal with files. If the program you're writing has root privileges then you need to be more careful about misdirected writes to /proc or other pseudofilesystems.

[1]: https://github.com/cyphar/libpathrs

cyphar··on UTF-8000: Unlimited UTF-8
Even better, it's arguably both -- surrogate characters are valid codepoint values so technically UTF-16 is fixed-width but programs need to have special handling for surrogate pairs meaning it is practically variable-width.

Truly the worst of all worlds.

cyphar··on Show HN: An e-ink frame that hears birds and draws them as 1800s illustrations
I think there is ample evidence that the Wright brothers were (unlike many other inventors) uniquely suited to solving the problem of heavier-than-air flight, as they solved several open problems that nobody was making progress on (the main ones being control authority, propeller designs, the scientific basis for wing designs, and the ability to test designs and practice without dying) -- they even discovered and solved previously-unknown problems (such as adverse yaw, something their contemporaries should've independently discovered if they were on the right track).

A full rundown would be too long but [1] is a pretty good video going through the history of flight and how most of the other candidates for "first flyers" people bring up don't count and how it's difficult to argue that any of their contemporaries were even close to the Wrights.

[1]: https://www.youtube.com/watch?v=EkpQAGQiv4Q

cyphar··on The EPA is planning to scrap public review rules for data center pollution
If the need is driven by a bubble economy, when the bubble pops the demand disappears too. This can even lead to a separate bubble popping (see: the dotcom and telecom bubbles).

Yes, datacentres can be reused for other purposes but dark fibre didn't save the telecom bubble and the utility of train tracks didn't save the railway bubble.

cyphar··on Among European Companies That Use a CDN, Nearly 9 in 10 Use Cloudflare
If your site is static you can host it on CF pages for free with unlimited* egress.

* of course it's not unlimited unlimited but I've not heard of anyone being cut off.

cyphar··on It took a year to ship WebAssembly in Anubis
Not to mention it is the least efficient representation of git commits. It seems a lot of people are unaware that git generates the diff representation you see with "git show" on the fly -- internally, commits are Merkle trees representing a snapshot of the repo file contents.

As you said, if you actually want to interact with a remote git repo you'd do so with packfiles not diffs.

cyphar··on 2004 RuneScape fit a multiplayer RPG into 56k dial-up
As a kid, I didn't have a computer that could run WoW, nor would I have been able to convince my parents to pay for the subscription. I suspect most of the popularity was from kids in a similar situation, probably playing it on library computers when they should've been studying.

MapleStory was also quite popular back then for similar reasons.

cyphar··on “I just chose words carefully”
You're quite right that the rules are clear and native speakers get them correct almost all of the time (I've not seen one get it wrong while speaking but some people were taught it as a spelling rule at school and so tend to write it incorrectly), but the difference is that different speakers pronounce the leading "H" differently.

In Australia we pronounce the H more like "heitch" while in the US people tend to pronounce it as "eytch" (IPA would probably more descriptive here, sorry!). In the UK it's a bit more of a mixed bag, as others have already elucidated.

"Ambiguous" was probably a poor word choice, I meant to say that because both ways of writing are technically valid based on the accent of the author there is an element of freedom in the choice that tells you something about them.

cyphar··on “I just chose words carefully”
My understanding of shibboleth is that it refers to the primary pronunciation identifying the speaker (which is how it was used biblically).

Those are also interesting but it feels a bit more special to me when it's a secondary speech characteristic because it feels a bit more like a clue in a detective novel -- it almost feels like you can hear inside the author's head and how they vocalise while they write.

In this case, "missle" is a malapropism that is only possible if you don't pronounce the second "i", and so is a secondary "speech" characteristic.

cyphar··on “I just chose words carefully”
And are British, at least in Australia (and the US, I guess?) we pronounce the second "i".

It is always fun when you notice where someone is from based on secondary clues like that -- my favourite is the choice of "a" or "an" where it is ambiguous (for instance, I recently ran across "an HTTP request" where I would've said "a HTTP request").

cyphar··on Judge sets framework for Nine PBS to retrieve archival data
> It's unfair when you do the best you can and suddenly you have to talk to lawyers.

Well, PBS didn't do the best they could. Aside from the whole "one backup is no backup" problem, they should've immediately made a new backup as soon as Open Source Storage didn't want to renew their contract and stopped responding to them.

That's the most screaming-red, horn-blaring, strobe-flashing warning that they were about to go under and it was the job of the PBS CTO (who makes $180k/yr) to recognise that and respond immediately (i.e., send an intern the nearest Best Buy to buy 70TB of HDDs, they'd probably still have enough space in their bag to do a coffee run on the way back).

> Wasn’t there an avenue for the CEO to send a letter to Iron Mountain mapping the data and its owners or make an arrangement to legally transfer the data or something?

And if they made a mistake in providing the mapping (given they were a company going bankrupt, they might have trouble getting staff to do a complete audit of their customer data)? I would be surprised if the CEO would not be personally on the hook if they violated HIPPA or some other privacy requirement by allowing PBS access to something by accident.

Once a company is in dire straits like this, sussing out problems like this is one of the main purposes of the legal system. Ironically, 70TB of HDDs probably cost less than the first demand letter PBS sent to Iron Mountain.

cyphar··on Judge sets framework for Nine PBS to retrieve archival data
Iron Mountain probably only knows what data was owned by Open Source Storage, but not on the level of which data belongs to which Open Source Storage customer.

If so, it would be incredibly reckless for Iron Mountain to provide all of the data stored by Open Source Storage to one of Open Source Storage's former customers (PBS). Presumably that is why they wanted to go through the legal process so that someone else would be vested with the legal authority to determine what data PBS can legally access.

cyphar··on Incident with Github.com [resolved]
I find it quite amusing what they seem to consider "degraded performance" to mean -- I guess if you really squint, your service not working at all is actually just very large latency spikes (until the service recovers) and thus can be labelled as "services experiencing degraded performance for a small portion of our customers".
cyphar··on A spectre is haunting Unicode
I find 鸚哥(いんこ) to be the easiest way to type the right hand side of 彁.
cyphar··on Should AI labs be treated like the owners of dangerous animals?
You're talking about limited liability companies, which is a legal structure relevant for civil claims.

Someone committing crimes "on behalf" of a company is not protected by the corporate veil and absolutely will get prosecuted individually (well, for small companies -- big companies get to play with different rules, which was the point GP was making).

Also the corporate veil is not absolute, it can get pierced in a few cases, and not everyone incorporates when they do contract work (in which case you need indemnity / private liability insurance).

cyphar··on Postmortem for Kernel Soundness Bug #14576
You can make it complete, it just won't be consistent.

In fact there is a simple way to do it -- add contradictory axioms and then you can use the principle of explosion to prove any statement as true. Is such a system inconsistent and thus useless? Yes, but it is complete.

cyphar··on Golang proposal: container/: generic collection types
Not really, Go already disallows import loops so even if Go did have exportable traits the compilation flow would be the same.

But traits wouldn't really make sense for Go -- my point was that there is are solutions for this problem in other languages; Go's original design goals don't gel well with generics which leads to these kinds of issues. They felt generics weren't necessary so they didn't design Go with them in mind.

cyphar··on Postmortem for Kernel Soundness Bug #14576
Don't Godel's incompleteness theorems mean that completeness is a property you don't want in a prover (as it means the prover must then be inconsistent and this unsuable) and consistency is a property of the prover you cannot prove using the prover itself?
cyphar··on Golang proposal: container/: generic collection types
That is the classic answer for how to do that in pre-generics Go. It doesn't solve the problem I mentioned.
cyphar··on Golang proposal: container/: generic collection types
In Rust this is solved by defining a local trait and methods implemented for a trait are only available if the trait is imported. This is in contrast to Go where methods are not namespaced at all. But there are almost certainly many other ways of solving the problem.

I was a little surprised how often I ran into this issue when using libraries that started defining structures as generic containers.

← PreviousPage 2 of 34Next →