A Mav StackOverflowException?

Hi. I’m running the latest XOJO (2013r3) on a Mac, with newly just downloaded Mav 10.9. I received a report from a user that one of my apps had trouble with 10.9. I’m working on a Mac Cocoa app.

My app (which ran perfectly in 10.8) has a curious problem when run on 10.9…when I choose a particular menu item in my app (which invokes a modal dialog), the dialog just magically returns as if it was never called. No window appears and no error message. But, if I run the program from within Xojo, and choose the same menu item, I immediately get popped into the debugger with a StackOverflowException. But, I don’t know why?

I put a breakpoint within the modal dialog routine…and as the very first line…even before any dim statements in the routine…and when I run it, I get the same StackOverflowException. SO the problem doesn’t even appear to be WITHIN the routine, but rather just the mere calling of it.

I’m mystified. I know I didn’t give any specific code, but did anything I say ring a bell to anyone? Thanks…Ken

In the debugger, take a look at the stack. Perhaps it’s gotten large from some recursion you didn’t know about?

I think the issue has to do with calling a modal dialog within a modal dialog - the behavior has changed in Mavericks. Any chance you are doing that?

If you have Apple Developers access you might want to check this out: https://devforums.apple.com/message/897999#897999 and https://devforums.apple.com/message/909002#909002

Thanks Brad and Michael…two great answers. YES…it’s very possible I call a Modal Dialog from within a ModalDialog (in this problem and no doubt elsewhere too.) I checked your two links to Apple devforums, and most of the code there is ObjectiveC which is pretty foreign to me as an Xojo user. Can you tell me more about “modal within modal”. Is that NOT allowed anymore? I may well (even standardly!) have a window open, click a button to pop up a modal dialog (for instance, maybe to ask for a number, from 1 to 5)…the user enters a 6, my natural inclination would be to pop up quickie error modal dialog on top saying please enter a number from 1 to 5. This is now wrong? (it may not be pretty, but who knew it was wrong!)

[quote=42047:@Michael Diehr]I think the issue has to do with calling a modal dialog within a modal dialog - the behavior has changed in Mavericks. Any chance you are doing that?

If you have Apple Developers access you might want to check this out: https://devforums.apple.com/message/897999#897999 and https://devforums.apple.com/message/909002#909002[/quote]

I don’t believe either of those are related. The latter link is referring specifically to sheets.

I think we’d need to see the stack trace from the debugger in order to figure out what’s going on.

Thanks Joe. Whew, I think. Yes, I’m NOT using sheets. Hate to show my ignorance, but I’m not sure how to see a stack trace. I’m sure it’s staring me in the face when I get popped into the debugger, but I’ve never had need to do that. I’ll learn…

Column to the left of the variables :-).

Heh-heh! RIGHTO! Thanks Brad. Yeah, I saw that…just didn’t know it was officially called the Stack Trace. And, I’m not sure that it helps anyway. It’s a really simple stack trace…two lines…the menu item action method calling the routine in question, and the routine itself. Hardly that informative, at least to my eyes. It’s not like there’s a million other items clogging up the stack (that I know of)…

Looks like this…

MyModule.myroutine
MyAppName._MyMenuItem_Action

…that’s it. Thanks Brad. I’m still searching for what’s different about this modal dialog invocation from all my others which do NOT seem to have a problem. (and NONE of them had a problem with 10.8…only the move to 10.9 brought about this mysterious behavior.)

Well, with anything obvious out of the way… Interesting.

Success, I think. At least, I have a new theory.

For those just tuning in, I had a sudden (with the new Maverick and X2013r3) oddity where a function I had in an app that had worked previously, fails now with a StackOverflowError. I think I found my error. In the function that failed, I was dimensioning an item (and thus adding to the required stack) of a little over 500K (half a megabyte). I’m guessing this a bit much? Can anyone confirm? (When I temporarily removed the need for this item, the program no longer failed. So, I’m confident I’m at the root of the problem.)

What’s changed between when my program (the function) was working, and when it was not…was EITHER…the move from X2013r2 to X2013r3, OR the move from Mac OS 10.8 to Mac OS 10.9. I’m making a bold guess that someone (Apple or Xojo people) changed the max stack allowed. Anyone know this for a fact? Thoughts? (and THANKS!)