Skip to content

PG - bundle dylibs not working properly #7539

@dimitre

Description

@dimitre

@ofTheo I'm trying the new feature of projectGenerator which copy dylibs inside of app bundle.
and when running in other computer there is an issue opening the libs.
I'm testing with the basic example of ofxHapPlayer - https://github.com/bangnoise/ofxHapPlayer

below is the full error but I think the important part is this

Library not loaded: '@rpath/ffmpeg/lib/osx/libavutil.56.dylib'
Referenced from: '/Users/USER/*/HapTest.app/Contents/MacOS/HapTest'

The app itself is bundling the dylibs in the same folder as the executable, like this:
Screen Shot 2023-04-27 at 18 54 49

Should we reconstruct the path based on the addon? I can modify the PG if this is the case.
cc @artificiel for more insight about dylibs

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

Process:               HapTest [34167]
Path:                  /Users/USER/*/HapTest.app/Contents/MacOS/HapTest
Identifier:            cc.openFrameworks.HapTest
Version:               1.0 (1.0)
Code Type:             ARM-64 (Native)
Parent Process:        launchd [1]
User ID:               502

Date/Time:             2023-04-27 18:50:32.3090 -0300
OS Version:            macOS 12.6.4 (21G526)
Report Version:        12
Anonymous UUID:        27FE961F-5185-0BB0-8559-2EDDDA64B4B2

Sleep/Wake UUID:       D812AF90-1263-4B0D-A399-8DF219E27F6E

Time Awake Since Boot: 160000 seconds
Time Since Wake:       114 seconds

System Integrity Protection: enabled

Crashed Thread:        0

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace DYLD, Code 1 Library missing
Library not loaded: '@rpath/ffmpeg/lib/osx/libavutil.56.dylib'
Referenced from: '/Users/USER/*/HapTest.app/Contents/MacOS/HapTest'
Reason: tried: '' (no such file), '' (no such file), '' (no such file), '' (no such file)
(terminated at launch; ignore backtrace)

Thread 0 Crashed:
0   dyld                          	       0x100f8fe98 __abort_with_payload + 8
1   dyld                          	       0x100f97024 abort_with_payload_wrapper_internal + 104
2   dyld                          	       0x100f97058 abort_with_payload + 16
3   dyld                          	       0x100f4ea28 dyld4::halt(char const*) + 580
4   dyld                          	       0x100f49fb8 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3644
5   dyld                          	       0x100f4906c start + 488


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000006   x1: 0x0000000000000001   x2: 0x000000016f856a08   x3: 0x0000000000000076
    x4: 0x000000016f856608   x5: 0x0000000000000000   x6: 0x0000000000000000   x7: 0x0000000000000000
    x8: 0x0000000000000020   x9: 0x0000000000000009  x10: 0x000000016f85665b  x11: 0x000000000000008b
   x12: 0x0000000000000000  x13: 0x0000000000000033  x14: 0x0000000250872ef1  x15: 0x0000000000000000
   x16: 0x0000000000000209  x17: 0x0000000100f4714c  x18: 0x0000000000000000  x19: 0x0000000000000000
   x20: 0x000000016f856608  x21: 0x0000000000000076  x22: 0x000000016f856a08  x23: 0x0000000000000001
   x24: 0x0000000000000006  x25: 0x000000016f856608  x26: 0x0000000000000400  x27: 0x00000000000002c4
   x28: 0x00000000000001f9   fp: 0x000000016f8565d0   lr: 0x0000000100f97024
    sp: 0x000000016f856590   pc: 0x0000000100f8fe98 cpsr: 0x00001000
   far: 0x0000000100ecc000  esr: 0x56000080  Address size fault

Binary Images:
       0x100f44000 -        0x100fa3fff dyld (*) <0d7e1f3b-e8b2-3ede-ad0e-4d74e4fc60cd> /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=9504K resident=0K(0%) swapped_out_or_unallocated=9504K(100%)
Writable regions: Total=9520K written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=9520K(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
STACK GUARD                       56.0M        1 
Stack                             8176K        1 
VM_ALLOCATE                         16K        1 
__DATA                             736K        5 
__DATA_CONST                       240K        3 
__LINKEDIT                        2432K        3 
__TEXT                            7072K        3 
dyld private memory               1024K        1 
===========                     =======  ======= 
TOTAL                             75.2M       18 



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

{"app_name":"HapTest","timestamp":"2023-04-27 18:50:32.00 -0300","app_version":"1.0","slice_uuid":"3090440b-d341-330c-97a5-9cda9106149a","build_version":"1.0","platform":1,"bundleID":"cc.openFrameworks.HapTest","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS 12.6.4 (21G526)","incident_id":"16AF6384-B5D5-4BE4-8569-34ADA8D87BCC","name":"HapTest"}
{
  "uptime" : 160000,
  "procLaunch" : "2023-04-27 18:50:31.3825 -0300",
  "procRole" : "Background",
  "version" : 2,
  "userID" : 502,
  "deployVersion" : 210,
  "modelCode" : "MacBookAir10,1",
  "procStartAbsTime" : 3908140645215,
  "coalitionID" : 11179,
  "osVersion" : {
    "train" : "macOS 12.6.4",
    "build" : "21G526",
    "releaseType" : "User"
  },
  "captureTime" : "2023-04-27 18:50:32.3090 -0300",
  "incident" : "16AF6384-B5D5-4BE4-8569-34ADA8D87BCC",
  "bug_type" : "309",
  "pid" : 34167,
  "procExitAbsTime" : 3908162140838,
  "translated" : false,
  "cpuType" : "ARM-64",
  "procName" : "HapTest",
  "procPath" : "\/Users\/USER\/*\/HapTest.app\/Contents\/MacOS\/HapTest",
  "bundleInfo" : {"CFBundleShortVersionString":"1.0","CFBundleVersion":"1.0","CFBundleIdentifier":"cc.openFrameworks.HapTest"},
  "storeInfo" : {"deviceIdentifierForVendor":"09D26D67-66BE-5525-9665-E2DDB4AB3F5B","thirdParty":true},
  "parentProc" : "launchd",
  "parentPid" : 1,
  "coalitionName" : "cc.openFrameworks.HapTest",
  "crashReporterKey" : "27FE961F-5185-0BB0-8559-2EDDDA64B4B2",
  "wakeTime" : 114,
  "sleepWakeUUID" : "D812AF90-1263-4B0D-A399-8DF219E27F6E",
  "sip" : "enabled",
  "isCorpse" : 1,
  "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"},
  "termination" : {"code":1,"flags":518,"namespace":"DYLD","indicator":"Library missing","details":["(terminated at launch; ignore backtrace)"],"reasons":["Library not loaded: '@rpath\/ffmpeg\/lib\/osx\/libavutil.56.dylib'","Referenced from: '\/Users\/USER\/*\/HapTest.app\/Contents\/MacOS\/HapTest'","Reason: tried: '' (no such file), '' (no such file), '' (no such file), '' (no such file)"]},
  "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":1859459,"threadState":{"x":[{"value":6},{"value":1},{"value":6165981704},{"value":118},{"value":6165980680},{"value":0},{"value":0},{"value":0},{"value":32},{"value":9},{"value":6165980763},{"value":139},{"value":0},{"value":51},{"value":9940971249},{"value":0},{"value":521},{"value":4310987084,"symbolLocation":392,"symbol":"__simple_bprintf"},{"value":0},{"value":0},{"value":6165980680},{"value":118},{"value":6165981704},{"value":1},{"value":6},{"value":6165980680},{"value":1024},{"value":708},{"value":505}],"flavor":"ARM_THREAD_STATE64","lr":{"value":4311314468},"cpsr":{"value":4096},"fp":{"value":6165980624},"sp":{"value":6165980560},"esr":{"value":1442840704,"description":" Address size fault"},"pc":{"value":4311285400,"matchesCrashFrame":1},"far":{"value":4310482944}},"frames":[{"imageOffset":310936,"symbol":"__abort_with_payload","symbolLocation":8,"imageIndex":0},{"imageOffset":340004,"symbol":"abort_with_payload_wrapper_internal","symbolLocation":104,"imageIndex":0},{"imageOffset":340056,"symbol":"abort_with_payload","symbolLocation":16,"imageIndex":0},{"imageOffset":43560,"symbol":"dyld4::halt(char const*)","symbolLocation":580,"imageIndex":0},{"imageOffset":24504,"symbol":"dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)","symbolLocation":3644,"imageIndex":0},{"imageOffset":20588,"symbol":"start","symbolLocation":488,"imageIndex":0}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 4310974464,
    "size" : 393216,
    "uuid" : "0d7e1f3b-e8b2-3ede-ad0e-4d74e4fc60cd",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  }
],
  "sharedCache" : {
  "base" : 6854721536,
  "size" : 3144826880,
  "uuid" : "e3907884-1955-382a-a902-8014a1b7c887"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=9504K resident=0K(0%) swapped_out_or_unallocated=9504K(100%)\nWritable regions: Total=9520K written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=9520K(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nSTACK GUARD                       56.0M        1 \nStack                             8176K        1 \nVM_ALLOCATE                         16K        1 \n__DATA                             736K        5 \n__DATA_CONST                       240K        3 \n__LINKEDIT                        2432K        3 \n__TEXT                            7072K        3 \ndyld private memory               1024K        1 \n===========                     =======  ======= \nTOTAL                             75.2M       18 \n",
  "legacyInfo" : {
  "threadTriggered" : {

  }
},
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "6297d96be2c9387df974efa4",
      "factorPackIds" : {

      },
      "deploymentId" : 240000008
    },
    {
      "rolloutId" : "5fc94383418129005b4e9ae0",
      "factorPackIds" : {

      },
      "deploymentId" : 240000614
    }
  ],
  "experiments" : [
    {
      "treatmentId" : "c28e4ee6-1b08-4f90-8e05-2809e78310a3",
      "experimentId" : "6317d2003d24842ff850182a",
      "deploymentId" : 400000013
    }
  ]
}
}

Model: MacBookAir10,1, BootROM 8422.100.650, proc 8:4:4 processors, 8 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 2, AirPort, en0
Network Service: USB 10/100/1000 LAN 2, Ethernet, en6
USB Device: USB31Bus
USB Device: USB31Bus
Thunderbolt Bus: MacBook Air, Apple Inc.
Thunderbolt Bus: MacBook Air, Apple Inc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions