I have a medium size application that runs on my PC-Windows without any problem.
It had worked for many years on Mac as well, but suddenly I`ve found a very weird thing.
When I open a large example the application on my Mac crashes silently. Both compiled and debugging.
After some time (when something crashes silently it is difficult to debug) I detected the line that produces de crash:
It’s the line with the Breakpoint.
But curiously this line has been used twice before with no problem.
When the application crashes on the line “If LecturaArxiuInterropuda then” the only thing I have is the report to be sent to Apple.
This report is very long but it begins with:
Unfortunately this report says nothing to me, but my hope is that somebody can find something in it that helps me to know what is happening.
Can anyone say something to me about this?
Thanks in advance.
Thank you Beatrix,
With your reply I understood some things:
-The problem is about Threads. Obviously, I knew it, their behaviour is different in Mac and in Windows, so now I can understand why nothing happens in Windows.
-The strange thing is this only happens with a large example, but probably it is due to the fact that as it takes longer reading the file, things happen in the code and threads.
Anyway, the number of the thread that crashes changes, so I am sending you the one about thread 4 which ia the one that crashed this time.
Don’t spend too much time on it. I know that there is a problem about threads and that’s enough for me by now.
Thanks again.
Thanks Thomas,
Anything is possible.
Although the strange thing is it happens only with a large example. Normal examples don’t show this problem.
But anyway, if the problem is OpenGL, I don’t mind. I can’t change the whole program.
Besides, more than 90% of the users are Windows users and (at least at the moment, who knows in the future) there is no problem in Windows.
I don’t see how reading a simple boolean can create a crash. Perhaps the crash is immediately before, immediately after, within the logical if/end if.
Unless your boolean is a computed property.
The bad access error has to do with input output. Do you have any at the same time ? The crashed thread 6 seems to indicate something that is not in the main thread.
Yes. You’re right, The crash is probably after, since the if-block is not executed, but if i put the breakpoint after the if-block I never get to this point.
As I said before in another message, I’m sure the problem is about threads. The code is quite old and I don’t remember very well how threads were dealt, but as it worked in Windows I didn’t pay much attention in Mac. Besides, in Mac works with almost all examples. This one (causing the problem) is very big and probably something happens within the thread, while with the other examples there is no time to produce the problem.
Anyway, thank you very much for your time.
And if you try with the breakpoint where it is now (line 53) and use “Step into”?
As Michel said, getting a boolean value can’t crash your app per se. So either it’s a computed property (which “Step into” would show) or it’s something way unexpected (like the IDE crashing your app when the breakpoint brings the IDE to the front, etc.…).
As far as I can see moCalculs.CarreguesInicials is the last method called before OpenGL stuff comes in play. So, if moCalculs.CarreguesInicials is your code, start with a breakpoint somewhere here.
Thank you Carsten.
You were right. The problem was in my method “moCalculs.CarreguesInicials”. As it was in a Thread I could not see where it stopped. The problem was OpenGL, but very simple. I had forgotten to put the line
myOpenGLSirface.MakeCurrent
which is now necessary.
I understand that for Apple errors in OpenGL are not supported, but crashing without any comment is not good and for Xojo is not acceptable.