Exc_bad_access related to the juce_String.cpp file

Hi there,

I am new to juce and a novice at C++. I am using XCode on my Macbook pro and downloaded Juce v.6.0.7. I am unable to launch even an example application such as for example the “PluckedStringsDemo”. The problem seems to be in the juce_core>text>juce_String.cpp file. According to the message thread it says: “EXC_BAD_ACCESS (code=2,address=0x7ffeef3ffff8)”.

I have been stuck on this for ages - someone please help me figure out how to get started. Please see my screenshots below:

To work out what’s going wrong, we need to see the bottom of the call stack, which is shown in the pane on the left. If you click on the top of the call stack (where it says StringHolder::createUninitialised...), then scroll down, hold shift, and click the bottom of the call stack, it will highlight all the entries, and you can then right-click to copy them.

Hi @reuk

Thanks for getting back to me soo quickly. I could not paste all the threads as the message would be too long but here is the screen - shot showing the bottom of the call stack:

Could you try posting from the bottom (the frame labelled start) up to the point where the stack starts calling logAssertion and String::String repeatedly? I’m most interested in what’s happening directly before the first call to logAssertion.

Hi @reuk

The first call to logAssertion seems to be the 9th message and then it keeps doing so repeatedly upto message number 104,778 - I think those are too many to fit here. Please see below:

Sorry, I wasn’t clear. I meant the first from the bottom.

oh ok, these are the messages:

#104778 0x0000000100229f94 in juce::logAssertion(char const*, int) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_core/logging/juce_Logger.cpp:52
#104779 0x000000010025ab44 in juce::String::String(char const*) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_core/text/juce_String.cpp:324
#104780 0x000000010022f66d in juce::String::String(char const*) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_core/text/juce_String.cpp:306
#104781 0x0000000100232805 in juce::File::getSpecialLocation(juce::File::SpecialLocationType) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_core/native/juce_mac_Files.mm:204
#104782 0x0000000100257fea in juce::SystemStats::isRunningInAppExtensionSandbox() at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_core/system/juce_SystemStats.cpp:236
#104783 0x0000000100295afd in juce::Process::isForegroundProcess() at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_core/native/juce_mac_Threads.mm:38
#104784 0x00000001005b4b59 in juce::TopLevelWindowManager::findCurrentlyActiveWindow() const at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp:103
#104785 0x000000010052c519 in juce::TopLevelWindowManager::checkFocus() at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp:48
#104786 0x000000010052c4b7 in juce::TopLevelWindow::focusOfChildComponentChanged(juce::Component::FocusChangeType) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp:161
#104787 0x000000010045f7a4 in juce::Component::internalChildFocusChange(juce::Component::FocusChangeType, juce::WeakReference<juce::Component, juce::ReferenceCountedObject> const&) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/components/juce_Component.cpp:2669
#104788 0x000000010045f6fa in juce::Component::internalFocusGain(juce::Component::FocusChangeType, juce::WeakReference<juce::Component, juce::ReferenceCountedObject> const&) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/components/juce_Component.cpp:2648
#104789 0x000000010045fdaf in juce::Component::takeKeyboardFocus(juce::Component::FocusChangeType) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/components/juce_Component.cpp:2753
#104790 0x000000010045d13a in juce::Component::grabFocusInternal(juce::Component::FocusChangeType, bool) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/components/juce_Component.cpp:2765
#104791 0x0000000100451eec in juce::Component::grabKeyboardFocus() at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/components/juce_Component.cpp:2808
#104792 0x00000001005258f6 in juce::ComponentPeer::handleFocusGain() at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp:348
#104793 0x00000001005cea63 in juce::NSViewComponentPeer::viewFocusGain() at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm:1388
#104794 0x00000001005cb0c1 in juce::JuceNSViewClass::becomeFirstResponder(objc_object*, objc_selector*) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm:1950
#104795 0x00007fff423f3978 in -[NSWindow _realMakeFirstResponder:] ()
#104796 0x00000001005d5e89 in juce::NSViewComponentPeer::grabFocus() at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm:1413
#104797 0x000000010053af97 in juce::NSViewComponentPeer::becomeKeyWindow() at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm:1062
#104798 0x00000001005d0167 in juce::JuceNSWindowClass::becomeKeyWindow(objc_object*, objc_selector*) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm:2071
#104799 0x00007fff423f580c in -[NSWindow _changeKeyAndMainLimitedOK:] ()
#104800 0x00007fff423f5369 in -[NSWindow _makeKeyRegardlessOfVisibility] ()
#104801 0x00007fff423f4f18 in -[NSWindow makeKeyAndOrderFront:] ()
#104802 0x00000001005d5b6f in juce::NSViewComponentPeer::toFront(bool) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm:526
#104803 0x0000000100453567 in juce::Component::toFront(bool) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/components/juce_Component.cpp:898
#104804 0x0000000100529daf in juce::TopLevelWindow::visibilityChanged() at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/windows/juce_TopLevelWindow.cpp:190
#104805 0x0000000100529d2f in juce::ResizableWindow::visibilityChanged() at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp:197
#104806 0x0000000100451f84 in juce::Component::sendVisibilityChangeMessage() at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/components/juce_Component.cpp:579
#104807 0x0000000100451c03 in juce::Component::setVisible(bool) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/components/juce_Component.cpp:560
#104808 0x000000010000ad95 in Application::MainWindow::MainWindow(juce::String const&, juce::Component*, juce::JUCEApplication&) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/PluckedStringsDemo/PluckedStringsDemo/Source/Main.cpp:49
#104809 0x000000010000289d in Application::MainWindow::MainWindow(juce::String const&, juce::Component*, juce::JUCEApplication&) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/PluckedStringsDemo/PluckedStringsDemo/Source/Main.cpp:37
#104810 0x0000000100002420 in Application::initialise(juce::String const&) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/PluckedStringsDemo/PluckedStringsDemo/Source/Main.cpp:23
#104811 0x000000010032a8b9 in juce::JUCEApplicationBase::initialiseApp() at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_events/messages/juce_ApplicationBase.cpp:297
#104812 0x0000000100531d85 in juce::JUCEApplication::initialiseApp() at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_gui_basics/application/juce_Application.cpp:92
#104813 0x000000010032a62d in juce::JUCEApplicationBase::main() at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_events/messages/juce_ApplicationBase.cpp:256
#104814 0x000000010032a49c in juce::JUCEApplicationBase::main(int, char const**) at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/JUCE/modules/juce_events/messages/juce_ApplicationBase.cpp:240
#104815 0x0000000100002243 in main at /Users/adelegikonyo/Dropbox/My Mac (Adele’s MacBook Pro)/Documents/CompSci/session3/objectOriented/finalProject/PluckedStringsDemo/PluckedStringsDemo/Source/Main.cpp:68
#104816 0x00007fff70c653d5 in start ()
#104817 0x00007fff70c653d5 in start ()

Thanks, I think I see the problem. I’ll try to get a fix together soon.

Thanks for reporting this issue. This should be resolved on the develop branch:

You’ll need to download the latest copy of JUCE from the develop branch in order to use this fix. Please let us know if you run into any further issues.

1 Like

Thanks @reuk I will try that.