Live data from Hacker News

I think I found a Mac kernel bug (2018)

jvns.ca

21–30 of 71 posts

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

#21
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.

haha, let's just let the Apple engineers on this thread figure that shit out

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

#24
It's surprisingly easy to stumble into crash bugs when playing around with processes.

I remember a decade or two ago I ran into a linux bug where the kernel would panic if a process was killed with an open descriptor on its /proc entries. That is:

open /proc/$pid/something; kill -9 $pid #kernel crash

We unfortunately discovered this when using fuser in a runscript to kill stale versions of a process, eg:

sudo fuser --kill --namespace tcp 80 # kill whatever is listening on port 80

This would reliably cause kernel panics every so often, with one straightforward shell command. This ended up causing a big problem because it was part of a runscript which ran on bootup. But, it normally would do nothing so it went unnoticed until the app in question had a startup problem, leaving a copy of itself dangling listening on the port -- and instead of killing the old instance, it began crashing the entire system in a loop. Oops.

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

#25
post #15

In the long dark ago there was a program called 'crashme' which would generate and run random code from user space to see if it could cause kernel panics.

Did it predate the “fuzzing” term?

By at least a decade or two. The last time I saw one in the wild was probably around 1998, and it was a very old idea by then.

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

#26
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 disk, network filesystem, etc. But other various quirks of the system can cause blocking.

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

#29
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 them. They didn't fix any of them either. Doesn't motivate anyone to report more bugs to them.

Some of the bugs got auto-closed after a while. Eventually, the bugs did get fixed, except the clipboard thing ¯\_(ツ)_/¯.

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

#30
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…

> smallest number to appear 6 times in Pascal's triangle

You mean exacty 6 times or at least 6 times?

Post reply on HN