Skip to content
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

Crash when playing automation constraint #24

Closed
lossius opened this issue Sep 11, 2015 · 8 comments
Closed

Crash when playing automation constraint #24

lossius opened this issue Sep 11, 2015 · 8 comments

Comments

@lossius
Copy link

lossius commented Sep 11, 2015

Here are the steps that led to this crash:

  1. Opened i-score
  2. Added a minuit device with standard settings, connected to max. In max I had j.minuit_device.maxhelp and dbap=.maxhelp open
  3. Made a new constraint by double-clicking in the time canvas (not sure what the middle window is called)
  4. Added an automation, connecting to /mydbap/sources/source.1/gain, and set start value to -12 and end value to 0
  5. Hit play from the play menu
  6. The automation starts out, and I can see that messages are pushed to Max, but after a while I got the crash. The crash seems to be reproducible.

https://gist.github.com/lossius/1b840fd9f69e96ec4a7a

@jcelerier
Copy link
Member

Paging @theod ; this part crashed :

  • 13

Thread 7 Crashed:
0 org.i-score 0x00000001039953e9 JamomaAddress::setValue(OSSIA::Value const_) + 25
1 org.i-score 0x0000000103994afe JamomaAddress::pushValue(OSSIA::Value const_) + 30
2 org.i-score 0x0000000103987c39 JamomaState::launch() const + 41
3 org.i-score 0x0000000103987c39 JamomaState::launch() const + 41
4 org.i-score 0x000000010394269a std::__1::__function::__func<void ()(OSSIA::TimeValue const&, OSSIA::TimeValue const&, std::__1::shared_ptrOSSIA::StateElement), std::__1::allocator<void ()(OSSIA::TimeValue const&, OSSIA::TimeValue const&, std::__1::shared_ptrOSSIA::StateElement)>, void (OSSIA::TimeValue const&, OSSIA::TimeValue const&, std::__1::shared_ptrOSSIA::StateElement)>::operator()(OSSIA::TimeValue const&, OSSIA::TimeValue const&, std::__1::shared_ptrOSSIA::StateElement&&) + 58
5 org.i-score 0x000000010398840b JamomaTimeConstraint::ClockCallback(OSSIA::TimeValue const&, OSSIA::TimeValue const&, unsigned char) + 75
6 org.i-score 0x000000010397ca77 JamomaClock::tick() + 743
7 org.i-score 0x000000010397c669 JamomaClock::threadCallback() + 41
8 org.i-score 0x000000010397cf81 void* std::__1::__thread_proxy<std::__1::tuple<void (JamomaClock::)(), JamomaClock> >(void*) + 113
9 libsystem_pthread.dylib 0x00007fff8c5b005a _pthread_body + 131
10 libsystem_pthread.dylib 0x00007fff8c5affd7 _pthread_start + 176
11 libsystem_pthread.dylib 0x00007fff8c5ad3ed thread_start + 13

@theod theod self-assigned this Sep 11, 2015
@theod theod added the bug label Sep 11, 2015
@theod theod added this to the release/1.0 milestone Sep 11, 2015
@theod
Copy link
Member

theod commented Sep 11, 2015

ouch ! malloc error : pointer being freed was not allocated !
I've put a malloc break point in Xcode but maybe @jcelerier you have a trick figure out this kind of bug ?

@jcelerier
Copy link
Member

Mhh... On linux I use valgrind but it doesn't works in OS X (but I think that Xcode has some kind of facilities to detect such problems.)

Maybe (just maybe) a pointer is deleted manually somewhere while being part of a shared_ptr (like some std::shared_ptrOSSIA::Value) ?

@theod
Copy link
Member

theod commented Sep 11, 2015

thanks for the tip !
however Value are never passed using shared_ptr (at least inside the API).
are you doing this into i-score ?

@theod
Copy link
Member

theod commented Sep 11, 2015

I'm suspecting a memory conflict due to the listening.
I'll make some tests next week by closing the listening to see if it continue to crash.

@jcelerier
Copy link
Member

I just checked but there are no shared_ptr in iscore either. Could it happen for a same Value to be shared between two states (e.g. when taking the states of the child processes) and then having the first State being deleted which would make the Value in the other state invalid ?

@theod
Copy link
Member

theod commented Sep 14, 2015

adding a mutex to protect from multithreading access resolved the problem. @lossius could you test this on the next release before to close ?

@theod theod removed their assignment Sep 14, 2015
@lossius
Copy link
Author

lossius commented Sep 16, 2015

Hi, this seems to work without crashing now, although I notice other issues, but I'll report them separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants