NetLogo / NetLogo

turtles, patches, and links for kids, teachers, and scientists
http://ccl.northwestern.edu/netlogo/
1.02k stars 244 forks source link

NetLogo can crash when opening on some ARM macOS computers #2080

Open LaCuneta opened 1 year ago

LaCuneta commented 1 year ago

A user reported a crash on opening NetLogo on their ARM macOS 12.5 computer. This affects at least NetLogo 6.2.2 and 6.3.0, so it's not Java 17 specific. Full crash report is below. It's unfortunately light on details and I wasn't able to turn up much on what might be the root cause from it.

I have a workaround that I'll add in a comment so I can link directly to it.

One thing I wasn't able to test, since I didn't want to burden the user further after getting the workaround going for them, was installing a regular x86-64 version of Java 17 and seeing if the script worked. That would indicate the failure was somewhere in our MacApplication wrapper class and not in the core NetLogo code.

The root cause here has to be a hardware conflict, a change in Apple software, or a conflict Java is creating, since we know NetLogo works on the ARM chips fine on other macOS systems. Java seems unlikely since both Java 8 with 6.2.2 and Java 17 with 6.3.0 fail. We could try to track the actual issue down, but that would be very difficult given that we don't have a system experiencing the issue to work with. As such the correct fix is probably to bundle an ARM-specific Java with NetLogo.

I'll leave this issue open to track workarounds and other reports of this problem as they pop up.

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

Incident Identifier: 668E8E60-D7AB-402A-BFF5-CA2A571E92AD
CrashReporter Key:   20547B3E-4867-47EB-8AEA-922C5D6DD19E
Hardware Model:      MacBookAir10,1
Process:             NetLogo [64576]
Path:                /Volumes/*/NetLogo 6.2.2.app/Contents/MacOS/NetLogo
Identifier:          org.nlogo.NetLogo
Version:             6.2.2 (6.2.2)
Code Type:           X86-64 (Native)
Role:                Background
Parent Process:      launchd [1]
Coalition:           org.nlogo.NetLogo [64766]

Date/Time:           2023-01-30 17:14:42.6029 -0600
Launch Time:         2023-01-30 17:14:39.7829 -0600
OS Version:          macOS 12.5 (21G72)
Release Type:        User
Report Version:      104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00007ff7ffe359b0
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: SIGNAL 5 Trace/BPT trap: 5
Terminating Process: exc handler [64576]

Triggered by Thread:  0

Thread 0 Crashed:
0   runtime                          0x7ff7ffe359b0 0x7ff7ffe18000 + 121264
1   runtime                          0x7ff7ffe359f8 0x7ff7ffe18000 + 121336
2   runtime                          0x7ff7ffe2c1a4 0x7ff7ffe18000 + 82340
3   runtime                          0x7ff7ffe2d288 0x7ff7ffe18000 + 86664
4   runtime                          0x7ff7ffe2c9fc 0x7ff7ffe18000 + 84476
5   runtime                          0x7ff7ffe1bae0 0x7ff7ffe18000 + 15072
6   ???                                         0x3 ???

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000003   x2: 0x000000000000003c   x3: 0x000000000000002c
    x4: 0x0000000000000303   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x0000000000006100
    x8: 0x00007ff7ffe53000   x9: 0x0000000000000000  x10: 0x0000000000000000  x11: 0x00007ff7ffe53957
   x12: 0x0000000000000000  x13: 0x0000000000000000  x14: 0x000001b900000100  x15: 0x00007ff7ffe3b818
   x16: 0xffffffffffffffe1  x17: 0x00007ff7ffe446e1  x18: 0x000000030c8f007b  x19: 0x00007ff7ffe492e1
   x20: 0x000000030c8f0730  x21: 0x0000000104309000  x22: 0x0000000000000004  x23: 0x0000000104309000
   x24: 0x0000000000000003  x25: 0x0000000000000001  x26: 0x000000030c8efb90  x27: 0x00000002045c01b8
   x28: 0x000000030c8f8960   fp: 0x000000030c8ee990   lr: 0x00007ff7ffe359a8
    sp: 0x000000030c8ee970   pc: 0x00007ff7ffe359b0 cpsr: 0x60001000
   far: 0x000000030c8ee9a8  esr: 0xf2000001 (Breakpoint) brk 1

Binary Images:
    0x7ff7ffe18000 -     0x7ff7ffe47fff runtime (*) <ef33add1-6b70-3cc9-8bbc-c8544b609d2b> /usr/libexec/rosetta/runtime
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???

Error Formulating Crash Report:
dyld_process_snapshot_get_shared_cache failed

EOF

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

{"app_name":"NetLogo","timestamp":"2023-01-30 17:14:42.00 -0600","app_version":"6.2.2","slice_uuid":"dd6b89fd-f391-38d5-9f5f-9738646dbb6e","build_version":"6.2.2","platform":0,"bundleID":"org.nlogo.NetLogo","share_with_app_devs":1,"is_first_party":0,"bug_type":"309","os_version":"macOS 12.5 (21G72)","incident_id":"668E8E60-D7AB-402A-BFF5-CA2A571E92AD","name":"NetLogo"}
{
  "uptime" : 890000,
  "procLaunch" : "2023-01-30 17:14:39.7829 -0600",
  "procRole" : "Background",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "MacBookAir10,1",
  "procStartAbsTime" : 21507442543883,
  "coalitionID" : 64766,
  "osVersion" : {
    "train" : "macOS 12.5",
    "build" : "21G72",
    "releaseType" : "User"
  },
  "captureTime" : "2023-01-30 17:14:42.6029 -0600",
  "incident" : "668E8E60-D7AB-402A-BFF5-CA2A571E92AD",
  "bug_type" : "309",
  "pid" : 64576,
  "procExitAbsTime" : 21507510213065,
  "translated" : true,
  "cpuType" : "X86-64",
  "procName" : "NetLogo",
  "procPath" : "\/Volumes\/*\/NetLogo 6.2.2.app\/Contents\/MacOS\/NetLogo",
  "bundleInfo" : {"CFBundleShortVersionString":"6.2.2","CFBundleVersion":"6.2.2","CFBundleIdentifier":"org.nlogo.NetLogo"},
  "storeInfo" : {"deviceIdentifierForVendor":"CA352DFD-0E7E-54A7-AA6C-683111A823C7","thirdParty":true},
  "parentProc" : "launchd",
  "parentPid" : 1,
  "coalitionName" : "org.nlogo.NetLogo",
  "crashReporterKey" : "20547B3E-4867-47EB-8AEA-922C5D6DD19E",
  "wakeTime" : 680,
  "sleepWakeUUID" : "41765384-7903-48B9-A977-EF727BDD86BB",
  "sip" : "enabled",
  "isCorpse" : 1,
  "exception" : {"codes":"0x0000000000000001, 0x00007ff7ffe359b0","rawCodes":[1,140703126739376],"type":"EXC_BREAKPOINT","signal":"SIGTRAP"},
  "termination" : {"flags":0,"code":5,"namespace":"SIGNAL","indicator":"Trace\/BPT trap: 5","byProc":"exc handler","byPid":64576},
  "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":10052200,"threadState":{"x":[{"value":0},{"value":3},{"value":60},{"value":44},{"value":771},{"value":0},{"value":0},{"value":24832},{"value":140703126859776},{"value":0},{"value":0},{"value":140703126862167,"symbolLocation":239,"symbol":"__crashreporter_info__"},{"value":0},{"value":0},{"value":1894080577792},{"value":140703126763544},{"value":18446744073709551585},{"value":140703126800097},{"value":13095600251},{"value":140703126819553},{"value":13095601968},{"value":4365258752},{"value":4},{"value":4365258752},{"value":3},{"value":1},{"value":13095598992},{"value":8663073208,"symbolLocation":0,"symbol":"dyld_all_image_infos"},{"value":13095635296}],"flavor":"ARM_THREAD_STATE64","lr":{"value":140703126739368},"cpsr":{"value":1610616832},"fp":{"value":13095594384},"sp":{"value":13095594352},"esr":{"value":4060086273,"description":"(Breakpoint) brk 1"},"pc":{"value":140703126739376,"matchesCrashFrame":1},"far":{"value":13095594408}},"frames":[{"imageOffset":121264,"imageIndex":0},{"imageOffset":121336,"imageIndex":0},{"imageOffset":82340,"imageIndex":0},{"imageOffset":86664,"imageIndex":0},{"imageOffset":84476,"imageIndex":0},{"imageOffset":15072,"imageIndex":0},{"imageOffset":3,"imageIndex":1}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 140703126618112,
    "size" : 196608,
    "uuid" : "ef33add1-6b70-3cc9-8bbc-c8544b609d2b",
    "path" : "\/usr\/libexec\/rosetta\/runtime",
    "name" : "runtime"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  }
],
  "vmSummary" : "ReadOnly portion of Libraries: Total=840K resident=0K(0%) swapped_out_or_unallocated=840K(100%)\nWritable regions: Total=8256K written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=8256K(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nSTACK GUARD                       56.0M        1 \nStack                             8176K        1 \nVM_ALLOCATE (reserved)              32K        1         reserved VM address space (unallocated)\n__DATA                              80K        3 \n__DATA_CONST                        80K        1 \n__LINKEDIT                         240K        4 \n__TEXT                             624K        2 \nmapped file                         32K        3 \n===========                     =======  ======= \nTOTAL                             65.1M       16 \nTOTAL, minus reserved VM space    65.0M       16 \n",
  "legacyInfo" : {
  "threadTriggered" : {

  }
},
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "61af99aeda72d16a4beb7756",
      "factorPackIds" : {
        "SIRI_DIALOG_ASSETS" : "629fe54ebc762c0b6f758b6b"
      },
      "deploymentId" : 240000409
    },
    {
      "rolloutId" : "60356660bbe37970735c5624",
      "factorPackIds" : {

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

  ]
},
  "reportNotes" : [
  "dyld_process_snapshot_get_shared_cache failed"
]
}

Model: MacBookAir10,1, BootROM 7459.141.1, proc 8:4:4 processors, 16 GB, SMC
Graphics: Apple M1, Apple M1, Built-In
Display: Color LCD, 2560 x 1600 Retina, Main, MirrorOff, Online
Memory Module: LPDDR4
AirPort: Wi-Fi, wl0: Mar 23 2022 19:57:59 version 18.60.27.0.7.8.129 FWID 01-570be953
Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
USB Device: USB31Bus
USB Device: USB31Bus
Thunderbolt Bus: MacBook Air, Apple Inc.
Thunderbolt Bus: MacBook Air, Apple Inc.
LaCuneta commented 1 year ago

The workaround:

Unfortunately NetLogo 3D will not work this way (you can usually use a --3D​ switch with the script to open it). We include platform-specific native libraries for NetLogo 3D (JOGL), and we don't bundle the ARM ones for macOS since we don't bundle the ARM Java. I'll look into a workaround for this as well.

platipodium commented 1 year ago

Updated JRE20 https://download.bell-sw.com/java/20.0.1+10/bellsoft-jre20.0.1+10-macos-aarch64-full.dmg