Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

scott455

macrumors member
Original poster
Jun 5, 2022
40
0
Hi,
cocoa/objective-c project.:
If got older Xcode and Macos and got also newer xode and macos. Does it matter if a project is built on older version and running it in higher OS version or even vice versa?. Also, the project when built on older Xcode like xcode 8 or 9 and runs. same project if built and ran on higher Xcode like 13 and OS 12.x it crashes at the launch. EXC_BAD_ACCESS with some thing related to layout violation with some item not set. Do not have the exact error message.
 
Xcode and the various frameworks are constantly being tweaked and changed, and newer versions of the OS tend to use those changes. Older stuff may still work on newer systems (if what it uses isn’t deprecated), but newer stuff on older systems tends to break since some of the stuff may not exist on the older system. You may be able to use older frameworks (up to a point) in newer versions of Xcode by making the appropriate changes in the build settings.
 
to help more detailed information is required - including at least the crash report.
 
this is part of the crash report. it got corrupted. Have to re-create one. The project when compiled and ran on older OS and Xcode does not crash but on latest OS and Xcode , crashes. Have to re-create a new crash report.


Exception NSException * "NSLayoutConstraint for (null): Constraint must contain a first layout item"

"exception" : "EXC_CRASH","signal":"SIGABRT"
"ktriageinfo" : "VM - pmap_enter failed with resource shortage\\nVM - pmap_enter failed with resource shortage\\nVM - pmap_enter failed with resource shortage\\n",
"asi" : \{"libsystem_c.dylib":["abort() called"]
libobjc.A.dylib objc_exception_throw
CoreAutoLayout ResolveConstraintArguments
CoreAutoLayout NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant
 
this is part of the crash report. it got corrupted. Have to re-create one. The project when compiled and ran on older OS and Xcode does not crash but on latest OS and Xcode , crashes. Have to re-create a new crash report.
The reports should be accessible via Console.

EDIT: the old project compiles on the new MacOS/XCode (which)? the old binary crashes on the new system (which)? the “new” binary crashes? Which version of MacOS? Which hardware?
 
The reports should be accessible via Console.

EDIT: the old project compiles on the new MacOS/XCode (which)? the old binary crashes on the new system (which)? the “new” binary crashes? Which version of MacOS? Which hardware?

if compiling the project on xcode 9.x, MacOS 10.13, intel chip mac the binary runs on the macos 12.3 with M1 Arm chip.
If compiling the same project with latest xcode on the macos 12.3 with Arm M1 chip mac and running it there, it crashes at the launch. I do not see any weak declaration of any variable.
 
crash log would be helpful still.

What is the output for

file /path/to/your/compiled/program/YourProgram.app/Contents/MacOS/YourProgram

in the terminal? Or if it is a terminal program file YourProgram ?
 
the project is GUI cocoa app.

are you referring to a log file or an output file in this path??? No quite got it.
file /path/to/your/compiled/program/YourProgram.app/Contents/MacOS/YourProgram ??
 
for both - the binary which doesn’t crash as well as the one which crashes - please use the file command via the terminal and post the output here.

Additionally you should attach the crash log (for the binary which crashes) - which you‘ll find easily via the MacOS Console.
 
i am including an output file that has necessary and most of the crash report plus the output of the file command as suggested.
 

Attachments

  • out.txt
    23.1 KB · Views: 125
Well, the binary which doesn’t crash is compiled for Intel only and will run using Rosetta 2 on your M1 Mac.

The binary that crashes is a universal binary.

Try the following:

Navigate to the universal binary in the Finder and right click on it.

From the context menu that pops up, click on ‘Get Info’.
click get info context menu


In the General category, simply enable the checkbox that says ‘Open using Rosetta’.
  • force apps to run with rosetta in m1 mac
If this is already checked, untick it, and try running your app. At this point I would suggest debugging it in XCode.
 
  • Like
Reactions: scott455
thanks Slartibart.
in finder right clicked on the binary , selected Get Info and checked the "open Using Rosetta". Then, upon double clicking it , it worked as expected. However, when lunching the app from the xcode , selecting the Run from xcode, for stepping through the code, it crashes. How to work around this problem from xcode inside?. I thought having M1 and Intel support, it would _NOT_ need Rosetta.
 
in the M1 mac pc changed the xcode to run using Rosetta and changed the project architecture from universal to x86_64 and that made it possible to run/launch the app from the xcode. I just can't see why when i use this M1 mac PC to build this project, its binary needs to use Rosetta even though it is set to the universal app. I expected upon building this project that I transferred from an intel mac PC, it would work since it supports universal architecture. It should even run/launch from inside the xcode as it indicates it supports universal setting.
 
Did you try to change the build target? Any third party frameworks used? If there are warnings, take a look. Debug it in XCode.
 
  • Like
Reactions: scott455
thanks again Slartibart.
I did use xcode to debug the crash. As beginner, it turned out to be easier than I thought. It turned out to be a piece of code that would extract hardware information and initialize some app controls during launching of app . Removed the code , then it worked as it should.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.