Hector Martin
marcan.st · Personal blog · on HN since 2014
Blog of Hector Martin (marcan), a hacker known for Asahi Linux, writing on reverse engineering, debugging, and hardware hacking.
What HN saysCommenters praise him as a talented hacker and cite his Go runtime bug write-up as a gripping debugging story. His Asahi resignation post is also referenced.
44HN people shared it
28linked it in comments
16stories submitted
1.9Kstory points
10 months agolast shared
2014people per year2026
Most-shared posts
- 1Debugging an evil Go runtime bug21 people · 755 points · first shared 2017 · 48 comments on HN
- 2Resigning as Asahi Linux project lead7 people · 1.1K points · first shared 2025 · 997 comments on HN
- 3Untangling iOS PIN code security (2016)4 people · 4 points · first shared 2016 · discussion on HN
- 4Rescuing a broken NTFS filesystem3 people · 3 points · first shared 2018 · discussion on HN
- 5Safe Hacking (2011)2 people · 38 points · first shared 2020 · 5 comments on HN
- 6Crossflashing the Fujitsu D2607 (2016)2 people · 29 points · first shared 2016 · discussion on HN
- 7Hacking and upgrading the Korg Kronos2 people · 2 points · first shared 2016 · discussion on HN
- 8Ftdi evil.png2 people · first shared 2014
- 9About2 people · first shared 2020
- 1020161210 201044.png1 people · first shared 2020
- 11Sunplus spmp305x media player hacking1 people · first shared 2021
- 122014 pixiv ugoku player1 people · first shared 2014
- 13Latte otp slr.jpg1 people · first shared 2020
- 14Hollywood die.jpg1 people · first shared 2022
- 15Rsx.jpg1 people · first shared 2020
What HN people wrote when they linked it
renewiltord · 2025-10-24
It's funny that this exact question is mentioned in marcan's "I'm leaving Asahi Linux" blogpost, haha.
> And, of course, “When is M3/M4 support coming?”
https://marcan.st/2025/02/resigning-as-asahi-linux-project-lead/
It's just amusing to me that Linux users since the beginning of time have been working hard on ensuring the maintainers of their software get upset at them and quit working on their software.
Over decades of seeing this, it is entertaining that people never change. There will be a great beauty to the vim v emacs wars in 5723 CE between the people of Gliese 251b and Gliese 251c.
js2 · 2023-09-20
> At this point, there are two natural conclusions: either I have a severe hardware issue, or there is a wild memory corruption bug in the binary.
https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/
I won't spoil the conclusion. It's a long and winding path to get there and a good read. HN discussion:
https://news.ycombinator.com/item?id=15845118
unflaggedbird · 2023-03-08
It somehow made me recall an amazing story of debugging one Go bug (not by me), which included heating memory :) [1]
[1] https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/
aw1621107 · 2022-01-03
This gets rather over my head, but my best guess is this bug having to do with the Go runtime underestimating how much stack space vDSO code may need (blog post at [0], fix at [1]).
[0]: https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/
[1]: https://github.com/golang/go/commit/a158382b1c9c0b95a7d41865a405736be6…
faragon · 2017-01-01
Amazing work. Hector Martin (@marcan42) is an incredibly talented hacker. I still remember his post for enabling the hardware virtualization of the CPU in his laptop, an Acer Aspire 5930 [1], that had it disabled in the BIOS, and it was not user serviceable (I had a similar laptop, with smaller screen, so his post was useful for me). Also his hacks and comments in a Spanish forum [2] for the PS2, Nintendo consoles, and others were plenty insightful. Then the PS3 hack. And now, getting Linux working in the PS4, even with 3D acceleration (without help, just with few specs found in the web (!!!)). It is mind blowing :-)
[1] https://marcan.st/2009/06/enabling-intel-vt-on-the-aspire-8930g/
[2] https://www.elotrolado.net
Diggsey · 2020-11-03
The "Colored function problem" is a complete fallacy: aside from the fact that async and non-async fns are interoperable in Rust (block_on) and other languages, the same argument could be made against functions with any preconditions.
> The solution to expensive context switches is cheap context switches, plain and simple.
Except the performance difference between a kernel-mode context switch and a user-mode one is only going to narrow in the future. The overhead that cannot be eliminated from context switches is their effect on the cache, since you start to run into the laws of physics at that point...
The real solution to expensive context switches is to just do fewer of them... No context switch is always faster than a "fast" context switch.
> I sincerely believe this is Rust's ballpark
I think it's plausible that Rust could get a library-level solution for fibers that does not rely on unstable details of the compiler. Rust will never again have that baked in to the language, as it would make the language completely unsuitable for many low-level tasks.
Fibers, especially the way they are implemented in Go, come with a lot of their own complexity.
Just look at this issue: https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/
This is just one of the segfaults caused by Go's complex stack control. I don't want to rely on a runtime that contains these sorts of bugs, and the best way to avoid that is to avoid having a runtime in the first place.
rasz_pl · 2014-10-23
http://www.eevblog.com/forum/reviews/ftdi-driver-kills-fake-ftdi-ft232…
marcan:
"In case anyone was still wondering if this is intentional and malicious...
Straight out of their driver. Function/variable naming and comments mine.
https://marcan.st/transf/ftdi_evil.png
I figured out what's going on with the real chips: turns out their EEPROM is written in 32bit units. Writing to even addresses is ignored; the value is buffered and the address discarded. Writing to odd addresses writes the entire 32bits, using whatever value was last buffered for the other half. So both the PID write and the checksum write are ignored on real FTDI chips, as they are both written to even addresses. I still don't know why it works on clone chips though, since the checksum is written to the wrong place (it should normally be on an odd address); presumably they don't check it."
Basically driver is fuzzing 'chips claiming to be FTDI' with illegal instructions. Want to play clone games? better emulate me completely, otherwise tough titties. I like it. Might not work to well for FTDI in the end due to PR nightmare, but from engineering standpoint its quite brilliant.
dllu · 2025-12-25
Marcan (Hector Martin) resigned from Asahi Linux early this year [0].
Asahi Lina, who also did tons of work on the Asahi Linux GPU development, also quit as she doesn't feel safe doing Linux GPU work anymore [1].
[0] https://marcan.st/2025/02/resigning-as-asahi-linux-project-lead/
[1] https://asahilina.net/luna-abuse/
lagniappe · 2025-08-30
Is Asahi still making regular meaningful progress since Marcan quit?
https://marcan.st/2025/02/resigning-as-asahi-linux-project-lead/
colechristensen · 2025-03-21
Here it is, the original developer quit in a long post. https://marcan.st/2025/02/resigning-as-asahi-linux-project-lead/
My read is this is a case of a person taking on a huge project and burning out emotionally.
glitchc · 2025-03-18
Tied to this --> https://marcan.st/2025/02/resigning-as-asahi-linux-project-lead/
Official annnouncement: https://asahilinux.org/2025/02/passing-the-torch/
frabert · 2024-11-27
You can probably ask the one who did the most reverse-engineering :) https://marcan.st/2016/06/hacking-and-upgrading-the-korg-kronos/
As far as I can tell, there's no custom "firmware" to speak of, it's a patched Linux kernel running a kernelmode audio synthesis engine and a usermode app for the UI
masklinn · 2024-11-07
> At least the vDSO functions really don't need much in the way of stack space: generally there's nothing much there but clock_gettime() and gettimeofday(), which just read some values from the vvar area.
And yet that’s exactly one of the things Go fucked up in the past: https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/
cesarb · 2024-11-07
> Didn't they go back to Glibc in 2017 after a syscall silently corrupted several of their tightly packed tiny Go stacks?
You must be thinking of https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/ which was about the vDSO (a virtual dynamically linked library which is automatically mapped by the kernel on every process), not system calls. You normally call into the vDSO instead of doing direct system calls, because the vDSO can do some things (like reading the clock) in an optimized way without entering the kernel, but you can always bypass it and do the system calls directly; doing the system calls directly will not use any of the userspace stack (it immediately switches to a kernel stack and does all the work there).
chc4 · 2024-07-18
When I read https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/ and saw the hash bisection trick for the first time I was super impressed, it really does sound incredibly slick :) I imagine that's how first coming across normal git bisect must feel to new engineers.
mirashii · 2023-05-16
> Nah, rust still depends on libc at runtime which is a pain.
It does in general, though I don't really think this is a big pain or blocker in the general case, there are very version requirements around libc.
> Go doesn't have this problem afaik as it has its own stdlib and runtime.
That's also true, but it's not really a pure win. Choosing not to use a battletested libc has led to a variety of subtle and difficult to diagnose bugs over the years, e.g. https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/
marcan_42 · 2022-01-13
They always have rejects. Actually, that's almost certainly an unfinished wafer. Modern flip chips don't look like that finished - you have an array of pads and power distribution covering all the cool features.
I think there's a good chance that wafer doesn't have any metal layers, or only M1 at most. It looks the same as the chips I've delayered and removed all or almost all of the metal layers from. For example, here's a shot of the Wii's GPU with the metal layers scraped off:
https://marcan.st/transf/hollywood_die.jpg
zamadatix · 2021-08-14
From https://marcan.st/about/
"Hello! I’m Hector Martin and like to go by the nickname “marcan”. I currently live in Tokyo, Japan as an IT/security consultant by day and a hacker by night. For some definition of day and night, anyway."
Hacker for hire basically. This project was started via crowdfunding enough monthly sponsors (overnight from his previous reputation and interest in this project) and is somewhat half day job and half night hacking out of personal interest as a result.
steveklabnik · 2020-09-19
They do: the interface is (usually) libc (or some equivalent), not the actual details of how libc makes said call.
For an example of how this can play out, the parent is referring to things like https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/
rhinoceraptor · 2020-02-28
It's not surprising that other pieces of golang have incredibly broken assumptions, I know this particular one was discovered independently by many people:
https://github.com/golang/go/blob/71ab9fa312f8266379dbb358b9ee9303cde7…
https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/
fasterblade · 2018-01-01
The same compiler (mis-)feature was also the cause of spurious crashes in Go applications (diagnosed about a month ago: https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/). Linus's comment is fun:
So yes, It's a terminally broken compiler from hell. I assume gentoo
has applied some completely broken security patch to their compiler,
turning said compiler into complete garbage.
Relys · 2016-03-22
Martin Hector (@marcan42) from the established hardware hacking group fail0verflow has to say about the situation: https://marcan.st/2016/03/untangling-ios-pin-code-security/
Essentially you can just automate the backup/restore of the eMMC flash storage and brute force the PIN. :)
jdiez17 · 2014-10-23
It's been proved by reverse engineering the FTDI drivers and annotating the code. It exploits some edge case in which the counterfeit device does not behave exactly like the original. https://marcan.st/transf/ftdi_evil.png
zxcvgm · 2014-10-09
I heard of a HTML5-based alternative some time ago called the "ugoira HTML5 zip player". It uses a ZIP file of PNG/JPG files and renders the animation using JavaScript onto a <canvas>. There's a detailed slide deck talking about it [1] and the source code is available too [2].
[1] https://marcan.st/talks/2014_pixiv_ugoku_player/
[2] https://github.com/pixiv/zip_player
least · 2025-03-05
There are wifi drivers; you just have to install them separately because they use broadcom chips. It's a proprietary blob. The other things do work, but it requires special packages and you'll need an external keyboard while installing. It's a pain to install, for sure, but it's not insurmountably difficult to get it installed.
Apple Silicon chips are arguably more compatible with Asahi Linux [1], but that's largely in thanks to the hard work of Marcan, who's stepped down as project lead from the project [2].
Overall I still think the right choice is to find a laptop better suited for the purpose of running linux on it, just something that requires more careful consideration than people think. Framework laptops, which seem well suited since ideologically it meshes well with linux users, can be a pain to set up as well.
[1] https://asahilinux.org/
[2] https://marcan.st/2025/02/resigning-as-asahi-linux-project-lead/
comex · 2022-07-29
On many operating systems, including macOS and Windows, the only ABI-stable interface is a userland-to-userland interface. Application code loads a shared library vended by the system and calls functions from that library like open() or CreateFileW(), in userland. These functions are in turn are usually thin wrappers around system calls with equivalent argument lists – but not always, and even when they are, it's only an implementation detail. Trying to call system calls directly without going through the wrappers risks incompatibility with future OS versions, e.g. [1].
On Linux, traditionally, the userland-kernel interface itself is ABI-stable. The userland code can be fully custom and doesn't even need to support dynamic linking. Syscall numbers and arguments are fixed, and application code can perform its own syscall instructions. You can then layer something like glibc on top of that, which provides its own syscall wrapper functions with a corresponding stable (userland-to-userland) ABI, but that's separate.
The vDSO has always been a step away from that. It's userland code, automatically mapped by the kernel, that provides its own system call wrappers. Applications are still allowed to make system calls manually, but they're encouraged to use the vDSO instead. Its original purpose was to allow certain functions such as gettimeofday() to be completed in userland rather than actually performing a syscall [2], but it's been used for a few other things. It's…
exikyut · 2021-07-10
[ Woops, I went into GPT-3 mode. I'm really bad at rambling concisely, and fitting the result into a couple of comfortably short paragraphs. :/ ]
Thing was, Alley Cat was the only (interesting) game on the machine in question... and when I (sadly) explained what I'd done to the person who gave me the system, they responded by promptly deleting the EXE file. While a bit of a tangent, my honest thanks for helping me realize (as I type this) that this memory was what kicked off the deep-seated negative associations I've had around gaming my whole life, and why I often lock up whenever I think about the subject. (!)
I completely agree that filesystem recovery is somewhat of a more advanced topic, and entirely unfair to expect mastery of at ~10 :D. I kind of understand about 42% of https://marcan.st/2015/10/rescuing-a-broken-ntfs-filesystem/ myself, for example.
I'm very curious how you managed to end up staring at a system with the DriveSpace driver un-loaded though; that just sounds broken. I wonder if you tripped over an uncaught bug/edge case in the setup process.
(And yeah, the system I was using had DOS 6.20 on it, thus had DoubleSpace instead.)
[TIL about the Dysan brand of floppy disks]
How'd you figure out that BAS = QBASIC?
In my case, the person who gave me the PC randomly decided one day that it needed a menu, "so we didn't need to type commands in". The PC sat in my bedroom, and Mum rarely used it... but okay, whatever works. Well, said menu ended up being a…
BenoitP · 2020-11-03
> are interoperable in Rust (block_on)
Blocking an OS thread as a mean to be compatible is not exactly what we're trying to do here.
> Except the performance difference between a kernel-mode context switch and a user-mode one is only going to narrow in the future
OS overhead can be minimized, but program stacks are a function of the language's. And if you're not right sizing preemption points in your stack, you'll be switching large parts of it. This means you _must_ have stackful coroutines if you want to keep switching threads.
> The real solution to expensive context switches is to just do fewer of them... No context switch is always faster than a "fast" context switch.
Sure, but writing the perfect assembly and using gotos has always been the fastest. Abstraction has a cost, and some runtimes/languages are currently proving that they can reduce this cost to zero in the current conditions of IO being much costlier than a few 100s of nanos. We're just happening to be at a time where the compiler is starting to be smarter than the user. But I guess the benchmarks will settle all this.
> Just look at this issue: https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/
So that's a bug in the go compiler. They can either fix it or pay a "a small speed penalty (nanoseconds)" as a workaround, which the author qualifies as "acceptable".
Yes, that's not the absolute performance possible. But why care about that? At some point it all comes down to TCO (except for…