When testing an iOS build of a standalone plugin, I’m seeing a reproducible crash:
There are two editable labels (dynamically created).
When dismissing the virtual keyboard (with “return”) while editing the second label, I get the following output from asan:
_BSMachError: port 8003; (os/kern) invalid capability (0x14) "Unable to insert COPY_SEND"
=================================================================
==1542==ERROR: AddressSanitizer: heap-use-after-free on address 0x000145112038 at pc 0x000101a30c70 bp 0x00016efb46d0 sp 0x00016efb46c8
READ of size 8 at 0x000145112038 thread T0
#0 0x101a30c6c in juce::UIViewComponentPeer::updateHiddenTextContent(juce::TextInputTarget*)+0x1c8 (/var/containers/Bundle/Application/C5B2E2CB-129F-429C-B67B-631C1EA13AA6/MyCoolPlugin.app/MyCoolPlugin:arm64+0x100be8c6c)
#1 0x101a27a44 in juce::UIViewComponentPeer::textViewReplaceCharacters(juce::Range<int>, juce::String const&)+0x560 (/var/containers/Bundle/Application/C5B2E2CB-129F-429C-B67B-631C1EA13AA6/MyCoolPlugin.app/MyCoolPlugin:arm64+0x100bdfa44)
#2 0x101a27328 in -[JuceUIView textView:shouldChangeTextInRange:replacementText:]+0x370 (/var/containers/Bundle/Application/C5B2E2CB-129F-429C-B67B-631C1EA13AA6/MyCoolPlugin.app/MyCoolPlugin:arm64+0x100bdf328)
#3 0x18c9dc9f8 in <redacted>+0x9c (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x1ae9f8)
#4 0x18ccad464 in <redacted>+0x5c (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x47f464)
#5 0x18d5013e0 in <redacted>+0x9c (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0xcd33e0)
#6 0x18ccac438 in <redacted>+0x118 (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x47e438)
#7 0x18ccabbe8 in <redacted>+0x40c (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x47dbe8)
#8 0x18ccab758 in <redacted>+0x38 (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x47d758)
#9 0x18d5013e0 in <redacted>+0x9c (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0xcd33e0)
#10 0x18ccab65c in <redacted>+0x1e4 (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x47d65c)
#11 0x18c9dc530 in <redacted>+0x2f8 (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x1ae530)
#12 0x18c9dbdf8 in <redacted>+0x6f8 (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x1addf8)
#13 0x18c9da3e0 in <redacted>+0x1f8 (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x1ac3e0)
#14 0x18c9d9288 in <redacted>+0x14c0 (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x1ab288)
#15 0x18ccc5464 in <redacted>+0xe4 (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x497464)
#16 0x18d501fa8 in <redacted>+0xbc (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0xcd3fa8)
#17 0x18c8675ec in <redacted>+0x17c (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x395ec)
#18 0x18ccc510c in <redacted>+0x158 (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x49710c)
#19 0x18c87195c in <redacted>+0x9ec (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x4395c)
#20 0x18c86ce74 in <redacted>+0xc84 (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x3ee74)
#21 0x18c83de78 in <redacted>+0x150 (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0xfe78)
#22 0x18d193308 in <redacted>+0x938 (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x965308)
#23 0x18d195894 in <redacted>+0x1294 (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x967894)
#24 0x18d18e7ac in <redacted>+0x94 (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x9607ac)
#25 0x18322b778 in <redacted>+0x14 (/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation:arm64+0xeb778)
#26 0x18322b6f8 in <redacted>+0x54 (/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation:arm64+0xeb6f8)
#27 0x18322af80 in <redacted>+0xc8 (/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation:arm64+0xeaf80)
#28 0x183228b58 in <redacted>+0x414 (/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation:arm64+0xe8b58)
#29 0x183148c54 in CFRunLoopRunSpecific+0x1b0 (/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation:arm64+0x8c54)
#30 0x184ff4f80 in GSEventRunModal+0x60 (/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices:arm64+0xaf80)
#31 0x18c8a15c0 in UIApplicationMain+0xe8 (/System/Library/Frameworks/UIKit.framework/UIKit:arm64+0x735c0)
This is with JUCE 6.0.8 on a device running iOS 10.