Vexing exceptions on MAC

Seems like there are too much vexing assertion on the MAC platform, and porting code that works flawlessly on Windows and Linux, seems to fail on Mac.

So this thread will list all the PITA I’ve found so far, so they can be fixed:

  • setThreadAffinity : not supported on Mac, but generate a runtime assertion, should not compile or warning + be ignored in runtime
  • OK() macro in CoreAudio trigger jassertfalse, while it shouldn’t. When doing AudioDevice.open() the result is the error string, so there is no need to double pain the user, I’m handling the error already in my code, but I can’t prevent the assertion.
  • OpenGLPixelFormat listing : when there is no implementation, please return at least a default version (ARGB for example), so the code doesn’t figure out there is no OpenGL pixel format supported.

TBH I think the assertion in CoreAudio is probably just left over from my own tests when I was writing it. I guess it never fires on my machine, or else I’d have removed it before.

I already added the openGL changes that we discussed on the other thread - did you see that?

Speaking of which are we / did we remove the re-entrancy assert for VST plugins?

Can’t remember, TBH. There’s one in the destructor, but that seems pretty sensible, as a reentrant destructor would be a bad thing to happen.

I’ve modified my copy here, but I’ll sync as soon as possible.
I continue porting my component to Mac, and will let you know the result if I encounter other situation like this.

Can’t remember, TBH. There’s one in the destructor, but that seems pretty sensible, as a reentrant destructor would be a bad thing to happen.[/quote]

Yes, thats the one, in ~VSTPluginInstance(). It always goes off for me at weird times. I’m not misusing the plugin API. Well, at least, I think I’m not. Nothing fancy is going on but sometimes I get this assert. I always comment it out with a patch every time I get the tip, and I’ve never had a problem. What should I do ?

I’m fairly certain that I am not trying to delete the same plugin twice, but it might be the case that I am trying to delete two different plugin instances at the same time, from different threads.

Well, I guess that if you can’t trace the cause, and if it’s not doing any harm, then don’t worry about it!