Posts

Post not yet marked as solved
1 Replies
397 Views
My app has a debugging mode in which it invokes 'leaks' on itself. I am now seeing this message on stderr: Target process is an ancestor and permitting live process for ancestors so not generating a corpse to save resources by default. This sort of makes sense, but I would like a more detailed explanation. Is there some option I should be sending to 'leaks' to operate in a better mode? Should I be invoking it differently?
Posted
by hecht.
Last updated
.
Post not yet marked as solved
8 Replies
4.9k Views
So apparently Monterey has switched to creating .ips files instead of .crash files for application crashes. Console.app can convert these .ips files to "old-style" crash format. But is there a command-line tool to do the same thing?
Posted
by hecht.
Last updated
.
Post not yet marked as solved
0 Replies
572 Views
My app uses CGLayerRef to do some of its drawing. With Ventura, this doesn't work reliably. I'm wondering if there have been changes to CGLayerRef that might account for this new undesired behavior? I did not see anything in the release notes regarding it. To be more specific, sometimes some of the drawing I do does not seem to make it to the layer. So when the layer is later drawn it appears that some of my window content is missing. I would replicate this in a sample app if I could, but it is not possible.
Posted
by hecht.
Last updated
.
Post not yet marked as solved
5 Replies
4.9k Views
Hello, I've searched for other posts on this topic but I haven't found anything that provides an answer.Here's my test program snippet, using the Xcode Mac Application Obj-C starter project:- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // Insert code here to initialize your application char const * dyld_library_path_original = getenv("DYLD_LIBRARY_PATH"); char dyld_library_path_new[1024]; strcpy(dyld_library_path_new, "/Applications/MATLAB_R2020a.app/bin/maci64:"); strcat(dyld_library_path_new, dyld_library_path_original); int rc = setenv("DYLD_LIBRARY_PATH", dyld_library_path_new, 1); NSLog(@"DYLD_LIBRARY_PATH=%s, rc=%d", getenv("DYLD_LIBRARY_PATH"), rc); void * handle1 = dlopen("libeng.dylib", RTLD_NOW); NSLog(@"Test 1: dlopen(libeng.dylib) = %p, err=%s", handle1, dlerror()); void * handle2 = dlopen("/Applications/MATLAB_R2020a.app/bin/maci64/libeng.dylib", RTLD_NOW); NSLog(@"Test 2: dlopen(libeng.dylib) = %p, err=%s", handle2, dlerror()); }As you can see, I'm trying to dlopen a dylib in the installed MATLAB application. But I don't think the specific dylib matters. What matters is that I'm dlopening it using just the leaf name of the path, after setting DYLD_LIBRARY_PATH at runtime to include MATLAB's dir (Test 1). This fails.But when I dlopen it with the full path (Test 2) it works. Here's the output:DYLD_LIBRARY_PATH=/Applications/MATLAB_R2020a.app/bin/maci64:/Users/hecht/Library/Developer/Xcode/DerivedData/TestML-droybqyctybedebamivvyiixjhnn/Build/Products/Debug:/usr/lib/system/introspection, rc=0 Test 1: dlopen(libeng.dylib) = 0x0, err=dlopen(libeng.dylib, 2): image not found Test 2: dlopen(libeng.dylib) = 0x6000039041a0, err=(null)I have Hardened Runtime enabled, with these entitlements turned on:Allow DYLD Environment VariablesDisable Library ValidationThe second one is doing its job, because without it, Test 2 fails also.But the first one doesn't help in allowing me to modify DYLD_LIBRARY_PATH at runtime. If I set the environment variable before launching (Xcode > Product > Scheme > Edit Scheme > Arguments > Environment Variables) then Test 1 works. Is there a way to get dyld to honor changes to this environment variable made at runtime?
Posted
by hecht.
Last updated
.
Post not yet marked as solved
1 Replies
584 Views
From Cocoa, how can I do the following two things: Determine the architectures available within a binary? The equivalent of 'file foo.dylib', but by calling an API rather than launching a task to run that command. Launch a process using a specific architecture in a universal binary, say an executable with both arm64 and x86_64, and I want to launch the x86_64 arch on an M1 Mac. The equivalent of 'arch -arch x86_64 foo', but perhaps by specifying an option to NSTask rather than launching an 'arch' task.
Posted
by hecht.
Last updated
.
Post not yet marked as solved
2 Replies
631 Views
If I have an NSAttributedString that I draw with [str drawAtPoint:p], how can I construct a frame rectangle around p for an NSTextView that will let me edit that text without it appearing to shift in any way?
Posted
by hecht.
Last updated
.
Post not yet marked as solved
5 Replies
1.5k Views
I am trying to load the R library (R 4.0.0 available from https://cran.r-project.org) from my signed and notarized app.But this is what I get on the console:dyld: Library not loaded: /Library/Frameworks/R.framework/Versions/Current/Resources/lib/libR.dylib Referenced from: /Users/hecht/Library/Developer/Xcode/DerivedData/JMP-dgmxmeayjbgthlckfcezeplzucmk/Build/Products/Debug/JMP.app/Contents/Frameworks/tkext//tkrproxy Reason: no suitable image found. Did find: /Library/Frameworks/R.framework/Versions/Current/Resources/lib/libR.dylib: code signature in (/Library/Frameworks/R.framework/Versions/Current/Resources/lib/libR.dylib) not valid for use in process using Library Validation: mapping process has no Team ID and is not a platform binary /Library/Frameworks/R.framework/Versions/Current/Resources/lib/libR.dylib: stat() failed with errno=1 /Library/Frameworks/R.framework/Versions/Current/Resources/lib/libR.dylib: stat() failed with errno=1I have checked that libR.dylib has LC_VERSION_MIN_MACOSX set:% otool -l /Library/Frameworks/R.framework/Versions/Current/Resources/lib/libR.dylib | grep -B 1 -A 3 LC_VERSION_MIN Load command 8 cmd LC_VERSION_MIN_MACOSX cmdsize 16 version 10.13 sdk 10.15I have checked that the library's load path is absolute and doesn't include @rpath:% otool -D /Library/Frameworks/R.framework/Versions/Current/Resources/lib/libR.dylib /Library/Frameworks/R.framework/Versions/Current/Resources/lib/libR.dylib: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylibMy app has com.apple.security.cs.disable-library-validation set to YES.What am I missing?
Posted
by hecht.
Last updated
.
Post marked as solved
1 Replies
4.5k Views
New with Xcode 11.4, I get this warning: "OpenGL is deprecated. Consider migrating to Metal instead." Clicking the warning takes me to our app's target settings, in the "Frameworks, Libraries, and Embedded Content" section, where we have added a reference to OpenGL.framework.This is an issue that we are quite aware of already. We are currently working on migrating to Metal, but we have not yet fully switched over.Meanwhile, I'd like to roll out this new Xcode version to our entire development team. But the presence of this warning violates our Zero Warnings policy. Is there a way to suppress it? Given the location and specificity of the warning, it seems like it's a special case and not something generic. I read through the Xcode 11.4 Release Notes but saw no mention of the new warning.[Apologies if this is the wrong subgroup. I was looking for a "build system" subgroup but couldn't find one.]--Michael Hecht
Posted
by hecht.
Last updated
.
Post not yet marked as solved
2 Replies
639 Views
[I'm starting a separate thread, so as to not convolute this one.]My app notarizes fine, but with warnings about embedded binaries using an older SDK. But if I place my app within a .PKG and then try to notarize that, all those same warnings get turned into errors and the notarization fails. I have entered a bug for this -- FB7457705. For the record, the .PKG eventually needs to go into a .DMG, which will be the item I ultimately notarize. But I'm trying this as an intermediate step.If it matters, the embedded binaries in question are a Java 8 JRE from Azul Systems, which they built with the 10.8 SDKs. We do have plans to move to a more recent Java JRE. Their Java 11 JRE is built with the 10.9 SDK and their Java 12 JRE is built with the 10.13 SDK. But the architectural changes required to move to a later Java are too great for us to roll out just yet. And it is not feasible for us to wait to notarize our app until we can switch Javas.
Posted
by hecht.
Last updated
.