pkgx icon indicating copy to clipboard operation
pkgx copied to clipboard

Kernel panic when installing.

Open magnusviri opened this issue 3 years ago • 13 comments

I've had my second kernel panic while installing something with Tea. I can't imagine why Tea would do this. But it's happened twice now so I'm going to create this issue. Here's the text from Discord for the first panic (on November 4th).

My M1 panicked while I was installing go. The process that crashed was kernel_task. Here are the parts from the panic log that might be remotely interesting.

"build" : "macOS 12.6 (21G115)",
"product" : "MacBookAir10,1",
"kernel" : "Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101",
"date" : "2022-11-04 22:17:42.18 -0600",
"panicString" : "panic(cpu 1 caller 0xfffffe002816b53c): watchdog timeout: no checkins from watchdogd in 94 seconds (895 total checkins since monitoring last enabled)

Panicked task 0xfffffe201c754678: 0 pages, 479 threads: pid 0: kernel_task

last started kext at 386692668936: com.apple.filesystems.smbfs\t4.0 (addr 0xfffffe00276366c0, size 65195)

last 2 processes

"procname":"tea"
"procname":"bsdtar"

The second panic happened today. I ran tea +python.org~3.10 pip. Neither python nor pip was installed when I ran it. The panic log looked very similar to the first. Besides memory addresses, the first real difference started at last started kext.

last started kext at 3141788048810: com.apple.UVCService\t1 (addr 0xfffffe0021a60450, size 1772)
last stopped kext at 888788618382: com.apple.filesystems.msdosfs\t1.10 (addr 0xfffffe0021b1a7d0, size 5926)

The last process is bsdtar again. Could that be causing a kernel panic?

magnusviri avatar Nov 17 '22 00:11 magnusviri

I don't know if this will help, but here's the process data from the panic log for Nov 4th.

    "84706" : {"timesThrottled":0,"pageIns":0,"waitInfo":["thread 732550: pthread condvar 0x11ff4f8e0","thread 732551: pthread condvar 0x11ff4f8e0","thread 732552: pthread condvar 0x11ff4f8e0","thread 732553: pthread condvar 0x11ff4f8e0","thread 732554: pthread condvar 0x11ff4f8e0","thread 732555: pthread condvar 0x11ff4f8e0","thread 732556: pthread condvar 0x11ff4f8e0"],"timesDidThrottle":0,"procname":"tea","copyOnWriteFaults":503,"threadById":{"732555":{"id":732555,"schedPriority":31,"system_usec":3154,"state":["TH_WAIT"],"user_usec":26014,"basePriority":31,"userFrames":[[17,3089008],[951,15582540],[951,15580896],[951,15556468],[17,3326572],[17,3305612]],"userTime":0.026014625,"waitEvent":[2,2492331499932619625],"continuation":[27,17956],"systemTime":0.0031545409999999999,"name":"V8 DefaultWorke"},"732548":{"id":732548,"schedPriority":31,"system_usec":238554,"state":["TH_WAIT"],"user_usec":4118971,"basePriority":31,"userFrames":[[17,3099680],[951,13061776],[951,13096256],[951,13094784],[951,220548],[951,217852],[951,166032],[951,216864],[952,20620],[2,0]],"userTime":4.1189715830000004,"waitEvent":[2,2492331541163208757],"continuation":[1,5775044],"systemTime":0.23855416600000001,"name":"main"},"732550":{"id":732550,"schedPriority":31,"system_usec":5629,"state":["TH_WAIT"],"user_usec":18884,"basePriority":31,"userFrames":[[17,3089008],[951,15582540],[951,15580896],[951,15556468],[17,3326572],[17,3305612]],"userTime":0.018884208,"waitEvent":[2,2492331499932619625],"continuation":[27,17956],"systemTime":0.0056290410000000004,"name":"V8 DefaultWorke"},"732553":{"id":732553,"schedPriority":31,"system_usec":8638,"state":["TH_WAIT"],"user_usec":29534,"basePriority":31,"userFrames":[[17,3089008],[951,15582540],[951,15580896],[951,15556468],[17,3326572],[17,3305612]],"userTime":0.029534458,"waitEvent":[2,2492331499932619625],"continuation":[27,17956],"systemTime":0.0086381659999999992,"name":"V8 DefaultWorke"},"732551":{"id":732551,"schedPriority":31,"system_usec":8625,"state":["TH_WAIT"],"user_usec":31062,"basePriority":31,"userFrames":[[17,3089008],[951,15582540],[951,15580896],[951,15556468],[17,3326572],[17,3305612]],"userTime":0.031062583000000001,"waitEvent":[2,2492331499932619625],"continuation":[27,17956],"systemTime":0.0086256660000000006,"name":"V8 DefaultWorke"},"732554":{"id":732554,"schedPriority":31,"system_usec":4513,"state":["TH_WAIT"],"user_usec":32784,"basePriority":31,"userFrames":[[17,3089008],[951,15582540],[951,15580896],[951,15556468],[17,3326572],[17,3305612]],"userTime":0.032784541,"waitEvent":[2,2492331499932619625],"continuation":[27,17956],"systemTime":0.0045134579999999997,"name":"V8 DefaultWorke"},"732552":{"id":732552,"schedPriority":31,"system_usec":5246,"state":["TH_WAIT"],"user_usec":19390,"basePriority":31,"userFrames":[[17,3089008],[951,15582540],[951,15580896],[951,15556468],[17,3326572],[17,3305612]],"userTime":0.019390500000000001,"waitEvent":[2,2492331499932619625],"continuation":[27,17956],"systemTime":0.00524625,"name":"V8 DefaultWorke"},"732556":{"id":732556,"schedPriority":31,"system_usec":2936,"state":["TH_WAIT"],"user_usec":28773,"basePriority":31,"userFrames":[[17,3089008],[951,15582540],[951,15580896],[951,15556468],[17,3326572],[17,3305612]],"userTime":0.028773957999999999,"waitEvent":[2,2492331499932619625],"continuation":[27,17956],"systemTime":0.0029367080000000001,"name":"V8 DefaultWorke"}},"pageFaults":17612,"userTimeTask":4.3213846660000002,"pid":84706,"systemTimeTask":0.43248762499999999,"flags":["boosted"],"residentMemoryBytes":70174848},
    "84720" : {"timesThrottled":0,"pageIns":0,"timesDidThrottle":0,"suspendCount":1,"procname":"bsdtar","copyOnWriteFaults":74,"threadById":{"732622":{"continuation":[1,702932],"userTime":4.6511668750000004,"systemTime":0.97096274999999999,"id":732622,"basePriority":31,"user_usec":4651166,"system_usec":970962,"schedPriority":31,"userFrames":[[17,3420380],[17,192078612],[17,192062972],[17,192047716],[17,192054500],[17,192017728],[17,184491116],[17,184470700],[17,184615552],[17,184826048],[953,25532],[953,26352],[953,21728],[954,20620],[2,0]],"state":["TH_WAIT"],"waitEvent":[2,2492331458758466515]}},"pageFaults":839,"userTimeTask":4.6511668750000004,"pid":84720,"systemTimeTask":0.97096274999999999,"flags":["boosted"],"residentMemoryBytes":10814208}

And here's today's.

    "72738" : {"timesThrottled":0,"pageIns":1251,"waitInfo":["thread 40392651: pthread condvar 0x13c6500f0","thread 40392652: pthread condvar 0x13c6500f0","thread 40392653: pthread condvar 0x13c6500f0","thread 40392654: pthread condvar 0x13c6500f0","thread 40392655: pthread condvar 0x13c6500f0","thread 40392656: pthread condvar 0x13c6500f0","thread 40392657: pthread condvar 0x13c6500f0"],"timesDidThrottle":0,"procname":"tea","copyOnWriteFaults":219,"threadById":{"40392652":{"id":40392652,"schedPriority":31,"system_usec":1518,"state":["TH_WAIT"],"user_usec":23581,"basePriority":31,"userFrames":[[17,3089008],[875,15582540],[875,15580896],[875,15556468],[17,3326572],[17,3305612]],"userTime":0.023581332999999999,"waitEvent":[4,6286128247308886459],"continuation":[30,17956],"systemTime":0.0015189159999999999,"name":"V8 DefaultWorke"},"40392656":{"id":40392656,"schedPriority":31,"system_usec":2712,"state":["TH_WAIT"],"user_usec":24946,"basePriority":31,"userFrames":[[17,3089008],[875,15582540],[875,15580896],[875,15556468],[17,3326572],[17,3305612]],"userTime":0.024945999999999999,"waitEvent":[4,6286128247308886459],"continuation":[30,17956],"systemTime":0.0027127499999999999,"name":"V8 DefaultWorke"},"40392651":{"id":40392651,"schedPriority":31,"system_usec":1217,"state":["TH_WAIT"],"user_usec":12480,"basePriority":31,"userFrames":[[17,3089008],[875,15582540],[875,15580896],[875,15556468],[17,3326572],[17,3305612]],"userTime":0.012480583,"waitEvent":[4,6286128247308886459],"continuation":[30,17956],"systemTime":0.001217166,"name":"V8 DefaultWorke"},"40392655":{"id":40392655,"schedPriority":31,"system_usec":1678,"state":["TH_WAIT"],"user_usec":28937,"basePriority":31,"userFrames":[[17,3089008],[875,15582540],[875,15580896],[875,15556468],[17,3326572],[17,3305612]],"userTime":0.028937541000000001,"waitEvent":[4,6286128247308886459],"continuation":[30,17956],"systemTime":0.0016786660000000001,"name":"V8 DefaultWorke"},"40392654":{"id":40392654,"schedPriority":31,"system_usec":1326,"state":["TH_WAIT"],"user_usec":20355,"basePriority":31,"userFrames":[[17,3089008],[875,15582540],[875,15580896],[875,15556468],[17,3326572],[17,3305612]],"userTime":0.020355458,"waitEvent":[4,6286128247308886459],"continuation":[30,17956],"systemTime":0.001326083,"name":"V8 DefaultWorke"},"40392649":{"id":40392649,"schedPriority":31,"system_usec":120585,"state":["TH_WAIT"],"user_usec":1324912,"basePriority":31,"userFrames":[[17,3099680],[875,13061776],[875,13096256],[875,13094784],[875,220548],[875,217852],[875,166032],[875,216864],[876,20620],[4,0]],"userTime":1.324912833,"waitEvent":[4,6286128206098433399],"continuation":[1,5775044],"systemTime":0.120585791,"name":"main"},"40392653":{"id":40392653,"schedPriority":31,"system_usec":1213,"state":["TH_WAIT"],"user_usec":15521,"basePriority":31,"userFrames":[[17,3089008],[875,15582540],[875,15580896],[875,15556468],[17,3326572],[17,3305612]],"userTime":0.015521083,"waitEvent":[4,6286128247308886459],"continuation":[30,17956],"systemTime":0.00121375,"name":"V8 DefaultWorke"},"40392657":{"id":40392657,"schedPriority":31,"system_usec":1199,"state":["TH_WAIT"],"user_usec":8191,"basePriority":31,"userFrames":[[17,3089008],[875,15582540],[875,15580896],[875,15556468],[17,3326572],[17,3305612]],"userTime":0.008191416,"waitEvent":[4,6286128247308886459],"continuation":[30,17956],"systemTime":0.00119925,"name":"V8 DefaultWorke"}},"pageFaults":18284,"userTimeTask":1.4642603750000001,"pid":72738,"systemTimeTask":0.17999595800000001,"flags":["boosted"],"residentMemoryBytes":271632384},
    "72745" : {"timesThrottled":0,"pageIns":9,"timesDidThrottle":0,"suspendCount":1,"procname":"bsdtar","copyOnWriteFaults":69,"threadById":{"40392697":{"continuation":[1,702932],"userTime":1.554200375,"systemTime":0.75814662499999996,"id":40392697,"basePriority":31,"user_usec":1554200,"system_usec":758146,"schedPriority":31,"userFrames":[[17,3090168],[17,184499420],[17,184826068],[877,25532],[877,26352],[877,21728],[878,20620],[4,0]],"state":["TH_WAIT"],"waitEvent":[4,6286128206059624725]}},"pageFaults":863,"userTimeTask":1.554200375,"pid":72745,"systemTimeTask":0.75814662499999996,"flags":["boosted"],"residentMemoryBytes":10732288}

magnusviri avatar Nov 17 '22 00:11 magnusviri

That is deeply weird. It... seems unlikely that tar is the culprit, as many of us have been running and developing tea on a variety of m1/m2 hardware for more than half a year.

Going momentarily down the rabbit hole for a second, I assume your tar looks something like this:

$ which -a tar
/usr/bin/tar
$ which -a bsdtar
/usr/bin/bsdtar
$ tar --version
bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8
$ bsdtar --version
bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8

I suppose it's possible that tar is reaching for tea's version of zlib. What does: tea +python.org otool -l $(which bsdtar) | grep dylib show?

com.apple.filesystems.msdosfs certainly is suspicious. I assume you have a USB drive formatted with ExtFAT? And the prior panic mentions com.apple.filesystems.smbfs, which is a Windows share. I wonder if those filesystems are hanging long enough to panic the kernel watchdog. But all of that should be very little interaction with tea, even if you're running it on a share/external drive. So, I'm both concerned and mystified. There's no reason why tea should be panicking Apple filesystem drivers.

jhheider avatar Nov 17 '22 00:11 jhheider

@mxcl any of this tweak your spidey sense?

jhheider avatar Nov 17 '22 00:11 jhheider

> tar --version
bsdtar 3.5.1 - libarchive 3.5.1 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8
> bsdtar --version
bsdtar 3.5.1 - libarchive 3.5.1 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8
> tea +python.org otool -l $(which bsdtar) | grep dylib
         name /usr/lib/libarchive.2.dylib (offset 24)
         name /usr/lib/libSystem.B.dylib (offset 24)

I mount smb volumes all the time, which probably explains that kext. I think the msdos driver is because I probably put in a Windows USB stick, but I can't remember when I did that. It would've been last week probably.

magnusviri avatar Nov 17 '22 00:11 magnusviri

I can't possibly fault either of those things, as they're completely normal operations that shouldn't cause issues. I suppose if the mount for either had disappeared and tea tried to read from it, that could, but never should, cause something to hang.

Hopefully, those are just red herrings; but it's a weird coincidence that both panics reference Apple drivers for Microsoft(-related) filesystems.

jhheider avatar Nov 17 '22 00:11 jhheider

I'm pretty sure I was connected to a VPN when both kernel panics happened. I just connected again and installed something and it didn't panic. I'll try to be really watchful. If I can't get to the bottom of this I may just re-install my OS.

magnusviri avatar Nov 17 '22 06:11 magnusviri

wow. We’re really not doing anything fancy so this is super unexpected.

  1. Firstly, a kernel panic is Apple’s bug.
  2. However, secondly, obv we cannot just say “wait for Apple to fix it” so if we can figure out what we are doing to cause this we will work around it.
  3. Possibly it's a coincidence, did you get unexpected panics before you started using tea?

tea itself only writes to ~/.tea, it doesn’t even write to /tmp (we make our own tmp in ~/.tea) so it seems unrelated to where we are writing stuff.

Could use a general dump of info: CPU, macOS version, etc.

mxcl avatar Nov 17 '22 13:11 mxcl

I'm getting the same issue as @magnusviri. If you need any info from me @mxcl would be willing to help debug.

Just general info I've got a MacBook with M1 Pro and Ventura Beta 3.

tomlazar avatar Nov 21 '22 16:11 tomlazar

@mxcl except for the 2 I've reported here, I haven't had a kernel panic in years. My stats are in the first message of this issue ("macOS 12.6 (21G115)", "MacBookAir10,1",).

magnusviri avatar Nov 21 '22 17:11 magnusviri

It looks like something with calling gum inside the script file. For example with the welcome function. When I call it outside of the script, it runs file, calling it inside causes the seg-fault

tomlazar avatar Nov 21 '22 17:11 tomlazar

This may be unrelated, but I know that there have been issues with Apple's bsdtar + libarchive implementation having bad interactions with filesystems (including APFS). Homebrew solved this partially by calling sudo purge a bunch on macOS prior to and following bsdtar operations, and partially by using gnu-tar as much as possible.

jonchang avatar Nov 21 '22 17:11 jonchang

I installed the latest dev version of gum using go install github.com/charmbracelet/gum@eb3c5c1 and removing the gum related steps in the install script, so it would just use the system install, and it fixed the issue.

tomlazar avatar Nov 21 '22 17:11 tomlazar

Gum causing a kernel panic is as surprising to me as tea. It shouldn't be doing anything fancy with syscalls. Filesystems, at least, are kernel domain naturally, so triggering a filesystem bug doesn't seem crazy. But in Apple core code? This is unexpected all around.

jhheider avatar Nov 21 '22 17:11 jhheider

@magnusviri had any more of these?

mxcl avatar Dec 02 '22 20:12 mxcl

It has not happened again, but I haven't really installed much with tea in a while. I'll close this issue, but here's what I'll do. I just wrote a shell script that is running a while loop that uninstalls and reinstalls tea and every tea package. I'll let it run all weekend, and heck, why not all next week too? If tea is causing kernel panics, this should expose it.

magnusviri avatar Dec 03 '22 06:12 magnusviri

see what happen to tea is when the program started to run his ALERT when off and was able to reroute the signal in two forms one apple got cut the and the other apple was left for experimental procedure, in zero

603C1402B avatar Dec 09 '22 05:12 603C1402B

@603C1402B, I didn't quite understand what you were saying. What is the alert you refer to?

Ironically, I did uninstall and reinstall all the tea packages (9 GB) over and over last weekend and no problems. But I had to disable Ransomwhere. I'm wondering if maybe it had something to do with the kernel panics. Is that the alert you are referring to?

magnusviri avatar Dec 09 '22 05:12 magnusviri

@magnusviri for me since my device are apple I found out that my accounts were being’ targeted by my ex I began doing a lot of reading of the developers options on my phone and when the hand shake was being done over a call I had a sensation an I deleted my esims witch made her computer panic attack it’s own software, since the program was designed to retrieve . Well that tigger me an got me interested on the program would u have any ideas on what will be a good command method to block her out my account r freeze all the loans she was trying to get

603C1402B avatar Dec 09 '22 07:12 603C1402B

@magnusviri bots from morons who think we will gift token based on comments on our repos.

Token will only be rewarded for actual code contributions.

mxcl avatar Dec 12 '22 14:12 mxcl