28 ms·
Leaving htop running freezes macOS High Sierra
- tedmiston 9y agoI always wondered why people bother with htop on OS X when the built-in Activity Monitor.app is so nice already. I only use htop on remote boxes myself.
- shiado 9y agoPersonally the first thing I do on a macOS install is remove pretty much every single Apple app I can. The quality of Apple's software is simply too low to take the risk of relying on it. Anybody who has had to fix their relatives iPhoto or iTunes would agree.
- city41 9y agoIf your confidence is that low, why use MacOS at all?
- roblabla 9y agoNot the op, but until recently I felt like while Apple's apps were going downhill, its OS stayed very good, both in terms of user friendliness and stability. With High Sierra, any trust I had was utterly shattered.
- shiado 9y agoDespite the flaws it still provides a more consistent experience than Linux (especially on laptops). I just wish Apple put as much love into MacOS as they do into iOS. Also there is a lot of proprietary software like the Adobe suite + Music production software that is only available on MacOS or Windows.
- oelmekki 9y agoYou should try KDE Neon stable :) It's the best linux experience I've had, I got used to call it "macosx, the linux way". It's stable, with a well thought of interface and softwares that just fit together, yet it's customizable to the extreme and will allow you to create your workflow instead of forcing one upon you. Not that it will help with the unported softwares you're used to use, though (although, inkscape, blender and ardour are a thing, nowadays).
- yjftsjthsd-h 9y ago> more consistent experience than Linux (especially on laptops) One one line of laptops, maybe. Run Linux on a single line of laptops that officially support it (I suggest XPS), making this an apples-apples comparison, and Darwin doesn't look as competitive anymore. Or cut the other way and look at Hackintoshes:) > proprietary software Yeah, this I agree with; WINE helps but sometimes you're stuck needing Darwin/NT.
- ufo 9y agoI have always wondered why people bother with non-htop apps, when htop is so nice already :) But more seriously, one of the big advantages of htop is that it is extremely lightweight, which helps a lot when you have other processes that are eating up all your CPU and RAM.
- tedmiston 9y agoI think htop is a tolerable replacement for top but personally I find it just okay, not "nice". The main reason I prefer Activity Monitor is that it has more features, like viewing open files by process, the energy usage pane and network activity on top of CPU and memory. I tend to prefer GUI apps any time I'm interacting with the interface a lot, like to sort, filter, drill down, etc.
- hisham_hm 9y agohtop allows viewing open files by process (press 'l'), as well as sorting (F6 or click column header) and filtering (F4 or '/').
- djsumdog 9y agoThis has less to do with your choice of process monitors and more to do with the potential security issue that allows a userspace app to halt a running system.
- notadoc 9y agoHigh Sierra seems like a great OS if you want an unstable workstation that doesn't work with tools you've used everyday for well over a decade.
- gargravarr 9y agoAs a sysadmin at my company, I have regular questions from my users (C++ developers) about upgrading from Sierra to High Sierra due to Apple's invasive and unavoidable notifications. After the root-exploit balls-up, I forced the two people who'd upgraded back onto plain Sierra. But I know at some point it'll stop giving us the option to ignore. I am beyond flabbergasted at how much these idiots have managed to break between Sierra and HS. They must literally be high when they say 'this is good, let's ship it'. The OS is abysmally unfinished, and with each of these stupid failures we're going past Vista levels of unfinished. These are tools I use in my daily workflow (thankfully I use Linux instead), and other developers in my company use these tools. At this point, upgrading to HS would be a massive step backwards for us. I literally cannot believe how sh*t MacOS has become. It's a cesspit of broken Unix with a shiny iOS layer covering it. I absolutely loved Snow Leopard and cannot believe it has evolved (or mutated) into this. I'm beyond pleading and into exasperation. APPLE, WILL YOU MAKE AN OS WE CAN ACTUALLY USE?!
- RGS1811 9y agoI came for the filesystem bugs, I stayed for the absurd root exploit, but its the little crashes, rendering glitches, and feeling of general instability that made me fall in love with High Sierra...
- donatj 9y agoAPFS has been nothing but pain for me. File system changes show up in Finder minutes later! I should have stayed in Sierra.
- tomjakubowski 9y agoUnfortunately, it seems Apple has forced us to choose between Meltdown mitigation and a somewhat working OS. The recent Sierra security updates didn’t include the Meltdown patch. https://twitter.com/theregister/status/949358083431546880 https://twitter.com/theregister/status/949358083431546880
- api 9y agoPeople are missing the point-- it's not an htop problem since a simple console app running as a user should not be able to do this at all. This gives me the willies. Methinks another OSX security bug is incoming.
- gargravarr 9y agoThis is exactly why I cringe at these seemingly minor issues - sure htop breaks, it can be worked around, but the root cause is more fundamental; an unprivileged user should not be able to crash the whole OS just by reading the process table, no matter how invasive. It makes me think what they have decided to change between Sierra and HS to cause this sort of failure. This is pretty fundamental and implies some tinkering deep in the kernel, potentially without fully understanding the repercussions. With the number of security holes that can be easily opened by naive tweaks to low-level code, I think we're right to be nervous about what they've done to cause this.
- djsumdog 9y agoYea, if I had a Mac box, I'd be looking at that call stack the author posted and fuzzing the hell out of those functions. There's a DoS bug bounty in there somewhere.
- Someone 9y agoOnly if Apple invited you to that competition (https://www.macworld.com/article/3104671/security/apple-announces-invitation-only-bug-bounty-program-at-black-hat-conference.html https://www.macworld.com/article/3104671/security/apple-anno...). Others only get credits.
- deleted 9y ago[deleted]
- rubyn00bie 9y agoSomewhat tangential but if htop is unusable, I’ve always liked Glances: https://nicolargo.github.io/glances/ https://nicolargo.github.io/glances/ Though it sounds like htop is a symptom not the problem.
- tbrock 9y agoGlances seems great but every time I go to use it it’s a pain to install. Python packaging... yuck!
- polygot 9y agoOn Mac OS 10.4 (tiger) when I left Activity Monitor going in the background for a few minutes and returned to it, sometimes it would all of a sudden refresh the values super super fast with historical data (appearing to catch up on the iterations that it did not display.) On 10.6, when I ran Windows in a virtual machine while it was doing windows update, and left it running in the background for a few minutes and returned to it, sometimes I would get 60fps in the machine for a few seconds and it updated very very fast, and then it went back to 15fps (seemingly getting more CPU power.) On 10.7 (if I recall) if I left Activity Monitor running in the background for a few minutes and returned to it, I would get nonsensical values for the CPU usage for a few seconds (e.g. 398423.34%) but then it would return to normal. Perhaps this error has been accumulating over the years.
- to3m 9y agoThis still happens for me on OS X Sierra sometimes.
- polygot 9y agoOut of curiosity, is this bug related to CPU cache? I don't know really anything about how CPU's work internally, however. It just "feels like" it's applying a bunch of instructions very quickly but ignoring the internal clock if that makes any sense. For example, the CPU percentage counter in Activity Monitor was around 3,000,000. If there was a loop to increment the CPU usage counter, it sounds like it incremented it so fast that the thread that reset it didn't run since it wasn't scheduled to run (as it only runs every few seconds.) Again, this is just pure speculation and if anyone knows otherwise please let me know!
- to3m 9y agoI very doubt it's anything to do with the cache, and that isn't an uneducated guess. But I've very doubted things before, and they turned out to be the case anyway, so why would you listen to me? My assumption was/is that it refreshes stuff on a timer. On each timeout it puts a refresh event on some kind of queue... and then somehow manages to fuck it up, and ends up having a bunch of these events to deal with all at once, rather than handling each one as it comes in with a sensible gap between each one. Well, sometimes it happens, and don't ask me how I know. But I have to say that you usually don't release it like that :(
- rdtsc 9y agoYup. I hit the same bug, just a few hours ago. Was compiling something and had htop running, then everything froze. I assumed it was the build and after a hard reboot started compiling again but this time without the htop and it finished fine.
- gnachman 9y agoI’ve been disappointed with Apple’s response to kernel bugs for quite a while. Closing a large number of ptys at once caused a panic for years. In high Sierra, there’s this, statfs hangs, and proc_pidinfo hangs.
- alwillis 9y agoRan htop for a while on the latest public beta of High Sierra 10.13.3 last night and didn’t have any issues.
- ufo 9y agoAccording to the bug thread, the bug doesn't always happen but there are some things that can be done to reliably trigger it. https://github.com/hishamhm/htop/issues/682#issuecomment-341538158 https://github.com/hishamhm/htop/issues/682#issuecomment-341...
- Sir_Cmpwn 9y agoWhy was this reported to htop instead of Apple? Most of these people "me too"ing don't seem to realize that this isn't htop's problem...
- djsumdog 9y agoYea, there's very little indication anyone here has tried to do any serious debugging or realizing this should be a security vulnerability report. The author did eventually post a stack-trace to the actual call that's failing.
- znpy 9y agoGood Lord, how dare you imply that is actually Apple that made something wrong? /s
- hit8run 9y agoOh crazy I was wondering if my system was totally messed up for quite a few weeks now. Thought it had to do with my homebrewed version of htop but didn’t have time to investigate further :/
- saulrh 9y ago1. By creating and closing process very rapidly, one could easily reproduce this problem. I used something like `while true; do sh -c "exit 0"; done`. The entire OS dying to rapidly spawned/exited processes permits a pretty nasty DoS. Good thing that nobody ever uses macs as servers or shared machines.
- btown 9y agoGeez; does this mean it could do the same when compiling a large codebase with Make?
- saulrh 9y agoDunno; I don't have any apple devices. Might ask a coworker to try to repro it on monday. :P (I suspect that recursive makes do enough compute in between invocations to slow down and avoid this bug. If the OS was dying in everyday compile jobs it'd be much bigger news.) EDIT: I think that I might've misread this - it might be that spawning processes pushes htop through codepaths that can cause the bug. So it's more like "a malicious app could kill your system the instant you open htop". In which case, yes, a recursive make while you have htop would would do it. Rather less significant.
- ReverseCold 9y agoWhen I read the headline I didn't think I had run into this bug. Now I remember my OS freezing twice when quickly opening and closing some chrome tabs. Could possibly be the same issue.
- dingo_bat 9y agoJust tried it on Ubuntu (Windows) for fun. 5 minutes later the fans have come on but no freezing yet.
- evanslify 9y agoAuthor of comment here: Doing this alone doesn’t do any harm unless running htop in background, also this only makes the bug happen more quickly. If one has Activity Monitor running prior to crash, it’s still possible to kill htop with it and would make OS useable again.
- nikanj 9y agoI’m still looking for a thing I _can_ leave running, without High Sierra freezing on me..
- deleted 9y ago[deleted]
- robotresearcher 9y agoLinux? :)
- duncan_bayne 9y agoI have an old MacBook Pro I use as a gaming machine (and my wife uses as temporary machine after our late dog (for reasons unrelated to her demise) urinated on her new XPS13. After upgrading to High Sierra, we both got so sick of the instability that we're installing it with Xubuntu this evening, bringing it in line with the rest of our 'home fleet' (ThinkPads w/ either FreeBSD or Xubuntu).
- oceanghost 9y agoI've had a similair problem with Transmission for years. Doing more then a few transfers locks up transmission and then the entire machine. Issuing a halt at the terminal sometimes will reboot the machine, but moist of the time it just hangs. I would switch but to what? Windows/Linux are just as user hostile.
- linkmotif 9y agoQbittorrent is quite nice, in terms of switching torrent clients at least.
- voltagex_ 9y agoI'd say OS X is hostile now - after doing maintenance on a 2015 Macbook over the holidays.
- oceanghost 9y agoI'd agree. It's just relative.
- gjvc 9y agoSince Mac OS X Snow Leopard (10.6) the quality has declined release by release.
- grzm 9y ago> "Since Mac OS X Snow Leopard (10.6) the quality has declined release by release." This may be: I'd love to see a comprehensive, in-depth article that digs into this in a quantitative manner. Do you have one at hand? If so, it might make a good HN submission. Just posting this statement at the top level of a post is arguably off-topic and baity. If you could post it on any submission that touches on Mac OS X, it's not really on-topic.
- draw_down 9y agoWell, here’s this week’s embarrassing bug. What in the world is going on over there.
- alasdair_ 9y agoHigh Sierra STILL has a bunch of issues running Unity too.
- jamix 9y agoWow. I used to update my iOS and macOS every year, but decided not to do so in 2017. A stroke of luck?
- evanslify 9y agoI’ve been finding the root cause of this a month ago, but don’t know where to look due to lacking of experience in kernel debugging. If anyone here could lend me a hand, please send me an email at (es at evsfy dot com)
- therealmarv 9y agowhy keeping the root cause for yourself? Try to mention it at least here or write on the htop bug list page what you know. It would help us all I guess.
- evanslify 9y agoI did post my findings on the GitHub issue :-)
- saagarjha 9y agoFrom the symptoms, it looks like it’s starving the computer of memory. It doesn’t look like anyone’s debugged this, so once I get back to my computer I’ll take a look and get it reported to Apple.
- saagarjha 9y agoI can't edit anymore, so I'm going to reply: I did a bit more research on this issue and it's not actually a memory bug at all. In reality there appears to be an infinite loop in calls to task_for_pid: https://github.com/hishamhm/htop/issues/682#issuecomment-355736956 https://github.com/hishamhm/htop/issues/682#issuecomment-355.... I'm still not sure who's doing the wrong thing, htop or Apple, but it's clear that freezing up the system is always incorrect behavior.
- yjftsjthsd-h 9y agoKinda sounds like an htop bug that shouldn't be able to freeze the system because, y'know, not letting any process freeze the system is part of the OS's job. Of course, it might also be an htop bug that's triggered by Darwin handing it bad data, so there could be blame to share;)
- jonke 9y agoAfter a Quick Reading of the issues it reminds me of an old linux Kernel bug. https://groups.google.com/forum/m/#!topic/mechanical-sympathy/QbmpZxp6C64 https://groups.google.com/forum/m/#!topic/mechanical-sympath...
- Dunedan 9y agoLeaving htop running (best in background in a screen session on some server) is such a waste of CPU resources. I've already seen that multiple times and always wondered if the people don't recognize by looking at htop's output how much CPU resources it wastes.
- RJIb8RBYxzAMX9u 9y agoReading the bug report: 1. Increasing htop's refresh rate (-d 0.1), and having a tight loop that spawns processes quickly, tends to reproduce fairly reliably. 2. Running htop as root seems to work around the problem. I was able to reproduce the crash with (1), and not able to with (2) after running htop for several minutes. My first thought was that it didn't have to with running htop as root, but rather running htop as a different user as the one spawning processes. So I repeated (1) except that I ran htop as myself, but the spawning loop as nobody, and the crash went away. I wonder if the bug's in the resource limit checks (RLIMIT_NOFILE, RLIMIT_NPROC), and if increasing the limits would delay / mitigate the crash. But I don't feel like crashing my machine anymore tonight to find out...
- gargravarr 9y agoSome nice digging there, thanks for the info!
- hit8run 9y agoOkay for now htop is disabled for High Sierra: ==> Upgrading 1 outdated packages, with result: htop 2.0.2_1 htop: This formula either does not compile or function as expected on macOS
- saagarjha 9y agoNot quite: many people already have 2.0.2 (which is buggy) installed. Short of uninstalling htop the issue still remains.
- j_m_b 9y agomacOS has gone down hill since it heyday in the 2000s, very noticeably so since it became known as 'macOS'. For a long time, it was the best nix you could run. The horror stories surrounding High Sierra might finally break my bad habit of commercial OS and make me go back to Linux or one the BSDs.
- fooker 9y agoMy 2015 13 inch MBP is still on Sierra. Should I indefinitely hold off upgrading to High Sierra?
- justinph 9y agoYes. Stay away. I downgraded my mac back to Sierra from High Sierra and don't regret it at all.
- chmaynard 9y ago+1. I used to upgrade to each new release of Mac OS X in the first few days. That policy worked for many years, but my experience with High Sierra was so bad that I downgraded and never looked back.
- calinet6 9y agoThis seems like it might be a lead: > Apple completely rewrote the window server in Metal 2 for High Sierra and seems to have done a very poor job of it. I've run into tons of those issues with my 2012 MBP. Slight tangent that might be useful to someone. If you experience jerkiness, lagginess, slow display updates, just general slow feeling, one thing to try is the NVIDIA Web Driver video drivers, rather than the stock ones. It resolved all of the slowness for me, maybe just applies to slightly older macs but made a big difference.
- alvil 9y agoHtop is pretty leaky on any system.
- felipelemos 9y agoYes, with a small difference that this does not happen on a Linux box.