11 ms·
I think I found a Mac kernel bug?
- phreack 9y agoIt seems Apple just can't get a break these days. Has anyone checked if this bug is exclusive to High Sierra?
- masklinn 9y agoThe htop report (in TFA and an other comment) seems high sierra specific (as in, users report the issue starting right when they upgraded to high sierra), running the C snippet from TFA on my system (a 2010 MBP running El Cap'), I can run through 15000 iterations without any freeze, according to TFA "sometimes it needs to try 10 times before it’ll freeze."
- terminalcommand 9y agoHtop also had segfaults after a while in OpenBSD 6.2 i386, when I used OpenBSD exclusively for a couple of weeks. It could also be present in other BSD-like kernels.
- teamhappy 9y agoHtop segfaulting on OpenBSD doesn't show that the OpenBSD kernel has the same bug, it shows that htop has some (unrelated) memory management issues (OpenBSD is pretty good at exposing those).
- jacksmith21006 9y agoThink you make your own breaks.
- Doctor_Fegg 9y agoSounds very similar to https://github.com/hishamhm/htop/issues/682 https://github.com/hishamhm/htop/issues/682
- tomsmeding 9y agoVery true; she acknowledges it in the article as well.
- raldi 9y agoShe does? Where?
- Doctor_Fegg 9y agoArticle has been edited - wasn’t there originally.
- raldi 9y agoI'm still not seeing it. Could you quote the relevant part?
- Doctor_Fegg 9y agoI had to add ?33333 to the end of the URL, and reload, to bust the browser cache.
- raldi 9y agoThank you; I thought I was going crazy. Ctrl-F: htop
- jvns 9y agoMight not just be the browser cache -- I use Cloudflare on my blog and have a script that uses the Cloudflare API to clear the CDN cache when I update the site, but the Cloudflare API doesn't appear to work 100% reliably and I'm not sure why. sorry about that!
- elithrar 9y agoHey Julia - feel free to email me (msilverlock @ cloudflare) so I can look into this. If you can share the API calls you’re making it’d be useful too!
- tambourine_man 9y agoI think High Sierra is the worst Mac OS release yet. I’m sure there’s a cognitive bias partially to blame (since it’s the most recent) but it looks like we are way past that.
- madaxe_again 9y agoQualitatively, it feels like apple’s software quality has been on a slide for several years. What attracted me to move to Mac OS in the first place some 15 years ago was the sheer quality. It was thrilling to use a computer that Just Worked, with no BSODs or the endless dependency hell that was Linux at the time. It doesn’t feel like that any more, across either OSX or iOS - it feels fragile. Things crash, behaviours are inconsistent, and it feels like more emphasis has been placed on immediate commerciality than long term retention through quality. For what it’s worth, I’m in the process of moving to Linux on my MBP. The pros of OSX just aren’t as strong any more.
- st3fan 9y agoThank goodness that Linux is consistent and has no bugs :-) Ubuntu still doesn't let me change my IP address to a static one via the UI and video drivers still crash or result in hours of googling and reading contradicting articles on how to change xorg.conf Software has bugs. Operating systems are hard. It doesn't matter where you will go, you will most likely deal with similar issues. Whether it be Linux, Windows or macOS.
- tambourine_man 9y ago>Software has bugs. Operating systems are hard. Sure, but it doesn't help when you are rewriting fundamental parts of the stack like the window server, for instance. And I'm very glad that they did, the move to Metal shows they are committed to the Mac and not standing still. Just don't treat us as involuntary beta testers.
- __david__ 9y ago
- GoofballJones 9y agoI keep forgetting that the the great coders like Avie Tevanian are long-gone from Apple.
- crypt1d 9y agoI found the style of the article to be quite refreshing somehow. The OP is not trying to look like a smartass about the discovery (a trait very common in the IT industry), and she acknowledges that she doesn't really understand what is the underlying cause. She is just happy that she discovered something and is keen on sharing it with the world.
- icebraining 9y agoYeap! Julia Evans is generally awesome.
- _asummers 9y agoYou should read the rest of her writing, her work is always a treat to read.
- tenaciousDaniel 9y agoI wish there was more of this. Exploring tech should be a delight.
- __s 9y agoI've been writing a devlog on implementing a Lua vm in handwritten WebAssembly, https://www.patreon.com/serprex https://www.patreon.com/serprex it pieces together the commit log with a stream of consciousness aspect Very much admits an 'I have no idea what I'm doing' experience
- pjmlp 9y agoLooks quite interesting project, good luck.
- stevekemp 9y agoOn the one hand yes they're quite enthusiastic, and written with a clear love of learning. On the other hand I find that if every other sentence ends with an exclamation mark, or a question-mark it gets quite exhausting.
- djsumdog 9y agoI immediately thought of the htop bug and then she references that in the article. How is this not fixed yet? Like, this is a security bug, right? You can DoS from a simple usermode app with this bug. Nothing official from Apple on this yet?
- Moto7451 9y agoI don’t think the attack vector (presumably asking for admin credentials to install a startup item) would be any different than an app that wanted to fork bomb, allocate too much memory, or spin wait on all cores. In that way I don’t think it’s any more security critical than any other bug that hangs the system. It’s definitely something that should be fixed of course.
- pcwalton 9y agoLocal kernel-level DoS sadly isn't uncommon on the Mac. I remember finding some trivial ways to panic the kernel using ptrace() back in 2006 or so.
- rokhinip 9y agoWhat version of macOS are you running with?
- spooneybarger 9y agoon twitter she noted it was 10.13.x
- thibaut_barrere 9y agoI'm the initial bug reporter. This machine is on 10.13.3.
- tgtweak 9y agoI don't even use a mac but I've heard terrible things about High Sierra, is it really that bad? Seems like they pushed a bunch of substantial changes to the kernel.
- syncsynchalt 9y agoIt's not bad, nothing's a show-stopper, there's just several little annoyances and embarrassing security issues. My example is that there's an empty blank line in the bottom of about half of my terminal sessions. I haven't looked into it, and I assume it'll disappear in a future point release.
- thibaut_barrere 9y agoI've waited for the dust to settle before doing the upgrade, and did upgrade one machine after another, but I didn't meet anything problematic, this has been a smooth upgrade. I've waited a bit after the "root" security issue, and now I prefer to be on the latest version.
- madeofpalk 9y agoI havent had an issue with it. Other people have.
- jjgod 9y ago
- dang 9y agoI've edited 'he' to 'she' in the two otherwise fine comments that made this mistake (https://news.ycombinator.com/item?id=16251566 https://news.ycombinator.com/item?id=16251566 and https://news.ycombinator.com/item?id=16251562 https://news.ycombinator.com/item?id=16251562) and grouped several empty replies and one lame off-topic subthread under this one. It's rare that we do something like this (and I've emailed the author), but it seems fairer than to penalize their original posts, which were otherwise informative and on topic.
- aw3c2 9y agoShe does.
- chirau 9y agoShe does
- Hello71 9y ago*she
- nathell 9y agoIt's a she.
- lima 9y ago*she
- deleted 9y ago[deleted]
- freehunter 9y agoThe gender of the author is one of the least interesting things about this blog post, yet it's brought up in (at the time of writing this) three separate comments here. Comments that just say "It's a she" or "she" are basically spam and add nothing to the conversation unless the gender of the author is really that important. Since the blog post doesn't mention anything gender specific, I think it's safe to assume these comments are just spam.
- mehrdada 9y agoBack in Leopard days, I was playing with the x86-64 ABI on Mac OS X (no real documentation existed whatsoever, or at least that I could find, except for the source code). Very soon I accidentally ran into a kernel panic that could be reduced to a three-instruction program: mov rax, 1 mov rdi, 1 syscall and it would bring down the entire OS (kernel panic) when run by any user mode application under a standard non-root user. Took a few releases for them to fix that. I stopped trusting them from a low-level reliability perspective since then. Fuzzing their system call interface may not have been a bad idea. P.S. XNU is an interesting as it lets userspace use Mach syscalls as well as a bunch of BSD system calls directly. Probably esoteric interactions between them are not very well-thought-out. (I hope I am not offending Avie Tevanian here :))
- jrochkind1 9y agoAt first I remembered this and wondered if it was related: "The rules for using Objective-C between fork() and exec() have changed in macOS 10.13. Incorrect code that happened to work most of the time in the past may now fail. Some workarounds are available." http://sealiesoftware.com/blog/archive/2017/6/5/Objective-C_and_fork_in_macOS_1013.html http://sealiesoftware.com/blog/archive/2017/6/5/Objective-C_... But seems like no, actually, at least not obviously.
- stochastic_monk 9y agoAdditionally, valgrind is incompatible with Maverick. Which is a huge pain, because it means that if I ever need to use it, I have to debug on a server.
- saagarjha 9y agoAre you sure? IIRC valgrind supports everything up to macOS Sierra.
- stochastic_monk 9y agoOh, my mistake. It's "High Sierra" on which it can't work. I can't keep track of the OS names.
- jchb 9y agoYou mean Sierra / High Sierra. This is because of compatibility breaking changes to some low-level kernel system calls. Since valgrind is essentially a CPU emulator, it is tightly integrated with the OS kernel, and has to be updated accordingly. The macOS contributors to valgrind seem to be relatively few, probably because most macOS developers primarily use the various sanitisers in clang (they also have UI integration in Xcode). Have you tried the clang or gcc asan/tsan/usan sanitisers as a replacment? There are pros and cons of valgrind vs compile time instrumentation. The sanitisers increase the memory footprint, but run with less overhead. valgrind can detect some errors that the sanitizers cannot etc.
- stochastic_monk 9y agoI haven't, mostly just because it happens so rarely and I just want a quick fix, but some of my colleagues have started building the sanitizers into their production process. I probably should just for the sake of good practice.
- GirlsCanCode 9y agoBut Mac OS is secure by design! How is this possible?
- skissane 9y agoQuestion from someone who knows very little about the Mach/XNU APIs: Does this code leak Mach ports? If you call task_for_pid, you get back a Mach task port. Do you have to close the port with mach_port_deallocate? Could a resource leak be contributing to the system freeze?
- Cogito 9y ago@cliffordheath on twitter says [0] > This will be a kernel data structure protected by a mutex or semaphore. task_for_pid waits at pri>=0 for a wakeup that won't happen because race. ps queues behind it at pri<0 (disabling ^C). At least two bugs there. Seems like a reasonable explanation as to the underlying cause of the behaviour. [0] https://twitter.com/cliffordheath/status/957505667568353280 https://twitter.com/cliffordheath/status/957505667568353280