HNHacker News
TopNewBestAskShowJobs

amboar

577 karma · joined August 31, 2011

submissionscomments
amboar··on How SQLite is tested
I've become pretty enthusiastic about checklists.

In case it helps anyone else, I wrote a small tool that helps maintain and execute them:

https://github.com/amboar/checklists/

It's just a shell script wrapped around $EDITOR and git. The intent is to write checklists in the style of github-flavoured markdown. It has some tricks such as envsubst(1) interpolation and embedding little scripts whose execution is captured alongside the execution itself.

Here's an example checklist that's fairly well-worn (though is somewhat dated):

https://gist.githubusercontent.com/amboar/f85449aad09ba22219...

Where checklist entries are commands I just copy/paste them into a shell session. Usually this is in a tmux split with the checklist on one side with a shell on the other.

Could more of it be automated? Perhaps, though when some of the steps fail for various reasons, I find it's easier to recover or repair the situation if I have been invoking them myself sequentially. The embedded script support enables progressive automation where stability of the results is demonstrated over time.

amboar··on Is Software the UFOlogy of Engineering Disciplines?
As I haven't seen a link to it in the comments yet: A while back Hillel Wayne put some effort into resolving the question of "Is Software Engineering Real Engineering?" with the crossover project: https://www.hillelwayne.com/talks/crossover-project/

The conclusion he drew was that there's less difference than you might expect between software development and "traditional" engineering disciplines and that it's reasonable to consider software engineering a real engineering discipline.

amboar··on The Helix Text Editor (2024)
[keys.select."space"] q = ":reflow"

has worked well for me, even if the reflow behaviour itself is sometimes frustrating

amboar··on Programmers aren’t so humble anymore, maybe because nobody codes in Perl
gcc's __attribute__((tainted_args)) is pretty handy: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attribute...
amboar··on GCC 15.1
Section J.1 _Unspecified_ behavior says

> (11) The values of bytes that correspond to union members other than the one last stored into (6.2.6.1).

So it's a little more constrained in the ramifications, but the outcomes may still be surprising. It's a bit unfortunate that "UB" aliases to both "Undefined behavior" and "Unspecified behavior" given they have subtly different definitions.

From section 4 we have:

> A program that is correct in all other aspects, operating on correct data, containing unspecified behavior shall be a correct program and act in accordance with 5.1.2.4.

amboar··on Git as a debugging tool
Yeah, I have rerere turned on However, it's not directly beneficial for the process outlined. With what I wrote about you only solve a given conflict at the end of a complete bisect run, not at each bisection point inside a run. The bisect/cherry-pick process is only used to determine whether conflicts do or don't happen at a given upstream commit. Usually you will solve a specific conflict only once, regardless of whether rerere is enabled.
amboar··on Git as a debugging tool
A handy trick I've developed is using`git bisect` to solve otherwise intractable rebase conflicts:

https://codeconstruct.com.au/docs/bisect-intractable-rebase-...

amboar··on Solar and wind to top coal power in US for first time in 2024
Related, have something similar for the major grid in Australia and it's smaller counterpart in Western Australia: https://opennem.org.au/
amboar··on Our BMCs are not great at keeping accurate time
OpenBMC supports SoCs from Aspeed and Nuvoton, and HP were/are working to add support for their GXP (iLO) SoC.
amboar··on Two startups tried to catch up to makers of advanced computer chips, and failed
Ah, here's the circuit design equivalent of that story: https://twitter.com/dave_universetf/status/14734753486542684...
amboar··on Full key extraction of Nvidia TSEC
One of my favourite talks is Decapping Chips the Hard Way by Adam Laurie and Zac Franken: https://youtu.be/0Z4aF-qiziM

That was 8 years ago

amboar··on OpenPOWER Foundation announces LibreBMC, a POWER-based, fully open-source BMC
> It was eating characters, which is the second worst thing it could do.

Okay, that's interesting. Did you file a bug with your system's firmware provider or with upstream?

You can file it against obmc-console at https://github.com/openbmc/obmc-console/issues

> Digging into the source, I found a really wonky software buffer... which kind of blew my mind - since hardware buffers and flow control exist.

Yep, it's how OpenBMC provides the console via IPMI, Redfish, SSH and on the commandline, as well as routing the console out to the connector on the rear of the chassis.

> I don't remember if that was a case where python was somehow in the pipeline, but that was unfortunately very common in OpenBMC.

Generally there hasn't been any python in the console handling pipeline. That said, python, while especially slow on a BMC, was pretty important for getting the project off the ground.

At this point OpenBMC has been python-free for several years.

> I also had a lot of trouble getting the thing to honor the most basic settings, like baud rate

There's some nuance to this, as depending on your system design the console may be coming from the host to the BMC via Aspeed's Virtual UARTs (VUARTs). The way the VUARTs work is the BMC and host are connected to either end of the two FIFOs between the UARTs' APB and LPC/eSPI interfaces. As such there's no baud rate as no data is clocked out in RS-232 fashion - the data is transferred as quickly as either side can access their register interfaces.

This has caused issues in the past with control flow that lead to data integrity issues:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...

> But it is harder to confidently place the blame on that one. Is it OpenBMC's fault that the software provides no clue as to where things are going wrong in the serial plumbing? Is it the AST2500's fault that designers are routing every serial line through it and making it impossible to eliminate as the cause while troubleshooting?

I agree it can be difficult to debug where things are going wrong in the console pipeline.

In concept a serial console should be simple, but when you bring in requirements like various kinds of SoL, it starts to get more complex.

amboar··on OpenPOWER Foundation announces LibreBMC, a POWER-based, fully open-source BMC
> there is a lot about it that I won't miss, especially the way it handles serial communication

Out of curiosity, what were the issues you had with OpenBMC's serial communication?

amboar··on Speed of Rust vs. C
I realise your post is an argument in favour of Rust over C for these things, but regardless, you might be interested in a WIP library I've started to solve most of the issues you outlined: https://github.com/amboar/shmapper#libshmap
amboar··on Clockwise/Spiral Rule
> - braindamaged linking

I mean, it's simple, but brain-damaged?

> - "if (!pred(x) || a <= b && y)" for "if not pred(x) or a =< b and y"

I guess more parentheses would improve the clarity but your English translation suffers the same problem as the code

> the c pre-processor

> - a broken comment syntax (how do you comment out a region with comments inside?)

Use the pre-processor that you complained about

#if 0 ... #endif

amboar··on How io_uring and eBPF Will Revolutionize Programming in Linux
As others have said, hacking it, certainly. But if you're not up for that and would like something more passive, read LWN.net (and possibly subscribe!)
amboar··on Code Health: Make Interfaces Hard to Misuse (2018)
Rusty's API scale captures this approach really well:

How Do I Make This Hard to Misuse? https://ozlabs.org/~rusty/index.cgi/tech/2008-03-30.html

What If I Don't Actually Like My Users? https://ozlabs.org/~rusty/index.cgi/tech/2008-04-01.html

amboar··on Stop Memsetting Structures
Use a packed struct (e.g. __attribute__((packed))). You may take a performance hit due to lack of alignment, but that's the judgement call
amboar··on Gaining control of BMC from the host processor
Right; then it comes down to platform design and whether you can reboot the soc in a mode that both reopens the bridges and doesn't kill the host, though that's not relevant if you're accessing it from the UART debug interface.

FWIW the mitigation patch in OpenBMC turns off all the bridges early in u-boot to minimise the race window for system reset/AC cycles.

Obviously would be better if it was possible to avoid the race window entirely (i.e. bridges default to closed, can be strapped open by the platform designer, and opened as required by firmware). We had asked for hardware changes along these lines for future generations (but may need to push a little harder...)

amboar··on Gaining control of BMC from the host processor
Something important to note is that this is largely a BMC firmware problem - the hardware can be securely configured to maintain CIA against the host, just sometimes it is not.
amboar··on Gaining control of BMC from the host processor
Please upstream your changes! I remember you were playing around with getting OpenBMC running on a Supermicro X11, would be good to expand the x86-64 support
amboar··on Gaining control of BMC from the host processor
The description looks bad on the surface, but as always reality is more nuanced. These issues are only problematic in specific circumstances, particularly, bare-metal cloud hosting where the BMC might be in a separate trust domain to the host and the user on the host is provided with root (or equivalent) privileges. If your threat model is "root on the host owns the platform" then the only problem is that the BMC is yet another spot to hide malware.

The concern is that existing BMC firmwares have been shown as unsafe for bare-metal cloud types of configurations by default, so organisations using platforms in this environment may be doing so with false confidence.

amboar··on Gaining control of BMC from the host processor
Right. The experience so far is that most people find the capability surprising.
amboar··on Basic Blackbird Bundle with 4-core IBM Power9 CPU
Bear in mind the P9 chip does SMT4, so four cores gives you 16 hardware threads, and 8 cores 32 threads etc.
amboar··on How Many Computers Are in Your Computer?
> The BMC (IPMI) is also a self sufficient ARM computer

ASPEED BMC SoCs (popular BMC SoCs also used in OpenPOWER systems) have a ColdFire (m68k) co-processor buried inside them. In OpenPOWER OpenBMC firmwares we use the ColdFire to bitbang a JTAG-ish protocol into the POWER chip

amboar··on Financial Times journo's private messages quoted to her at China visa renewal
Yeah no worries. I'm @arj:matrix.org, or if you want to try other avenues my keybase profile is listed in my hn profile
amboar··on The insane amount of backward compatibility in Google Maps
The big list of naughty strings is a good place to start when digging up input issues: https://github.com/minimaxir/big-list-of-naughty-strings
amboar··on Financial Times journo's private messages quoted to her at China visa renewal
I think Riot has a terrible UX with respect to key management in group chats.
amboar··on The impossible dream of USB-C
Gigabit Ethernet does not require Cat6. Cat5 is capable but Cat5e is recommended. Cat6 and Cat7 can be used but are overkill.

https://en.wikipedia.org/wiki/Gigabit_Ethernet#1000BASE-T

https://www.tomsguide.com/us/gigabit-ethernet-needtoknow,rev...

amboar··on How the Australian government plans to access encrypted messages
Right, is a different back door, but at least it's not broken crypto. Not that I'm for compromised endpoints either.
Page 1 of 4Next →