JUCE icon indicating copy to clipboard operation
JUCE copied to clipboard

[Bug]: Data Race in Logic plugin (AU) on shut down

Open 7sharp9 opened this issue 8 months ago • 0 comments
trafficstars

Detailed steps on how to reproduce the bug

I get the following data race in logic when using the thread sanitiser:

Data race (pid=88833)
Write of size 8 at 0x7b740012b418 by main thread:
  at 0x196f9edbe juce::AudioUnitHelpers::ChannelRemapper::release() (juce_AU_Shared.h:81)
  at 0x196f6235f JuceAU::Cleanup() (juce_audio_plugin_client_AU_1.mm:238)
  at 0x196fdbbc2 ausdk::AUBase::DoCleanup() (AUBase.cpp:238)
  at 0x196febdba ausdk::AUMethodUninitialize(void*) (AUPlugInDispatch.cpp:86)
  at 0x7ff817bca742 AudioUnitUninitialize
Previous read of size 8 at 0x7b740012b418 by thread T25:
  at 0x196faea61 juce::AudioUnitHelpers::ChannelRemapper::get(bool, int) const (juce_AU_Shared.h:88)
  at 0x196f64cdd JuceAU::Render(unsigned int&, AudioTimeStamp const&, unsigned int) (juce_audio_plugin_client_AU_1.mm:1532)
  at 0x196f64535 ausdk::AUBase::RenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int) (AUBase.h:174)
  at 0x196fe4001 ausdk::AUBase::DoRenderBus(unsigned int&, AudioTimeStamp const&, unsigned int, ausdk::AUOutputElement&, unsigned int, AudioBufferList&) (AUBase.h:548)
  at 0x196fe3503 ausdk::AUBase::DoRender(unsigned int&, AudioTimeStamp const&, unsigned int, unsigned int, AudioBufferList&) (AUBase.cpp:1272)
  at 0x196fee1ef ausdk::AUMethodRender(void*, unsigned int*, AudioTimeStamp const*, unsigned int, unsigned int, AudioBufferList*) (AUPlugInDispatch.cpp:325)
  at 0x7ff817bcbbae AudioUnitRender
Location is heap block of size 2104 at 0x7b740012ac00 allocated by main thread:
  at 0x106c9310d malloc
  at 0x196f5e947 ausdk::APFactory<ausdk::AUBaseLookup, JuceAU>::Factory(AudioComponentDescription const*) (ComponentBase.h:118)
  at 0x196f5e8f6 JuceAUFactory (juce_audio_plugin_client_AU_1.mm:2614)
  at 0x196f5eab6 OH_Studio_StandardAUFactory (juce_audio_plugin_client_AU_1.mm:2622)
  at 0x7ff8179f694e APComponent::newInstance(unsigned int, bool, void (OpaqueAudioComponentInstance*, int) block_pointer)
Thread T25 (tid=4109764, running) created by main thread at:
  at 0x106c6f360 pthread_create
  at 0x10a85764a MD::InitMPThreads()

Im not sure why this occurs but it happens when a plugin is loaded then you close logic, whether you save on exit makes no difference. I cant see anything in my plugin that would use ChannelRemapper directly so Im not sure whay this is happening.

What is the expected behaviour?

No data race on exit

Operating systems

macOS

What versions of the operating systems?

15.3.2

Architectures

x86_64

Stacktrace


Plug-in formats (if applicable)

AU

Plug-in host applications (DAWs) (if applicable)

Logic Audio 10.8.1

Testing on the develop branch

The bug is present on the develop branch

Code of Conduct

  • [x] I agree to follow the Code of Conduct

7sharp9 avatar Mar 18 '25 17:03 7sharp9