Using Xcode Version 11.4 (11E146) on macOS Catalina 10.15.4 (19E266).I am building a macOS app that requires libpq from postgresql.The problem that I am facing is that when running my xcode built app, it uses an unknown libpq that reports version 9.3.7 (maybe provided by the sytem) no matter how I try to get Xcode to use the MacPorts libpq located at `/opt/local/lib/postgresql11/libpq.5.11.dylib` which should report as version 11.07.I determine the client library version by examing the results from the libpq function call `PQlibVersion()`Here is what I have tried. Between each attempt the project was cleaned.1. Add `/opt/local/lib/postgresql11/libpq.5.11.dylib` to target -> General -> Frameworks, Libraries, and Embedded Content. Select "Do Not Embed". Compiles, runs, does NOT work, still uses system libpq.% otool -L MyApp.app/Contents/MacOS/MyAppMyApp.app/Contents/MacOS/RushRadioSQLDataProcessing: @rpath/CSV.framework/Versions/A/CSV (compatibility version 1.0.0, current version 1.0.0) @rpath/ObjcExceptionBridging.framework/Versions/A/ObjcExceptionBridging (compatibility version 1.0.0, current version 1.0.0) @rpath/XCGLogger.framework/Versions/A/XCGLogger (compatibility version 1.0.0, current version 1.0.0) /System/Library/Frameworks/CloudKit.framework/Versions/A/CloudKit (compatibility version 1.0.0, current version 867.0.0) /opt/local/lib/postgresql11/libpq.5.dylib (compatibility version 5.0.0, current version 5.11.0) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1675.129.0) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1894.40.150) /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData (compatibility version 1.0.0, current version 977.3.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1675.129.0) /System/Library/Frameworks/CoreLocation.framework/Versions/A/CoreLocation (compatibility version 1.0.0, current version 2394.0.22) @rpath/libswiftCloudKit.dylib (compatibility version 1.0.0, current version 0.0.0) @rpath/libswiftCore.dylib (compatibility version 1.0.0, current version 1103.8.25) @rpath/libswiftCoreData.dylib (compatibility version 1.0.0, current version 0.0.0) @rpath/libswiftDispatch.dylib (compatibility version 1.0.0, current version 0.0.0) @rpath/libswiftFoundation.dylib (compatibility version 1.0.0, current version 0.0.0) @rpath/libswiftObjectiveC.dylib (compatibility version 1.0.0, current version 0.0.0)2. Add `/opt/local/lib/postgresql11/libpq.5.11.dylib` to target -> General -> Frameworks, Libraries, and Embedded Content. Select "Embed & Sign". Compiles, runs, does NOT work, still uses system libpq. Does NOT work, still uses system libpq.% otool -L myApp.app/Contents/MacOS/MyApp: @rpath/CSV.framework/Versions/A/CSV (compatibility version 1.0.0, current version 1.0.0) @rpath/ObjcExceptionBridging.framework/Versions/A/ObjcExceptionBridging (compatibility version 1.0.0, current version 1.0.0) @rpath/XCGLogger.framework/Versions/A/XCGLogger (compatibility version 1.0.0, current version 1.0.0) /System/Library/Frameworks/CloudKit.framework/Versions/A/CloudKit (compatibility version 1.0.0, current version 867.0.0) /opt/local/lib/postgresql11/libpq.5.dylib (compatibility version 5.0.0, current version 5.11.0) /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1675.129.0) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1894.40.150) /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData (compatibility version 1.0.0, current version 977.3.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1675.129.0) /System/Library/Frameworks/CoreLocation.framework/Versions/A/CoreLocation (compatibility version 1.0.0, current version 2394.0.22) @rpath/libswiftCloudKit.dylib (compatibility version 1.0.0, current version 0.0.0) @rpath/libswiftCore.dylib (compatibility version 1.0.0, current version 1103.8.25) @rpath/libswiftCoreData.dylib (compatibility version 1.0.0, current version 0.0.0) @rpath/libswiftDispatch.dylib (compatibility version 1.0.0, current version 0.0.0) @rpath/libswiftFoundation.dylib (compatibility version 1.0.0, current version 0.0.0) @rpath/libswiftObjectiveC.dylib (compatibility version 1.0.0, current version 0.0.0)3. Add `/opt/local/lib/postgresql11/libpq.5.11.dylib` to target -> General -> Frameworks, Libraries, and Embedded Content. Select "Embed without Signing". Does not compile. Error App code object is not signed at all In subcomponent: MyApp.app/Contents/Frameworks/libpq.5.11.dylibWhen I sampled the running app I found that it shows the following lib being used.libpq.5.dylib (207.14) <72EB7D5B-B6AB-3BBE-877D-C01637C38548> /usr/lib/libpq.5.dylibWhy is it using this lib and not the version specified in the Xcode build instructions?
Post
Replies
Boosts
Views
Activity
Since updated to iOS 13 we have had this crash in several Apps.(lldb) bt* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT) frame #0: 0x00007fff2b13578d QuartzCore`CA::Layer::retain_parent(CA::Transaction*) const + 35 frame #1: 0x00007fff2b1455b9 QuartzCore`CALayerGetSuperlayer + 47 frame #2: 0x00007fff485813a8 UIKitCore`-[UIView(UIKitManual) superview] + 37 frame #3: 0x00007fff484a3848 UIKitCore`-[UILayoutGuide _snipReferencingConstraints] + 567 frame #4: 0x00007fff484a2a45 UIKitCore`-[UILayoutGuide _owningViewIsDeallocating] + 32 frame #5: 0x00007fff48546db2 UIKitCore`-[UIView _layoutConstraintCleanup] + 248 frame #6: 0x00007fff48546fe2 UIKitCore`-[UIView dealloc] + 155 frame #7: 0x00007fff482342f7 UIKitCore`-[UITableViewCellContentView dealloc] + 68 frame #8: 0x00007fff5140d4c0 libobjc.A.dylib`_object_remove_assocations + 239 frame #9: 0x00007fff5140a4c2 libobjc.A.dylib`objc_destructInstance + 79 frame #10: 0x00007fff23c925be CoreFoundation`-[NSObject(NSObject) __dealloc_zombie] + 158 frame #11: 0x00007fff2b12a39b QuartzCore`-[CALayer dealloc] + 163 frame #12: 0x00007fff2b0bf6a7 QuartzCore`CA::release_objects(X::List<void const*>*) + 26 frame #13: 0x00007fff2b0bf777 QuartzCore`CA::release_root_if_unused(CA::Layer*, CA::Layer*, void*) + 35 frame #14: 0x00007fff2b038492 QuartzCore`x_hash_table_remove_if + 97 frame #15: 0x00007fff2b0bfa66 QuartzCore`CA::Transaction::commit() + 408 frame #16: 0x00007fff2b0c04ba QuartzCore`CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 76 frame #17: 0x00007fff23bd3867 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23 frame #18: 0x00007fff23bce2fe CoreFoundation`__CFRunLoopDoObservers + 430 frame #19: 0x00007fff23bce97a CoreFoundation`__CFRunLoopRun + 1514 frame #20: 0x00007fff23bce066 CoreFoundation`CFRunLoopRunSpecific + 438 frame #21: 0x00007fff384c0bb0 GraphicsServices`GSEventRunModal + 65 frame #22: 0x00007fff48092d4d UIKitCore`UIApplicationMain + 1621 * frame #23: 0x000000010090948b BBQSheriff`main at BBQAppDelegate.swift:22:13 frame #24: 0x00007fff5227ec25 libdyld.dylib`start + 1 frame #25: 0x00007fff5227ec25 libdyld.dylib`start + 1Running with Address Sanitizer and Zombie Objects as shown above does not show any Additional information in sumulator logs.Most important question is: How do I determine which object is causing the problem and/or what that problem might be?Xcode Version 11.3.1 (11C504)