GrapheneOS / os-issue-tracker

Issue tracker for GrapheneOS Android Open Source Project hardening work. Standalone projects like Auditor, AttestationServer and hardened_malloc have their own dedicated trackers.
https://grapheneos.org/
360 stars 21 forks source link

`usb-service` and `thermal-service` crashes #4003

Closed 0x1a8510f2 closed 4 weeks ago

0x1a8510f2 commented 1 month ago

I woke up today to tens or maybe hundreds of notifications about android.hardware.usb-service and android.hardware.thermal-service crashing.

Their respective crash logs look like this:

type: crash
osVersion: google/husky/husky:14/AP2A.240905.003/2024090400:user/release-keys
uid: 1000 (u:r:hal_usb_impl:s0)
cmdline: /vendor/bin/hw/android.hardware.usb-service
processUptime: 0s

signal: 6 (SIGABRT), code -1 (SI_QUEUE)
threadName: android.hardwar
MTE: enabled

backtrace:
    /apex/com.android.runtime/lib64/bionic/libc.so (abort+168, pc 66ac8)
    /vendor/bin/hw/android.hardware.usb-service (aidl::android::hardware::usb::UsbDataSessionMonitor::UsbDataSessionMonitor(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::function<void ()>)+1416, pc 2af58)
    /vendor/bin/hw/android.hardware.usb-service (aidl::android::hardware::usb::Usb::Usb()+564, pc 174d4)
    /vendor/bin/hw/android.hardware.usb-service (main+60, pc 1339c)
    /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+120, pc 5f0a8)
type: crash
osVersion: google/husky/husky:14/AP2A.240905.003/2024090400:user/release-keys
uid: 1000 (u:r:hal_thermal_default:s0)
cmdline: /vendor/bin/hw/android.hardware.thermal-service.pixel
processUptime: 1s

abortMessage: ThermalHAL could not be initialized properly.

signal: 6 (SIGABRT), code -1 (SI_QUEUE)
threadName: android.hardwar
MTE: enabled

backtrace:
    /apex/com.android.runtime/lib64/bionic/libc.so (abort+168, pc 66ac8)
    /system/lib64/liblog.so (__android_log_default_aborter+16, pc 6360)
    /vendor/lib64/libbase.so (android::base::LogMessage::~LogMessage()+356, pc 17414)
    /vendor/bin/hw/android.hardware.thermal-service.pixel (aidl::android::hardware::thermal::implementation::ThermalHelperImpl::ThermalHelperImpl(std::__1::function<void (aidl::android::hardware::thermal::Temperature const&)> const&)+3596, pc 224ec)
    /vendor/bin/hw/android.hardware.thermal-service.pixel (aidl::android::hardware::thermal::implementation::Thermal::Thermal()+164, pc 14f64)
    /vendor/bin/hw/android.hardware.thermal-service.pixel (main+112, pc 14510)
    /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+120, pc 5f0a8)

My phone is typically plugged in overnight but last night it wasn't, so those crashes seem a little out of place.

The phone is a Pixel 8 Pro.

muhomorr commented 1 month ago

Is this a reproducible issue? Capture a full system log from Settings > System > View logs if it is.

0x1a8510f2 commented 1 month ago

If it is then I wouldn't know. It only happened once and I don't recall doing anything to cause it. I'll try to get a full system log if I see it again.

0x1a8510f2 commented 1 month ago

@muhomorr I've been able to repro the issue. In fact, it seems to occur fairly frequently on boot with the latest release (can't confirm about previous releases). I've got a log but I'm not entirely comfortable attaching it publicly. Is there a way to send the logs privately to you / the devs?

muhomorr commented 1 month ago

@0x1a8510f2 Send the log to one of the following places:

Matrix: @muhomorr:grapheneos.org Discord: muhomorr_ (with underscore at the end) Email: muhomorr@grapheneos.org

muhomorr commented 1 month ago

@0x1a8510f2 The log that you've sent doesn't contain these crashes. Was the log captured immediately after the crashes occurred?

0x1a8510f2 commented 1 month ago

I'm pretty sure, yeah. The crashes happened after a reboot and I went to get the log immediately. I'll see if I can repro and get another logcat cause this seems to happen after reboots usually.

0x1a8510f2 commented 1 month ago

Sending you another log. This time just the thermal service crashing after reboot. Got the log immediately after unlocking my phone so I hope the needed information is in there.

IMG.jpg

muhomorr commented 1 month ago

There's no crash in this log either. These crash reports are due to a separate issue: historical crash reports are re-processed by the OS at boot in some cases, which triggers the GrapheneOS crash report UI.

0x1a8510f2 commented 1 month ago

I see. Is there any way to get notified as soon as the crash occurs so I can get you the correct log?

muhomorr commented 1 month ago

Capture a log if there are multiple crashes in a row of android.hardware.usb-service and android.hardware.thermal-service.pixel again, as you've stated in the original post.

0x1a8510f2 commented 1 month ago

The issue is, I'm not getting any indication of the crashes, except those notifications on reboot. So if that's not when the crash happens then I don't know when it does.

muhomorr commented 1 month ago

I'm not getting any indication of the crashes, except those notifications on reboot

This means that there's no new crashes. One-time crash reports right after boot are due to a crash reporting bug.

muhomorr commented 4 weeks ago

@0x1a8510f2 Are you still getting these crashes and/or crash reports? 2024100800 release contains changes that should help with these issues.

0x1a8510f2 commented 4 weeks ago

I have not seen this notification for some time now, but I have noticed that my USB OTG isn't working at all at the moment. Specifically, nothing happens when I plug a USB mass storage device or crypto wallet into my phone. The latter at least, used to work fine maybe a month or two ago. I'm wondering if it has anything to do with those USB service crashes.

For the record, my USB exploit protection is set to the following, and I'm plugging in the device with the phone unlocked:

Screenshot_20241012-190659~2.png

If this is likely to be an unrelated issue though, I'm happy with this issue being closed. I'll re-open if I see the error again.

muhomorr commented 4 weeks ago

Have you checked Settings > Connected devices > USB?

0x1a8510f2 commented 4 weeks ago

I don't even see any "USB" section under "Connected devices".

That's whether a device is currently connected or not.

Should I open a separate issue about this?

IMG_20241013_054935.jpg

muhomorr commented 3 weeks ago

@0x1a8510f2 Need to see a full system log captured right after USB storage device is connected.

0x1a8510f2 commented 3 weeks ago

I'm actually going through the RMA process with Google at the moment because I'm also having some hardware issues with my phone. I'll see if the issue persists once I have my phone back and try to get the log for you then if so.