https://github.com/osquery/osquery logo
Title
s

Steve Poe

06/10/2022, 12:46 AM
Hi all. I've been recently using osquery 5.2.3 on a M1 Pro laptop, running macOS 12.3.1. After several hours of the use, the palm reset heat-up (no fan). I queried the table
temperature_sensor
for info and it doesn't seem correct:
/usr/local/bin/osqueryi --line "select * from temperature_sensors order by fahrenheit desc;"
       key = TB0T
      name = Battery TS_MAX
   celsius = -1.0
fahrenheit = 30.2

       key = TB1T
      name = Battery 1
   celsius = -1.0
fahrenheit = 30.2

       key = TB2T
      name = Battery 2
   celsius = -1.0
fahrenheit = 30.2

       key = TG0H
      name = GPU Heatsink
   celsius = -1.0
fahrenheit = 30.2

       key = TW0P
      name = Airport Proximity
   celsius = -1.0
fahrenheit = 30.2

       key = Tp0C
      name = Power Supply 1 Alt.
   celsius = -1.0
fahrenheit = 30.2

       key = Ts0P
      name = Palm Rest
   celsius = -1.0
fahrenheit = 30.2
z

zwass

06/10/2022, 12:47 AM
Hmm, maybe an M1 issue? cc @sharvil Values seem plausible on my intel MBP
/usr/local/bin/osqueryi --line "select * from temperature_sensors order by fahrenheit desc;"
       key = TC0F
      name = CPU 1
   celsius = 69.3
fahrenheit = 156.7

       key = TCXC
      name = PECI CPU
   celsius = 69.0
fahrenheit = 156.2

       key = TC2C
      name = CPU Core 2
   celsius = 68.0
fahrenheit = 154.4

       key = TC0E
      name = CPU 1
   celsius = 67.3
fahrenheit = 153.1

       key = TC1C
      name = CPU Core 1
   celsius = 67.0
fahrenheit = 152.6

       key = TC4C
      name = CPU Core 4
   celsius = 67.0
fahrenheit = 152.6

       key = TCSA
      name = PECI SA
   celsius = 67.0
fahrenheit = 152.6

       key = TC3C
      name = CPU Core 3
   celsius = 66.0
fahrenheit = 150.8
Your values look like placeholders that the API is returning for an error state or something like that
s

Steve Poe

06/10/2022, 12:48 AM
That make sense, but the reading is incorrect on my M1 Pro.
z

zwass

06/10/2022, 12:49 AM
It's correct on a desktop M1?
s

Steve Poe

06/10/2022, 12:49 AM
@zwass thanks for making sense of it. So, it isn't sn issue with osquery?
14" M1 Pro.
z

zwass

06/10/2022, 12:49 AM
It could definitely be an issue with osquery
s

Steve Poe

06/10/2022, 12:50 AM
ok.
z

zwass

06/10/2022, 12:50 AM
So it's correct on 14" M1 Pro and incorrect on another M1 Pro?
s

Steve Poe

06/10/2022, 12:50 AM
I don't have another one handy at the moment.
z

zwass

06/10/2022, 12:51 AM
I don't have an M1 handy but folks on our team do -- I would guess there's a firmware difference or something that causes the values returned by the API to be incorrect or something like that.
s

Steve Poe

06/10/2022, 12:52 AM
ok, I'll update to macOS 12.4 then try again. I'll have another M1 Pro available over the weekend with a fresh install.
z

zwass

06/10/2022, 12:53 AM
My Intel MBP on 12.4 is working. But I suspect the issue will be intel vs. M1 rather than 12.4 vs 12.3. Let us know what you find.
s

Steve Poe

06/10/2022, 12:56 AM
I have an i9 8-core that shows proper details
m

Mike Myers

06/10/2022, 1:36 AM
I've opened an issue for you about this https://github.com/osquery/osquery/issues/7627
👍 1
I have access to an M1 Mac Mini, let's see if it has temperature sensors
Well it has one sensor. Definitely reporting the wrong temperature.
30.2ºF is a straight conversion of -1ºC which is an error
😂 1
1
s

Steve Poe

06/10/2022, 2:45 AM
@zwass I did get another M1 Pro laptop this evening, with the latest macOS 12.4, to confirm same symptoms.
s

sharvil

06/10/2022, 11:06 AM
Yeah, this is not expected to work with Apple Silicon, the temperature sensors/fan speeds on Intel SMC keys, and all the power management is now on the SoC
z

zwass

06/10/2022, 3:38 PM
Can we have the table return an error if it's on Apple Silicon rather than bad data?
s

sharvil

06/10/2022, 3:44 PM
@zwass yeah, I think that should be doable
s

Steve Poe

06/10/2022, 4:40 PM
I'd suggest the documentation get a footnote on the schema:
Show only Tables compatible with: macOS
for Intel-only on this table.
m

Mike Myers

06/10/2022, 9:19 PM
I just added a link to some Objective C code that will give us the temperature sensors on Apple Silicon, but it's BSD-3 code so I'll let someone else advise on how to borrow or derive from that
s

seph

06/15/2022, 10:38 AM
https://github.com/GuillaumeGomez/sysinfo/issues/456 has some snippets about which apple framework it's coming from. Which is probably enough for a clean implementation.