Code 11 segmentation fault Monterey

But the real question here is:

  • Such App runs in a Monterey Intel machine without crashing too doing the same operation?
    Yes: The crash is isolated to M1 machines.
    No: The app is not Monterey compatible.

  • Compiling it in a Xojo 2021R3+ solves the problem?
    Yes: It needed a newer SDK and M1 compatible code. Solved.
    No: You have some sort of bug or are using some incompatible plugin.

Jeff, do you call DoEvents() ?

Maybe something was processed out of order due to user interference in the dequeuing of the events.
If so, find a way of removing it from your code and try again. For any Xojo and any macOS.

My main app also crashed under Monterey and ran fine everywhere else. Turns out events are fired in a different order under Monterey. In my case, the unexpected event order led to uninitialized variables and thus OutOfBounds exceptions. I was only able to track this down by remote-debugging a Monterey box. Once I knew what was happening I was able to fix it with a few sanity checks.

1 Like

Hi all.
So far: I have had a couple of pointers to XML (thanks Beatrix and Mike)

I now know that on an intel machine with Montgomery, the app fails to start and doesnā€™t generate a crash log.
On M1 it does generate a log.

Same when compiled as a Universal app using 2021R3

On Big Sur and below, all works fine.

Tomorrow Iā€™ll try some debugging under Monterey.
As things usually go, I installed Monterey on an external drive for testing, but now my laptop wont boot without the external drive plugged in, so I have that to deal with first.

Hopefully I will find a DoEvents somewhere that can be removed.
I worry that the XML libraries of Monterey may be the issue.

More news as I uncover any.

Here is the last line

Follow this thread to add code in the open event of your application that might help to reveal a crash dialog and report on your Intel Mac.

Made me laugh, although Monterey is really no better of a name. Good luck finding/fixing!

FYI, Iā€™m using Xojo 2019R1.1 for a big app I build, and for me itā€™s a good ā€œmodern, but not too modernā€ version of Xojo. Maybe you should try that instead of 2018?

1 Like

Good old autocorrect (automobile) on a phone :slight_smile:

Have you tried the auto-corrupt on Android? I think itā€™s because itā€™s backed by Googleā€™s massive data hoard, but seems less error prone than my old iPhone.

Update:
No solution yet, but having started debugging on a Monterey machine, the event order is very messed up.
Iā€™ve sorted some of it by checking for (previously impossible) nils all over the place and calling relevant initialisers.

Currently Iā€™m faced with this:

When my app starts, it checks whether support files have been unpacked.
If no, it throws up a dialog offering to install some or all.
Thats opened with thedialog.showmodal

But for some reason that call immediately also triggers the NewDocument event , and nothing is properly initialised at that point.

Itā€™s like showmodal when called by an app (rather than a window), doesnā€™t pause the program flow until the window is closed, under Monterey.

Not sure how to get round this yet.

(and ps: yes, as it happens, 2021R3 compiles the code just fine unchanged.
Good to know)

What about putting ā€œReturnā€ in the NewDocument event if the unpacking has not been done and calling NewDocument once again after unpacking?

1 Like

I just took the opportunity of Black Friday to get a brand new license. And I got a Mac Mini M1 under Monterey, so I can test on the latest platform.

But this is me. I cannot run the risk of having my MAS apps crash with the users.

1 Like

Jeff, if needed I can test your app on my M1 Pro system. Just drop a private message.

IMO if you sell software for macOS, you just cannot go without an Apple Silicon system to do tests. You would be surprised how many are already using a new Apple device with AS.

Sadly this is probably true.
I really donā€™t need another machine to sit and get dusty. sigh.
I know once I get past this mess, Iā€™ll test run on the M1 machine, everything will be fine, and it will go in a drawer.

Im getting really tired of chasing down ā€˜stuff that Apple changed this yearā€™

At the moment, Iā€™m fighting with events in Monterey on just the intel machine, and odd errors in plugins too. (Canā€™t get my app icon from the bundle anymore, for example)

So far, I havenā€™t gotten anywhere near an XML issue.
Just lots of NOEs due to stuff being used before it should.
Iā€™ll be back in a day or two.

1 Like

I now have a MBP 16 M1 Pro and an old MacBook Air (non-retina). Thatā€™s probably enough to do testing. I even keep my MBP M1 Rosetta2 free.
If it works for Apple Silicon, it will work fine for Intel. And not necessarily the other way around.
So it could be a good idea to buy a Apple Silicon device and get rid of your Intel system. :slight_smile:

Donā€™t take that for granted.

In my experience this is about 100% true.

@ChristopheDV : Count yourself lucky. I had a really bad bug in Rosetta. Monterey had a couple of odd display issues like toolbar items cut off on M1.

@Jeff Tullin: the M1 are so much better. For the lack of any noise alone I donā€™t ever want to go back to Intel. But yes, testing with different hardware and different versions of macOS has become more complicated in the last years. I canā€™t test everything on every version of macOS.

Which is why I choose to wait until the real Pro machines are available, this way I can replace this 16" Intel with a 16" M1 Pro, it can run Intel code and it can run ARM code, which also means when we can start traveling again, I only need one machine.

I dropped a pretty penny on a new MacBook Pro in 2020, as my last one was suffering from multiple failures. Even if the M1 Air and Pro were out when I bought this machine, Iā€™d still need a machine that works best for me.

But now the M1 Pros are here, Apple are massively delaying the launch here in Taiwan, I guess thatā€™s to punish me for saying negative things about Apple :wink:

I also still donā€™t have a great plan for supporting two architectures, App Wrapper is almost 50 mb, so using UB, thatā€™s almost 100mb and half of that is wasted no matter which machine you have.

I cant find any info about this. What do you mean?

The current macbook pros are twice the price of (say) an M1 Air anyway, so , I may as well resign myself to using an M1 mac and making use of my (currently almost) redundant Dell in the future.
Its just a faff switching back and forth.

1 Like