Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix-daemon not running | macOs 13.2.1 M2 #8112

Closed
jamesschinnerplxs opened this issue Mar 27, 2023 · 2 comments
Closed

nix-daemon not running | macOs 13.2.1 M2 #8112

jamesschinnerplxs opened this issue Mar 27, 2023 · 2 comments

Comments

@jamesschinnerplxs
Copy link

jamesschinnerplxs commented Mar 27, 2023

Platform

macOS

Additional information

Running Chip Apple M2
MacOs 13.2.1 (22D68)

Unable to access nix binaries after standard maxOs install $ sh <(curl -L https://nixos.org/nix/install)

  • Reloaded shell
  • Rebooted
  • Ran launchctl list | grep org.nixos.nix-daemon no output
  • ~/.nix-profile does not exist

Was able to run nix-daemon with:

#3125

launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist && launchctl start org.nixos.nix-daemon

Was able to access binaries after running:

#6273

 export PATH="/nix/var/nix/profiles/default/bin:$PATH"

Output

Checked crash reports in Console program and found the following entry for nix


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

Process:               nix [382]
Path:                  ???
Identifier:            nix
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        launchd [1]
User ID:               0

Date/Time:             2023-03-27 12:26:07.4330 +1100
OS Version:            macOS 13.2.1 (22D68)
Report Version:        12
Anonymous UUID:        2CB7F184-6AF9-3F9E-45F6-AECBC3766953


Time Awake Since Boot: 730 seconds

System Integrity Protection: enabled

Crashed Thread:        1

Exception Type:        EXC_BAD_ACCESS (SIGBUS)
Exception Codes:       KERN_MEMORY_ERROR at 0x0000000102e20250
Exception Codes:       0x000000000000000a, 0x0000000102e20250

Termination Reason:    Namespace SIGNAL, Code 10 Bus error: 10
Terminating Process:   exc handler [382]

VM Region Info: 0x102e20250 is in 0x102da4000-0x102e44000;  bytes after start: 508496  bytes before end: 146863
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      MALLOC guard page           102d9c000-102da0000    [   16K] ---/rwx SM=NUL  
      GAP OF 0x4000 BYTES
--->  mapped file                 102da4000-102e44000    [  640K] r-x/rwx SM=COW  ...t_id=afc60d51
      mapped file                 102e44000-102e4c000    [   32K] r--/rwx SM=COW  ...t_id=b1d50e51

Kernel Triage:
VM - Object has no pager


Thread 0:
0   ???                           	       0x196f6694c ???
1   ???                           	       0x10234865c ???
2   ???                           	       0x1023a05fc ???
3   ???                           	       0x10284fca4 ???
4   ???                           	       0x1023a7154 ???
5   dyld                          	       0x196c73e50 start + 2544

Thread 1 Crashed:
0   ???                           	       0x102e20250 ???
1   ???                           	       0x102e2890c ???
2   ???                           	       0x196f9e06c ???
3   ???                           	       0x196f98e2c ???


Thread 1 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000001e03   x3: 0x000060000115ca80
    x4: 0x000000016dbbf000   x5: 0x00000000190008ff   x6: 0x0000000000000000   x7: 0x0000000000000000
    x8: 0x000000016dbbf0e0   x9: 0x0000000000000003  x10: 0x0000000000000011  x11: 0x0000000000000002
   x12: 0x0000000000000002  x13: 0x0000000000000000  x14: 0x0000000000000000  x15: 0x0000000000000000
   x16: 0x000000000000014a  x17: 0x00000001f738b750  x18: 0x0000000000000000  x19: 0x0000000102e4cdf8
   x20: 0x000000016dbbef88  x21: 0x0000000000000000  x22: 0x0000000000000000  x23: 0x0000000000000000
   x24: 0x0000000000000000  x25: 0x0000000000000000  x26: 0x0000000000000000  x27: 0x0000000000000000
   x28: 0x0000000000000000   fp: 0x000000016dbbefa0   lr: 0x796f800102e20250
    sp: 0x000000016dbbef70   pc: 0x0000000102e20250 cpsr: 0x00001000
   far: 0x0000000102e20250  esr: 0x82000007 (Instruction Abort) Translation fault

Binary Images:
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
       0x196c6e000 -        0x196cf8ba3 dyld (*) <191e84f1-4b95-39c8-b253-1c1ef56c0fa8> /usr/lib/dyld

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=768.3M resident=0K(0%) swapped_out_or_unallocated=768.3M(100%)
Writable regions: Total=1.3G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.3G(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Kernel Alloc Once                   32K        1 
MALLOC                           179.2M       18 
MALLOC guard page                   96K        6 
MALLOC_MEDIUM (reserved)         360.0M        3         reserved VM address space (unallocated)
MALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)
STACK GUARD                       56.0M        2 
Stack                             8720K        2 
VM_ALLOCATE                       2160K        8 
VM_ALLOCATE (reserved)           384.3M        2         reserved VM address space (unallocated)
__DATA                              11K        1 
__DATA_CONST                        22K        1 
__DATA_DIRTY                         7K        1 
__LINKEDIT                       767.8M        1 
__TEXT                             556K        1 
dyld private memory                256K        1 
mapped file                       35.6M      210 
shared memory                       16K        1 
===========                     =======  ======= 
TOTAL                              2.1G      260 
TOTAL, minus reserved VM space     1.0G      260 



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

{"app_name":"nix","timestamp":"2023-03-27 12:26:08.00 +1100","app_version":"","slice_uuid":"00000000-0000-0000-0000-000000000000","build_version":"","platform":1,"share_with_app_devs":0,"is_first_party":1,"bug_type":"309","os_version":"macOS 13.2.1 (22D68)","roots_installed":0,"incident_id":"CA667236-3EF0-4C8B-9464-7792DCF0F968","name":"nix"}
{
  "uptime" : 730,
  "procRole" : "Unspecified",
  "version" : 2,
  "userID" : 0,
  "deployVersion" : 210,
  "modelCode" : "Mac14,7",
  "coalitionID" : 345,
  "osVersion" : {
    "train" : "macOS 13.2.1",
    "build" : "22D68",
    "releaseType" : "User"
  },
  "captureTime" : "2023-03-27 12:26:07.4330 +1100",
  "incident" : "CA667236-3EF0-4C8B-9464-7792DCF0F968",
  "pid" : 382,
  "translated" : false,
  "cpuType" : "ARM-64",
  "roots_installed" : 0,
  "bug_type" : "309",
  "procLaunch" : "2023-03-27 12:14:08.6478 +1100",
  "procStartAbsTime" : 310017057,
  "procExitAbsTime" : 17561045500,
  "procName" : "nix",
  "parentProc" : "launchd",
  "parentPid" : 1,
  "coalitionName" : "org.nixos.nix-daemon",
  "crashReporterKey" : "2CB7F184-6AF9-3F9E-45F6-AECBC3766953",
  "sip" : "enabled",
  "vmRegionInfo" : "0x102e20250 is in 0x102da4000-0x102e44000;  bytes after start: 508496  bytes before end: 146863\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      MALLOC guard page           102d9c000-102da0000    [   16K] ---\/rwx SM=NUL  \n      GAP OF 0x4000 BYTES\n--->  mapped file                 102da4000-102e44000    [  640K] r-x\/rwx SM=COW  ...t_id=afc60d51\n      mapped file                 102e44000-102e4c000    [   32K] r--\/rwx SM=COW  ...t_id=b1d50e51",
  "exception" : {"codes":"0x000000000000000a, 0x0000000102e20250","rawCodes":[10,4343333456],"type":"EXC_BAD_ACCESS","signal":"SIGBUS","subtype":"KERN_MEMORY_ERROR at 0x0000000102e20250"},
  "termination" : {"flags":0,"code":10,"namespace":"SIGNAL","indicator":"Bus error: 10","byProc":"exc handler","byPid":382},
  "ktriageinfo" : "VM - Object has no pager\n",
  "vmregioninfo" : "0x102e20250 is in 0x102da4000-0x102e44000;  bytes after start: 508496  bytes before end: 146863\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      MALLOC guard page           102d9c000-102da0000    [   16K] ---\/rwx SM=NUL  \n      GAP OF 0x4000 BYTES\n--->  mapped file                 102da4000-102e44000    [  640K] r-x\/rwx SM=COW  ...t_id=afc60d51\n      mapped file                 102e44000-102e4c000    [   32K] r--\/rwx SM=COW  ...t_id=b1d50e51",
  "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" : 1,
  "threads" : [{"id":3763,"frames":[{"imageOffset":6827698508,"imageIndex":0},{"imageOffset":4331963996,"imageIndex":0},{"imageOffset":4332324348,"imageIndex":0},{"imageOffset":4337237156,"imageIndex":0},{"imageOffset":4332351828,"imageIndex":0},{"imageOffset":24144,"symbol":"start","symbolLocation":2544,"imageIndex":1}]},{"triggered":true,"id":4098,"threadState":{"x":[{"value":0},{"value":0},{"value":7683},{"value":105553134471808},{"value":6136000512},{"value":419432703},{"value":0},{"value":0},{"value":6136000736},{"value":3},{"value":17},{"value":2},{"value":2},{"value":0},{"value":0},{"value":0},{"value":330},{"value":8442656592},{"value":0},{"value":4343516664},{"value":6136000392},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0}],"flavor":"ARM_THREAD_STATE64","lr":{"value":8750353342835851856},"cpsr":{"value":4096},"fp":{"value":6136000416},"sp":{"value":6136000368},"esr":{"value":2181038087,"description":"(Instruction Abort) Translation fault"},"pc":{"value":4343333456,"matchesCrashFrame":1},"far":{"value":4343333456}},"frames":[{"imageOffset":4343333456,"imageIndex":0},{"imageOffset":4343367948,"imageIndex":0},{"imageOffset":6827925612,"imageIndex":0},{"imageOffset":6827904556,"imageIndex":0}]}],
  "usedImages" : [
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 6824583168,
    "size" : 568228,
    "uuid" : "191e84f1-4b95-39c8-b253-1c1ef56c0fa8",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  }
],
  "sharedCache" : {
  "base" : 6823936000,
  "size" : 3447455744,
  "uuid" : "835716ae-b363-3187-b065-cf94139bfc85"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=768.3M resident=0K(0%) swapped_out_or_unallocated=768.3M(100%)\nWritable regions: Total=1.3G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.3G(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nKernel Alloc Once                   32K        1 \nMALLOC                           179.2M       18 \nMALLOC guard page                   96K        6 \nMALLOC_MEDIUM (reserved)         360.0M        3         reserved VM address space (unallocated)\nMALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)\nSTACK GUARD                       56.0M        2 \nStack                             8720K        2 \nVM_ALLOCATE                       2160K        8 \nVM_ALLOCATE (reserved)           384.3M        2         reserved VM address space (unallocated)\n__DATA                              11K        1 \n__DATA_CONST                        22K        1 \n__DATA_DIRTY                         7K        1 \n__LINKEDIT                       767.8M        1 \n__TEXT                             556K        1 \ndyld private memory                256K        1 \nmapped file                       35.6M      210 \nshared memory                       16K        1 \n===========                     =======  ======= \nTOTAL                              2.1G      260 \nTOTAL, minus reserved VM space     1.0G      260 \n",
  "legacyInfo" : {
  "threadTriggered" : {

  }
}
}

Priorities

Add 👍 to issues you find important.

@abathur
Copy link
Member

abathur commented Mar 27, 2023

The first problem, Nix not being on PATH, generally points to your shell init files either hard-setting a PATH that doesn't include Nix after Nix's shell hook ran (often from one of the user-specific init files in ~/), or perhaps having an early return condition the relevant init file that is keeping the shell hook from running.

If env | grep NIX shows a few variables, that's a good sign the shell hook is at least running and you can focus on looking for what might be overwriting PATH.

@jamesschinnerplxs
Copy link
Author

jamesschinnerplxs commented Mar 27, 2023

env | grep NIX

NIX_PROFILES=/nix/var/nix/profiles/default /Users/jamesschinne/.nix-profile
NIX_SSL_CERT_FILE=/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt

UPDATE

A quick look in ~/.zshrc revealed this line: export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants