libossia icon indicating copy to clipboard operation
libossia copied to clipboard

[ossia-max] hang when closing and reopening patcher

Open evanmtp opened this issue 2 years ago • 3 comments

Found this one while testing in relation to #792 . Sometimes when closing and reopening a patcher with ossia objects, Max hangs indefinitely. Force quitting leads to a report with a ton of lines like this:

11 ossia::max_binding::register_children_in_patcher_recursively(object*, ossia::max_binding::object_base*) + 761 (libossia-max.dylib + 5710345) [0x133f5d209] 1-11

Example report here:

https://gist.github.com/evanmtp/e214f13f71b84803936258af986abb20

Test files: hangtest.zip

Steps to reproduce:

  1. Open _hangtest.maxpat
  2. Close _hangtest.maxpat
  3. Repeat 1 and 2 until Max hangs (usually 5-10 times is sufficient)

evanmtp avatar Jun 02 '22 01:06 evanmtp

I confirm I can reproduce this hang. according to report, it loops indefinitely in register_children_in_patcher_recursively

avilleret avatar Jun 13 '22 07:06 avilleret

I'm wondering about the code there : what would you think about:

1/ Making a list of all the subpatchers in a std::vector 2/ applying the operations on that vector in a for-loop ?

Would that break the algorithm too much ?

jcelerier avatar Jun 13 '22 08:06 jcelerier

I think it is worth refactoring this algo again in light of what we've learned since

avilleret avatar Jun 17 '22 07:06 avilleret