Live data from Hacker News

I think I found a Mac kernel bug (2018)

jvns.ca

41–50 of 71 posts

Re: I think I found a Mac kernel bug (2018)

#41
post #11

Earlier quoted context omitted.

I have no idea how I could find that, given that the system freezes completely. Maybe tracing the CPU instructions using LLDB might be possible, but the bug is most likely in the kernel code so this would not help much.

You can debug the kernel remotely over Ethernet: https://developer.apple.com/documentation/apple-silicon/debu... If that still fails, virtualization tools provide debugging interfaces you can use to step the execution of the virtualized CPU; e.g. VMware’s “debugStub” feature.

You can't with Apple Silicon. It's shameful in my opinion. You still can load a core dump or view the state after a NMI but you can't run the kernel under a debugger.

Re: I think I found a Mac kernel bug (2018)

#43

Earlier quoted context omitted.

You can debug the kernel remotely over Ethernet: https://developer.apple.com/documentation/apple-silicon/debu... If that still fails, virtualization tools provide debugging interfaces you can use to step the execution of the virtualized CPU; e.g. VMware’s “debugStub” feature.

You can't with Apple Silicon. It's shameful in my opinion. You still can load a core dump or view the state after a NMI but you can't run the kernel under a debugger.

You can, the experience is just not very good.

Re: I think I found a Mac kernel bug (2018)

#44

Earlier quoted context omitted.

Might have been better to report it to the security people. This sort of thing can be exploitable.

They did report it to Apple, multiple times: > I found it while on Monterey and reported it 2 times through Feedback Assistant, but it still happens on Ventura.

"to the security people" means emailing the relevant email address, not Feedback Assistant.

Re: I think I found a Mac kernel bug (2018)

#45
post #10

Not surprised. I wrote some kqueue code in C once that not only froze the Mac Kernel. It caused the entire computer to crash. I reported the issue to Apple, and never really heard back. They don't really care, as long as all the mac store apps work, in my experience. This was one call to kqueue with incorrect (but not particularly malicious, just normal C silliness) arguments, and boom!

In 2017, I wrote: Over the years, I have found numerous four different bugs in Apple's Calculator app. Here is today's wtf. Switch calculator to Scientific mode (⌘-2). Type: 1, 0, ^, 2, 0, enter, command-c (to copy), command-v (to paste) Expected result: an amount in $$$ I wouldn't mind having. Actual result: smallest number to appear 6 times in Pascal's triangle I reported all four and they never acknowledged any of…

I just tested right now, ⌘C copies the string "1e20" and ⌘V pastes that same string. So yeah it looks like it was fixed.

Re: I think I found a Mac kernel bug (2018)

#46

Earlier quoted context omitted.

They did report it to Apple, multiple times: > I found it while on Monterey and reported it 2 times through Feedback Assistant, but it still happens on Ventura.

"to the security people" means emailing the relevant email address, not Feedback Assistant.

If it doesn't end up with the relevant people, that's Apple's problem.

Re: I think I found a Mac kernel bug (2018)

#47

Earlier quoted context omitted.

"to the security people" means emailing the relevant email address, not Feedback Assistant.

If it doesn't end up with the relevant people, that's Apple's problem.

It does eventually. If you want a prompt response you should contact product security.

Re: I think I found a Mac kernel bug (2018)

#48
post #6

Coincidentally, I also stumbled upon a way to make the kernel of Apple Silicon Macs panic and restart while developing the https://lowtechguys.com website. I distilled the problem in a repo so it can be reproduced with a single command: https://github.com/alin23/m1-panic I found it while on Monterey and reported it 2 times through Feedback Assistant, but it still happens on Ventura. NOTE: Don't try it without saving…

does it work in zsh or bash? only fish?

Re: I think I found a Mac kernel bug (2018)

#49

Earlier quoted context omitted.

In 2017, I wrote: Over the years, I have found numerous four different bugs in Apple's Calculator app. Here is today's wtf. Switch calculator to Scientific mode (⌘-2). Type: 1, 0, ^, 2, 0, enter, command-c (to copy), command-v (to paste) Expected result: an amount in $$$ I wouldn't mind having. Actual result: smallest number to appear 6 times in Pascal's triangle I reported all four and they never acknowledged any of…

I just tested right now, ⌘C copies the string "1e20" and ⌘V pastes that same string. So yeah it looks like it was fixed.

I also just tested now and reproduced the bug. The key thing is that you are pasting back into the calculator – which presumably is just stripping letters.

The behavior is maybe a bit surprising, but I could also see it being defensible. You can't type "1e20" into the calculator, so why would you be able to paste it in?

Outside of plain text, I don't think clipboard operations are necessarily expected to be reversible.

Re: I think I found a Mac kernel bug (2018)

#50

It's very easy to freeze a system as a non-root user; cause too many interrupts, consume too many resources, etc. Many kinds of infinite loop will lock a system hard. Hell, you can crash systems with too many packets . And it's very easy to cause ps to hang. Many different kernel syscalls hang / are blocking. Mostly you see this with kernel features dependent on a resource that doesn't resolve itself, like a stuck di…

While what you say is true, these are nonetheless kernel bugs. The kernel should never let any user process consume so many resources as to cause a system freeze. The kernel must not only be able to preempt any user process at any time, stopping it to consume all CPU time, but it must also prevent any user process to completely fill a SSD or HDD, because that can prevent many programs from starting.

Preemptibility is an optional kernel design feature. Not all kernels have it and not in all ways. If it's intentionally designed that way it's not a bug. No kernel stops users from filling up disks (though some filesystems have such limits as features, which most of us turn off)

Pretty much the only kernels that are totally preemptible are RTOS and they still don't stop you from shooting yourself in the foot.

Post reply on HN