# Exc\_bad\_access related to the juce\_String.cpp file

**URL:** <https://forum.juce.com/t/exc-bad-access-related-to-the-juce-string-cpp-file/44503>\
**Category:** Getting Started\
**Created:** [February 18, 2021, 2:32pm UTC](https://forum.juce.com/t/exc-bad-access-related-to-the-juce-string-cpp-file/44503 "2021-02-18T14:32:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![adeleg](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@adeleg](https://forum.juce.com/u/adeleg)\
**Post date:** [February 18, 2021, 2:32pm UTC](https://forum.juce.com/t/exc-bad-access-related-to-the-juce-string-cpp-file/44503/1 "2021-02-18T14:32:31Z")

</div>

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:

 ![otodecksError2](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/4/47b3a35f0f77f5b63840faf20d16662856268b2e.jpeg)

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [February 18, 2021, 2:51pm UTC](https://forum.juce.com/t/exc-bad-access-related-to-the-juce-string-cpp-file/44503/2 "2021-02-18T14:51:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![adeleg](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@adeleg](https://forum.juce.com/u/adeleg)\
**Post date:** [February 18, 2021, 3:01pm UTC](https://forum.juce.com/t/exc-bad-access-related-to-the-juce-string-cpp-file/44503/3 "2021-02-18T15:01:41Z")

</div>

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:

 ![otodecksError6](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/8/85dabbb867cfb3ceaf4a1d66ef246957654f2568.jpeg)

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [February 18, 2021, 3:07pm UTC](https://forum.juce.com/t/exc-bad-access-related-to-the-juce-string-cpp-file/44503/4 "2021-02-18T15:07:08Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![adeleg](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@adeleg](https://forum.juce.com/u/adeleg)\
**Post date:** [February 18, 2021, 3:16pm UTC](https://forum.juce.com/t/exc-bad-access-related-to-the-juce-string-cpp-file/44503/5 "2021-02-18T15:16:21Z")

</div>

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:

 ![otodecksError7](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/1/118ade5fe12b67464afe085bb65ca4214bd8ca5f.jpeg)

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [February 18, 2021, 3:16pm UTC](https://forum.juce.com/t/exc-bad-access-related-to-the-juce-string-cpp-file/44503/6 "2021-02-18T15:16:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![adeleg](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@adeleg](https://forum.juce.com/u/adeleg)\
**Post date:** [February 18, 2021, 3:19pm UTC](https://forum.juce.com/t/exc-bad-access-related-to-the-juce-string-cpp-file/44503/7 "2021-02-18T15:19:20Z")

</div>

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 () |

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [February 18, 2021, 3:53pm UTC](https://forum.juce.com/t/exc-bad-access-related-to-the-juce-string-cpp-file/44503/8 "2021-02-18T15:53:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [February 18, 2021, 6:36pm UTC](https://forum.juce.com/t/exc-bad-access-related-to-the-juce-string-cpp-file/44503/9 "2021-02-18T18:36:10Z")

</div>

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

> <https://github.com/juce-framework/JUCE/commit/be1e3df4d0975f9bd8a7ad360baeda61b80d7a59>

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.

---

<div class="post-metadata">

**Author:** ![adeleg](https://avatars.discourse-cdn.com/v4/letter/a/e47774/32.png) [@adeleg](https://forum.juce.com/u/adeleg)\
**Post date:** [February 19, 2021, 11:29am UTC](https://forum.juce.com/t/exc-bad-access-related-to-the-juce-string-cpp-file/44503/10 "2021-02-19T11:29:15Z")

</div>

Thanks @reuk I will try that.
