New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ofxOscReceiver Error when creating and destroying repeatedly #7938
Comments
I made a little test app and rapid brainstorming here but it seems the but it's only an hypothesis and needs a bit more thought (I implemented roughly with atomic bool). |
i made a crashing app here #7949; it's probably not the same crash you get, but it's a crash related to deallocation of ofxOscReceiver. I currently am implicated in macOS only; if you can try it on windows just to confirm the crashing behaviour there. I have a fix for it, but it requires minor modding to oscpack's udpsocket implementation: changing the // detach thread so we don't have to wait on it before creating a new socket
// or on destruction, the custom deleter for the socket unique_ptr already
// does the right thing but maybe "the right thing" was not tested in extreme alloc/dealloc with "overlapping" instances. so please let me know if you get crashes, and if you want to add crashing scenarios that are closer to your behaviour please go for it. I will ponder a bit more with some distance before submitting a pull request for the fix and we can discuss the logic more at that point. |
I get a crash immediately using your test with the following code. This is without any modifications you mentioned to ofxOsc. Did you push any changes to ofxOscReceiver you made for testing?
|
I'm actually getting the crash just from making a message:
|
When I change to this, then no crash, I am using a nightly from a week or two ago.
|
hmm i will look i to the « add » method (it’s a different thing no code was pushed) but did you manage to run the app in #7949? please confirm, and i will push a fix proposal there, so we can be a bit systematic — maybe you can look in the app: i’m doing funny stuff, but perhaps not the same funny you have in your case. if you can reproduce your case in the app (perhaps ifdef’d) it would be great to test the fixed with as many cases. |
I just tried with the test app in #7949 and it hung, and eventually crashed. I am using the latest nightly and macOS 14.2.1. In the "Problem Report" The exception type is
When I use addIntArg(), etc , then I see the OF window with colored rectangles on the screen and then it crashes, pointing to different places.
Wrapped in an ifdef.
|
OK just to keep things sane I'm continuing in the PR thread #7949 |
#7953 fixes the non-explicit message (was choking on the const char * arg) |
… debugging] (#7953) #changelog #ofxOsc * ofxOscMessage::add(size_t argument) * ofxOscMessage::add(const char * argument)
Closed by #7949 |
…leedingmacOS * commit '7f37e70f65e9e022ba8868fb555570ce2c78a6ba': (37 commits) Allows Retina hi res enabled via App or Project.xcconfig (openframeworks#7971) actions changes (openframeworks#7968) Changing exr to hdr files for compatability with windows (openframeworks#7964) ofMesh - newfaces push_back to insert a list (openframeworks#7772) restore default-copy-constructibility of ofEvent (openframeworks#7969) [actions] ccache update (openframeworks#7967) Core small changes (openframeworks#7952) config.emscripten.default.mk for Emscripten >= 3.1.52 (openframeworks#7909) Fix edge case in findDelimiter (openframeworks#7911) oscpack / udpSocket: invert the "break_" semaphore (openframeworks#7963) ofxOscMessage: extra implicit adds [fixes something noted through openframeworks#7938 debugging] (openframeworks#7953) #changelog #ofxOsc ofThreadChannel::clear() to clear the channel (openframeworks#7921) #changelog #threadChannel OfxOscReceiver: from detach() to join() (openframeworks#7949) Update ofMathConstants.h (openframeworks#7958) [actions] update ubuntu 24.04 (openframeworks#7955) ofScopedMatrix (openframeworks#7946) [actions] - testing one action with multiple jobs for tests (openframeworks#7860) adding of.entitlements and vscode files to gitignore (openframeworks#7031) Make - use relative paths (openframeworks#7519) FPS timing with chrono (openframeworks#7867) ... # Conflicts: # libs/openFrameworks/sound/ofAVEngineSoundPlayer.mm
For a previous project we needed to create and destroy
shared_ptrs
ofofxOscSenders
andofxOscReceivers
. When allocating and destroying quickly, sometimes we would get a crash.We added a
messagesChannel.clear()
method just like #7921 toofThreadChannel
and called that along withmessagesChannel.close()
in thestop()
method. This worked for our purposes because we were resetting the shared_ptrs and thus the stop method was getting called in the de-constructor.Maybe the
messagesChannel.close()
should be in the de-constructor orofxOscReceiver::stop()
The text was updated successfully, but these errors were encountered: