Forum
    • Categories
    • Register
    • Login

    Mod Matrix bug - hopefully squashed

    Scheduled Pinned Locked Moved Bug Reports
    5 Posts 2 Posters 22 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DanHD
      DanH
      last edited by DanH

      One for @Christoph-Hart . I've been getting straight crashes for a while to do with hovering above modulated sliders, and constructing the modulation dragger / info popup. Anyway Claude has helped find a fix for this. I'll post the crash report then Claude's answer and fix:

      Crash report:

      Thread 0 Crashed:: JUCE Message Thread Dispatch queue: com.apple.main-thread
      0   HISE                          	       0x104e7e034 hise::MatrixIds::Helpers::IntensityTextConverter::IntensityTextConverter(hise::MatrixIds::Helpers::IntensityTextConverter::ConstructData const&) + 80
      1   HISE                          	       0x104c8cd48 hise::HiSlider::HoverPopup::rebuild() + 1652
      2   HISE                          	       0x104c8c498 hise::HiSlider::HoverPopup::HoverPopup(hise::HiSlider&, juce::ValueTree const&, juce::String const&, juce::Array<int, juce::DummyCriticalSection, 0> const&, juce::StringArray const&, hise::HiSlider::HoverPopupLookandFeel::PositionData const&, bool) + 3352
      3   HISE                          	       0x104c90f1c hise::HiSlider::ModUpdater::onExclusiveSourceSelection(hise::HiSlider::ModUpdater&, int) + 532
      4   HISE                          	       0x104c928b4 hise::SafeLambda<hise::HiSlider::ModUpdater, void, int>::call(int) + 60
      5   HISE                          	       0x104c89b0c hise::HiSlider::setup(hise::Processor*, int, juce::String const&) + 1600
      6   HISE     
      

      FIX in MacroControlledComponents.cpp:

      The bug is here:
      onExclusiveSourceSelection is called during setup() via setUpdateFunction() → container->currentMatrixSourceBroadcaster.addListener(*this, ModUpdater::onExclusiveSourceSelection) which fires immediately.
      At that point during a content rebuild, slider.getProcessor() may still be valid but mod->getIntensityTextConstructData() is returning a ConstructData struct with a null or invalid member - specifically at offset +80 into the constructor, which is the 3rd or 4th member being initialised.
      The fix for Christoph is that onExclusiveSourceSelection should not create a HoverPopup during setup() - it needs a guard:

      void HiSlider::ModUpdater::onExclusiveSourceSelection(ModUpdater& mu, int index)
      {
          // Guard: don't rebuild hover popup if component isn't visible yet
          if(!mu.parent.isShowing())
              return;
              
          // ... rest of function
      }
      

      EDIT - Bit more info:

      • Crash is at cd.connectedSlider = parent.getComponent()
      • During compile/rebuild, parent.getComponent() returns a pointer to a component that's being destroyed
      • Component::SafePointer constructor tries to register with the component's ComponentVTable which is already partially destroyed
      • Fix: null check parent.getComponent() before constructing, or defer HoverPopup creation until after rebuild is complete
      void HiSlider::ModUpdater::onExclusiveSourceSelection(ModUpdater& mu, int index)
      {
          auto& slider = mu.parent;
          
          if(!slider.isShowing())
              return;
              
          auto matrixData = MatrixIds::Helpers::getMatrixDataFromGlobalContainer(slider.getProcessor()->getMainController());
          auto targetId = slider.getProcessor()->getModulationTargetId(slider.getParameter());
          auto hasConnection = MatrixIds::Helpers::getConnection(matrixData, index, targetId).isValid();
      
          if (hasConnection)
          {
              mu.currentExlusiveIndex = index;
              Array<int> connectedSources;
              connectedSources.add(index);
              StringArray allSources, sourceList;
              MatrixIds::Helpers::fillModSourceList(slider.getProcessor()->getMainController(), allSources);
              sourceList.add(allSources[index]);
      
              if (auto pd = slider.getHoverPopupLookAndFeel().getModulatorDragData(slider, sourceList))
                  slider.currentHoverPopup = new HoverPopup(slider, matrixData, targetId, connectedSources, sourceList, pd, true);
          }
          else
          {
              mu.currentExlusiveIndex = -1;
              slider.currentHoverPopup = nullptr;
          }
      }
      

      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
      https://dhplugins.com/ | https://dcbreaks.com/
      London, UK

      Oli UllmannO 1 Reply Last reply Reply Quote 0
      • Oli UllmannO
        Oli Ullmann @DanH
        last edited by

        @DanH
        In which DAW does your plug-in crash?

        DanHD 1 Reply Last reply Reply Quote 0
        • DanHD
          DanH @Oli Ullmann
          last edited by

          @Oli-Ullmann this is in Hise itself

          DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
          https://dhplugins.com/ | https://dcbreaks.com/
          London, UK

          Oli UllmannO 1 Reply Last reply Reply Quote 0
          • Oli UllmannO
            Oli Ullmann @DanH
            last edited by

            @DanH
            Oh, ok. That hasn't happened to me yet. I'll test it thoroughly again. Thank you.

            DanHD 1 Reply Last reply Reply Quote 0
            • DanHD
              DanH @Oli Ullmann
              last edited by

              @Oli-Ullmann doesn't happen in a small project, just my big one, but hopefully found the culprit. drag and dropping components in the component list could also trigger the crash....

              DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
              https://dhplugins.com/ | https://dcbreaks.com/
              London, UK

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              21

              Online

              2.2k

              Users

              13.4k

              Topics

              116.7k

              Posts