[smartmontools-support] smartd Segmentation fault: 11 with Apple Silicon based Mac
Christian Franke
Christian.Franke at t-online.de
Sat Nov 23 16:00:58 CET 2024
桃源老師 wrote:
> Hello Christian - san,
>
> Thank you for your prompt reply...
>
> ...
>
>> Please test whether the segfault could be reproduced in smartd debug mode with a short check interval, for example:
>>
>> smartd -d -i 10
>>
>> (stop with SIGQUIT instead of SIGINT).
> With -d option, smartd never stop. But removing -d option, i.e.
>
> smartd -i 30,
>
> smartd was killed by segfault after 30 seconds running.
>
> Also, using -d option, smartd outputs 'Cannot create state file "/usr/local/var/lib/smartmontools/smartd.APPLE_SSD_AP1024Z-0ba02062208d1420-n0.nvme.state"' to Terminal. ...
This is as expected because /usr/local/var/lib/smartmontools/ is likely
only writable by root.
> ... So I realized that it might need to be add "sudo", i.e.
>
> sudo smartd -i 30,
>
> smartd does not killed by Operating System...
>
> It might be required to add "sudo", execute smartd command as super user, on Apple Silicon based Macs... Am I correct?
Usually smartctl and smartd need to be run as root because transparent
ATA/SCSI/NVMe pass-through functionality is used to directly access the
physical devices. In some cases (macOS, Windows NVMe) the OS only
provides a restricted API instead which only allows to read selected
diagnostic data. The OS may allow access also from regular users then. I
don't know whether macOS allows this.
Even if run without root, smartd should not crash. I have no idea why
this happens in your case (I don't use macOS).
--
Regards,
Christian
More information about the Smartmontools-support
mailing list