[smartmontools-support] smartd Segmentation fault: 11 with Apple Silicon based Mac

桃源老師 xanadu6291 at dream.jp
Wed Nov 20 05:10:08 CET 2024


Hello,

I've got smartd Segmentation fault: 11 with Apple Silicon based Mac.  First of all, I don't have any problem with Intel based Mac.  The version of smartmontools on Intel based Mac is 7.4.  However, with Apple Silicon based Mac, I've got Segmentation fault: 11.  It occurs exactly after 30 minutes from smartd launch.  I mean that smartd would be shut down by Operating System 30 minutes after launch.  Yes, the 30 minutes might be mean that smartd's periodic check timing of disks/ssd.  I have tested pre-compiled 7.4, 7.5-5637, source tar ball of 7.5-5637, but the result was same.  

Does anyone have any thought regarding this problem?



Here's log of segmentation fault: 

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               smartd [40011]
Path:                  /usr/local/sbin/smartd
Identifier:            smartd
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        launchd [1]
User ID:               501

Date/Time:             2024-11-20 01:37:43.7368 +0900
OS Version:            macOS 14.7.1 (23H222)
Report Version:        12
Anonymous UUID:        C4F99C35-8E37-C3FC-F625-13645F4F7733

Sleep/Wake UUID:       C8131919-FE04-4A0C-B92C-93C7B0D7CAF2

Time Awake Since Boot: 380000 seconds
Time Since Wake:       103064 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000100920a72
Exception Codes:       0x0000000000000001, 0x0000000100920a72

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [40011]

VM Region Info: 0x100920a72 is not in any region.  Bytes after previous region: 2675  Bytes before following region: 533591438
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      shared memory               10091c000-100920000    [   16K] r--/r-- SM=SHM  
--->  GAP OF 0x1fce0000 BYTES
      MALLOC_TINY                 120600000-120700000    [ 1024K] rw-/rwx SM=COW  

Application Specific Information:
crashed on child side of fork pre-exec


Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_trace.dylib         	       0x18b97f0c0 _os_log_preferences_refresh + 68
1   libsystem_trace.dylib         	       0x18b97fb20 os_log_type_enabled + 712
2   CoreFoundation                	       0x18bd92030 CFPlugInFindFactoriesForPlugInTypeInPlugIn + 316
3   IOKit                         	       0x18f3f74b0 IOCreatePlugInInterfaceForService + 496
4   smartd                        	       0x10041d0a8 os::darwin_smart_device::open() + 1288 (os_darwin.cpp:261)
5   smartd                        	       0x1003fb3ec open_device(dev_config const&, dev_state&, smart_device*, char const*) + 188 (smartd.cpp:2940)
6   smartd                        	       0x1003ef4ec NVMeCheckDevice(dev_config const&, dev_state&, nvme_device*, bool, bool) + 28 (smartd.cpp:4064) [inlined]
7   smartd                        	       0x1003ef4ec CheckDevicesOnce(std::__1::vector<dev_config, std::__1::allocator<dev_config>> const&, std::__1::vector<dev_state, std::__1::allocator<dev_state>>&, smart_device_list&, bool, bool) + 972 (smartd.cpp:4265)
8   smartd                        	       0x1003ecdc4 main_worker(int, char**) + 8244 (smartd.cpp:6071)
9   smartd                        	       0x1003eaca0 main + 20 (smartd.cpp:6164)
10  dyld                          	       0x18b8a7154 start + 2476


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x00000001f3a88fec   x1: 0x0000000000000303   x2: 0x0000000000000303   x3: 0x0000000000000303
    x4: 0x0000000000000063   x5: 0x0000000000000073   x6: 0x000000000000006c   x7: 0x0000000000000000
    x8: 0x0000000100920a70   x9: 0x00000001f3a93610  x10: 0x0000000000000001  x11: 0x0000600002c758b0
   x12: 0x0000000000000001  x13: 0x0000600000568730  x14: 0x01000001f3aa0d59  x15: 0x00000001f3aa0d58
   x16: 0x000000018bbf17b4  x17: 0x00000001fe18aa50  x18: 0x0000000000000000  x19: 0x0000600002c75880
   x20: 0x0000600002c75880  x21: 0x0000000100920a74  x22: 0x0000000100920a74  x23: 0x0000000000000001
   x24: 0x0000000000000001  x25: 0x000000000000003c  x26: 0x0000600003971aa0  x27: 0x0000000140604580
   x28: 0x0000000000000000   fp: 0x000000016fa130c0   lr: 0x000000018b97f0a4
    sp: 0x000000016fa13070   pc: 0x000000018b97f0c0 cpsr: 0x20001000
   far: 0x0000000100920a72  esr: 0x92000007 (Data Abort) byte read Translation fault

Binary Images:
       0x100494000 -        0x100497fff com.binaryfruit.driver.SATSMARTLib (1.0) <77b824f8-a285-30c8-8738-a3ebf32c7ba0> /Library/Extensions/SATSMARTLib.plugin/Contents/MacOS/SATSMARTLib
       0x1004bc000 -        0x1004bffff com.apple.NVMeSMARTLib (1.0) <02bcbca5-583e-3e87-b36e-b7ef6f1996e2> /System/Library/Extensions/NVMeSMARTLib.plugin/Contents/MacOS/NVMeSMARTLib
       0x1003e8000 -        0x10044bfff smartd (*) <2bc01be1-d03e-32b8-86fd-8ea594343f74> /usr/local/sbin/smartd
       0x18b97b000 -        0x18b995fff libsystem_trace.dylib (*) <ee3d146a-7bdc-3ada-9a6e-2fcabc0b0aa7> /usr/lib/system/libsystem_trace.dylib
       0x18bc93000 -        0x18c16bfff com.apple.CoreFoundation (6.9) <541c3d67-9162-32dc-bd2c-894dd0f013aa> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
       0x18f3e9000 -        0x18f4cbfff com.apple.framework.IOKit (2.0.2) <97884c3c-e494-3ed4-b4cb-7f55905ad062> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
       0x18b8a1000 -        0x18b92a50b dyld (*) <88b1da61-4519-33f6-9297-ac4de0cd940c> /usr/lib/dyld
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
       0x18bbf0000 -        0x18bc2afeb libsystem_kernel.dylib (*) <93265230-13ff-3bb7-8ba0-6cee115f67b8> /usr/lib/system/libsystem_kernel.dylib

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=740.8M resident=0K(0%) swapped_out_or_unallocated=740.8M(100%)
Writable regions: Total=951.6M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=951.6M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Activity Tracing                   256K        1 
Kernel Alloc Once                   32K        1 
MALLOC                           943.2M       24 
MALLOC guard page                   96K        6 
STACK GUARD                       56.0M        1 
Stack                             8176K        1 
__AUTH                             644K      143 
__AUTH_CONST                      11.0M      286 
__DATA                            2822K      275 
__DATA_CONST                      13.3M      290 
__DATA_DIRTY                       479K       95 
__FONT_DATA                          4K        1 
__LINKEDIT                       525.4M        4 
__OBJC_RO                         71.9M        1 
__OBJC_RW                         2200K        1 
__TEXT                           215.4M      303 
dyld private memory                272K        2 
shared memory                       32K        2 
===========                     =======  ======= 
TOTAL                              1.8G     1437 



-----------
Full Report
-----------

{"app_name":"smartd","timestamp":"2024-11-20 01:37:44.00 +0900","app_version":"","slice_uuid":"2bc01be1-d03e-32b8-86fd-8ea594343f74","build_version":"","platform":1,"share_with_app_devs":1,"is_first_party":1,"bug_type":"309","os_version":"macOS 14.7.1 (23H222)","roots_installed":0,"incident_id":"73F56263-8C09-425D-A9A1-DC9448FC04C7","name":"smartd"}
{
  "uptime" : 380000,
  "procRole" : "Unspecified",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "Mac14,15",
  "coalitionID" : 103361,
  "osVersion" : {
    "train" : "macOS 14.7.1",
    "build" : "23H222",
    "releaseType" : "User"
  },
  "captureTime" : "2024-11-20 01:37:43.7368 +0900",
  "codeSigningMonitor" : 1,
  "incident" : "73F56263-8C09-425D-A9A1-DC9448FC04C7",
  "pid" : 40011,
  "translated" : false,
  "cpuType" : "ARM-64",
  "roots_installed" : 0,
  "bug_type" : "309",
  "procLaunch" : "2024-11-20 01:07:43.6585 +0900",
  "procStartAbsTime" : 9091777972175,
  "procExitAbsTime" : 9134979873397,
  "procName" : "smartd",
  "procPath" : "\/usr\/local\/sbin\/smartd",
  "parentProc" : "launchd",
  "parentPid" : 1,
  "coalitionName" : "jp.miyamura.smartd",
  "crashReporterKey" : "C4F99C35-8E37-C3FC-F625-13645F4F7733",
  "responsiblePid" : 40009,
  "codeSigningID" : "smartd",
  "codeSigningTeamID" : "",
  "codeSigningFlags" : 570556929,
  "codeSigningValidationCategory" : 10,
  "codeSigningTrustLevel" : 4294967295,
  "instructionByteStream" : {"beforePC":"\/UMBkfMDAKpmTgCUGQBAufMMALRoDkD5FREAkR8BAPH2A5WaSAwAtA==","atPC":"CQlAOQgBCYsUEQCR\/wcA+WgINJAAlUP5wAEAtOEDFqreUQCU9wMAqg=="},
  "wakeTime" : 103064,
  "sleepWakeUUID" : "C8131919-FE04-4A0C-B92C-93C7B0D7CAF2",
  "sip" : "enabled",
  "vmRegionInfo" : "0x100920a72 is not in any region.  Bytes after previous region: 2675  Bytes before following region: 533591438\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      shared memory               10091c000-100920000    [   16K] r--\/r-- SM=SHM  \n--->  GAP OF 0x1fce0000 BYTES\n      MALLOC_TINY                 120600000-120700000    [ 1024K] rw-\/rwx SM=COW  ",
  "exception" : {"codes":"0x0000000000000001, 0x0000000100920a72","rawCodes":[1,4304538226],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_INVALID_ADDRESS at 0x0000000100920a72"},
  "termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"exc handler","byPid":40011},
  "vmregioninfo" : "0x100920a72 is not in any region.  Bytes after previous region: 2675  Bytes before following region: 533591438\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      shared memory               10091c000-100920000    [   16K] r--\/r-- SM=SHM  \n--->  GAP OF 0x1fce0000 BYTES\n      MALLOC_TINY                 120600000-120700000    [ 1024K] rw-\/rwx SM=COW  ",
  "asi" : {"libsystem_c.dylib":["crashed on child side of fork pre-exec"]},
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":3974972,"threadState":{"x":[{"value":8382877676,"symbolLocation":172,"symbol":"_main_thread"},{"value":771},{"value":771},{"value":771},{"value":99},{"value":115},{"value":108},{"value":0},{"value":4304538224},{"value":8382920208,"symbolLocation":0,"symbol":"errno"},{"value":1},{"value":105553162885296},{"value":1},{"value":105553121937200},{"value":72057602420903257,"symbolLocation":72057594037927937,"symbol":"OBJC_CLASS_$___NSCFType"},{"value":8382975320,"symbolLocation":0,"symbol":"OBJC_CLASS_$___NSCFType"},{"value":6639523764,"symbolLocation":0,"symbol":"__error"},{"value":8557996624},{"value":0},{"value":105553162885248},{"value":105553162885248},{"value":4304538228},{"value":4304538228},{"value":1},{"value":1},{"value":60},{"value":105553176500896},{"value":5375018368},{"value":0}],"flavor":"ARM_THREAD_STATE64","lr":{"value":6636957860},"cpsr":{"value":536875008},"fp":{"value":6167802048},"sp":{"value":6167801968},"esr":{"value":2449473543,"description":"(Data Abort) byte read Translation fault"},"pc":{"value":6636957888,"matchesCrashFrame":1},"far":{"value":4304538226}},"queue":"com.apple.main-thread","frames":[{"imageOffset":16576,"symbol":"_os_log_preferences_refresh","symbolLocation":68,"imageIndex":3},{"imageOffset":19232,"symbol":"os_log_type_enabled","symbolLocation":712,"imageIndex":3},{"imageOffset":1044528,"symbol":"CFPlugInFindFactoriesForPlugInTypeInPlugIn","symbolLocation":316,"imageIndex":4},{"imageOffset":58544,"symbol":"IOCreatePlugInInterfaceForService","symbolLocation":496,"imageIndex":5},{"imageOffset":217256,"sourceLine":261,"sourceFile":"os_darwin.cpp","symbol":"os::darwin_smart_device::open()","imageIndex":2,"symbolLocation":1288},{"imageOffset":78828,"sourceLine":2940,"sourceFile":"smartd.cpp","symbol":"open_device(dev_config const&, dev_state&, smart_device*, char const*)","imageIndex":2,"symbolLocation":188},{"symbol":"NVMeCheckDevice(dev_config const&, dev_state&, nvme_device*, bool, bool)","inline":true,"imageIndex":2,"imageOffset":29932,"symbolLocation":28,"sourceLine":4064,"sourceFile":"smartd.cpp"},{"imageOffset":29932,"sourceLine":4265,"sourceFile":"smartd.cpp","symbol":"CheckDevicesOnce(std::__1::vector<dev_config, std::__1::allocator<dev_config>> const&, std::__1::vector<dev_state, std::__1::allocator<dev_state>>&, smart_device_list&, bool, bool)","imageIndex":2,"symbolLocation":972},{"imageOffset":19908,"sourceLine":6071,"sourceFile":"smartd.cpp","symbol":"main_worker(int, char**)","imageIndex":2,"symbolLocation":8244},{"imageOffset":11424,"sourceLine":6164,"sourceFile":"smartd.cpp","symbol":"main","imageIndex":2,"symbolLocation":20},{"imageOffset":24916,"symbol":"start","symbolLocation":2476,"imageIndex":6}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4299767808,
    "CFBundleShortVersionString" : "1.0",
    "CFBundleIdentifier" : "com.binaryfruit.driver.SATSMARTLib",
    "size" : 16384,
    "uuid" : "77b824f8-a285-30c8-8738-a3ebf32c7ba0",
    "path" : "\/Library\/Extensions\/SATSMARTLib.plugin\/Contents\/MacOS\/SATSMARTLib",
    "name" : "SATSMARTLib",
    "CFBundleVersion" : "0.10.3"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 4299931648,
    "CFBundleShortVersionString" : "1.0",
    "CFBundleIdentifier" : "com.apple.NVMeSMARTLib",
    "size" : 16384,
    "uuid" : "02bcbca5-583e-3e87-b36e-b7ef6f1996e2",
    "path" : "\/System\/Library\/Extensions\/NVMeSMARTLib.plugin\/Contents\/MacOS\/NVMeSMARTLib",
    "name" : "NVMeSMARTLib",
    "CFBundleVersion" : "1"
  },
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4299063296,
    "size" : 409600,
    "uuid" : "2bc01be1-d03e-32b8-86fd-8ea594343f74",
    "path" : "\/usr\/local\/sbin\/smartd",
    "name" : "smartd"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6636941312,
    "size" : 110592,
    "uuid" : "ee3d146a-7bdc-3ada-9a6e-2fcabc0b0aa7",
    "path" : "\/usr\/lib\/system\/libsystem_trace.dylib",
    "name" : "libsystem_trace.dylib"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6640185344,
    "CFBundleShortVersionString" : "6.9",
    "CFBundleIdentifier" : "com.apple.CoreFoundation",
    "size" : 5083136,
    "uuid" : "541c3d67-9162-32dc-bd2c-894dd0f013aa",
    "path" : "\/System\/Library\/Frameworks\/CoreFoundation.framework\/Versions\/A\/CoreFoundation",
    "name" : "CoreFoundation",
    "CFBundleVersion" : "2602.0.901"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6698209280,
    "CFBundleShortVersionString" : "2.0.2",
    "CFBundleIdentifier" : "com.apple.framework.IOKit",
    "size" : 929792,
    "uuid" : "97884c3c-e494-3ed4-b4cb-7f55905ad062",
    "path" : "\/System\/Library\/Frameworks\/IOKit.framework\/Versions\/A\/IOKit",
    "name" : "IOKit"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6636048384,
    "size" : 562444,
    "uuid" : "88b1da61-4519-33f6-9297-ac4de0cd940c",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6639517696,
    "size" : 241644,
    "uuid" : "93265230-13ff-3bb7-8ba0-6cee115f67b8",
    "path" : "\/usr\/lib\/system\/libsystem_kernel.dylib",
    "name" : "libsystem_kernel.dylib"
  }
],
  "sharedCache" : {
  "base" : 6635290624,
  "size" : 4214374400,
  "uuid" : "8047f785-c408-34e1-a0a8-38ee34ab89f4"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=740.8M resident=0K(0%) swapped_out_or_unallocated=740.8M(100%)\nWritable regions: Total=951.6M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=951.6M(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nActivity Tracing                   256K        1 \nKernel Alloc Once                   32K        1 \nMALLOC                           943.2M       24 \nMALLOC guard page                   96K        6 \nSTACK GUARD                       56.0M        1 \nStack                             8176K        1 \n__AUTH                             644K      143 \n__AUTH_CONST                      11.0M      286 \n__DATA                            2822K      275 \n__DATA_CONST                      13.3M      290 \n__DATA_DIRTY                       479K       95 \n__FONT_DATA                          4K        1 \n__LINKEDIT                       525.4M        4 \n__OBJC_RO                         71.9M        1 \n__OBJC_RW                         2200K        1 \n__TEXT                           215.4M      303 \ndyld private memory                272K        2 \nshared memory                       32K        2 \n===========                     =======  ======= \nTOTAL                              1.8G     1437 \n",
  "legacyInfo" : {
  "threadTriggered" : {
    "queue" : "com.apple.main-thread"
  }
},
  "logWritingSignature" : "d60d1341e37eb27465e5bda7f37ffaf08e7833e2",
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "6112d17137f5d11121dcd4e2",
      "factorPackIds" : {

      },
      "deploymentId" : 240000570
    },
    {
      "rolloutId" : "645eb1d0417dab722a215927",
      "factorPackIds" : {

      },
      "deploymentId" : 240000005
    }
  ],
  "experiments" : [

  ]
}
}


Here's configure option of smartmontools: 

./configure --with-savestates --with-attributelog --with-nvme-devicescan


Here's configuration of smartmontools: 

-----------------------------------------------------------------------------
smartmontools-7.5 configuration:
host operating system:  aarch64-apple-darwin23.6.0
C++ compiler:           g++ -std=gnu++11
C compiler:             gcc
preprocessor flags:      C++ compiler flags:     -g -O2 -Wall -W -Wformat=2 -Werror=return-type -fstack-protector-strong
C compiler flags:       -g -O2
linker flags:            OS specific modules:    os_darwin.o -framework CoreFoundation -framework IOKit  Reproducible build:     [disabled]
binary install path:    /usr/local/sbin
man page install path:  /usr/local/share/man
doc file install path:  /usr/local/share/doc/smartmontools
examples install path:  /usr/local/share/doc/smartmontools/examplescripts
drive database file:    /usr/local/share/smartmontools/drivedb.h
database update script: /usr/local/sbin/update-smart-drivedb
database update branch: branches/RELEASE_7_3_DRIVEDB
download tools:         curl wget lynx svn
GnuPG for verification: gpg
local drive database:   /usr/local/etc/smart_drivedb.h
smartd config file:     /usr/local/etc/smartd.conf
smartd warning script:  /usr/local/etc/smartd_warning.sh
smartd plugin path:     /usr/local/etc/smartd_warning.d
PATH within scripts:    /usr/local/bin:/usr/bin:/bin
smartd initd script:    [disabled]
smartd save files:      /usr/local/var/lib/smartmontools/smartd.MODEL-SERIAL.TYPE.state
smartd attribute logs:  /usr/local/var/lib/smartmontools/attrlog.MODEL-SERIAL.TYPE.csv
NVMe DEVICESCAN:        yes
-----------------------------------------------------------------------------


And here's contents of smartd.conf: 

# This is configuration for smartd on my MacBook Air 2023 15
  # /dev/disk0 -M test -m roushi at localhost # For E-Mail test
  # /dev/disk0(Startup Disk) is NVMe, so excluded from DEVICESCAN. Thus I
# intentionally add as diffrent device.
#
# See https://bugs.launchpad.net/ubuntu/+source/smartmontools/+bug/1685332
#
/dev/disk0 -d nvme \                 # Disk is NVMe
           -H \                      # Check NVMe device health
           -l error \                # Check NVMe error count
           -m roushi at localhost       # Send E-Mail to this address
  DEVICESCAN -d removable \            # Disk is removable
           -o on \                   # Automatic test when smartd starts
           -m roushi at localhost       # Send E-Mail to this address


Best Regards,

Kimio Miyamura


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: not available
URL: <https://listi.jpberlin.de/pipermail/smartmontools-support/attachments/20241120/14f02548/attachment-0001.p7s>


More information about the Smartmontools-support mailing list