Crashes on undo in 64bit version

Issue #8 resolved
Steffen Fuerst repo owner created an issue

No description provided.

Comments (22)

  1. Carlos Nunes

    v0.9 - It still crashing if I have FX mapping (or any other plugin dialog open) and select any other dialog not related to Reaper.

  2. Steffen Fuerst reporter

    What do you mean with “any other dialog not related to Reaper”? Can you give an example?

  3. Carlos Nunes

    After having a hard time trying to compile the code (I only got Juce in 32bit, by the way), I was able to narrow this issue o Juce library.

    One thing that I could fix was a crash when you’re in plugin mode, while trying to close the current project (I did a pull request for that).

    About my main issue, I narrowed the issue to Juce library (commit hash: 4009680f7956c03659f355a806c3e0e923aab48f, tag:1.52) at juce_ResizableWindow.cpp::322, which I unfortunatelly I couldn’t debug that library (help?).

    Trying some guessing, I gave a shot at CCSModesEditor.cpp::56 changing to:

    m_pWindow->setContentComponent(*ppComponent, false, true);

    (ok it was by mistake, but it was good!)

    Doing that, I could Alt+PlugIn at Behringer, getting an empty and collapsed dialog, but it allows me to open/click any other dialog without Reaper crashing.

    Just to complement the information above, I couldn’t compile nothing beyond the tag 1.52 for Juce (using VS2019)

  4. Steffen Fuerst reporter

    Thank you for this work and also for the pull request. I hope I will find some time next week to create an update.

  5. Carlos Nunes

    Thank you! I’m glad to help!
    Just to be complement the information. I’m running on a Win10x64 PC. The behavior is the same for both Reaper x32 and x64…

  6. Carlos Nunes

    Ok, this is as far I can go not being a C++ programmer… 🙂

    As soon I leave Reaper “environment”, I get an exception at this function below.

    Since “getLookAndFeel()” was null at this point, I tried to create an overwrite at PlugModeComponent returning a default value, but it didn’t make any difference…

  7. Carlos Nunes

    Here’s the problem!

    Doing that avoids the total crash, but it leaves a blank dialog (at least on my upgrade branch).

    Do you have any lead for an “elegant” way to fix that?
    You don’t need to detail it too much, let me deal with the implementation, I just need a direction…

  8. Steffen Fuerst reporter

    When this == nullptr then we are in undefined behaviour land, I think deleteWindow must have been called from an already deleted instance (or something like this). The only place where the deleteWindow function is called via an instance pointer is from CCSModesEditorWindow::closeButtonPressed, via m_pManager->getEditor(), but the m_pEditor pointer isn’t modified before the whole extension is deconstructed, and as far as I understood you, the problem appears when you switch to another window, and not when you close Reaper (there is a problem in the CSurf_MCU desctructor, as the instances are not deleted in the reverse order to there creation, e.g. the delete m_pCCSManager call must be follow direct after delete m_pTransport).

    Can you show me a callstack for the situation when this == nullptr?

    I must say, this is really awkward bug, welcome to the C++ land.

  9. Carlos Nunes

    Here is it:

    Due C#, I have no problems reading the callstack, but this one was clueless for me, since at the second line I’m already inside juce library…

    But since you’re saying that the destructors are called out of the order, I can investigate that!

    Thanks a lot!

  10. Steffen Fuerst reporter

    Okay, so was right that deleteWindow is called from closeButtonPressed (which is inlined into handleUserClosingWindow()). And you run into this breakpoint/callstack when you switch to a different window with Alt-Tab or Win-R?

  11. Carlos Nunes

    not anymore (after upgrading JUCE library), only when I try to close this blank dialog…

    but using Juce 1.52, as soon I press Alt-Tab or Win-R, I get the same crash…

  12. Steffen Fuerst reporter

    And with the Juce 6 MCU Editor window will stay, but is blank, after you press Alt-Tab, correct?

    The window is blank, when it does not contains a (main)component. Is it possible that deleteWindow() is called, but the window is still visible after removeFromDesktop was called?

  13. Carlos Nunes

    And with the Juce 6 MCU Editor window will stay, but is blank, after you press Alt-Tab, correct?

    correct!

    but the window is still visible after removeFromDesktop was called?

    I really don’t know…

    I will be tracking that this afternoon.

  14. Carlos Nunes

    I did it!!!

    And this is the better: it can be applied to the current version (before JUCE upgrade)!

    My PR already contains this fix, if you like to jump to this update.

    For now, I will wait for your official release (no rush) before making any change…

    (I cannot compile a debug version and the x64 version didn’t work for me)

  15. Log in to comment