# Vita stack overflow

**URL:** <https://qa.fmod.com/t/vita-stack-overflow/11858>\
**Category:** FMOD Engine\
**Created:** [March 18, 2015, 2:40pm UTC](https://qa.fmod.com/t/vita-stack-overflow/11858 "2015-03-18T14:40:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tribute](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/tribute/32/6086_2.png) [@tribute](https://qa.fmod.com/u/tribute)\
**Post date:** [March 18, 2015, 2:40pm UTC](https://qa.fmod.com/t/vita-stack-overflow/11858/1 "2015-03-18T14:40:37Z")

</div>

I just got FMOD working on PC. Tried porting it over to Vita and I get a stack overflow.  
All our assets are loaded on a seperate thread, but as soon as I try loading the first sound, the game crashes.

```
SceLibKernel_0xE00DAE40!function_starting_at_0xE05EE61C() + 8 bytes	C++
SceLibKernel_0xE00DAE40!function_starting_at_0xE05F1F74() + 10 bytes	C++
CNCVita!FMOD_OS_File_Open(char const*,char*,unsigned int*,void**)() + 34 bytes	C++
CNCVita!FMOD::DiskFile::reallyOpen(char const*,unsigned int*)() + 90 bytes	C++
CNCVita!FMOD::File::open(char const*,unsigned int,unsigned int,char const*)() + 216 bytes	C++
CNCVita!FMOD::SystemI::createSoundInternal(char const*,unsigned int,unsigned int,unsigned int,FMOD_CREATESOUNDEXINFO*,bool,FMOD::SoundI**)() + 1838 bytes	C++
CNCVita!FMOD::SystemI::createSound(char const*,unsigned int,FMOD_CREATESOUNDEXINFO*,FMOD::SoundI**)() + 838 bytes	C++
CNCVita!FMOD::System::createSound(char const*,unsigned int,FMOD_CREATESOUNDEXINFO*,FMOD::Sound**)() + 66 bytes	C++
CNCVita!SoundEffect::SoundEffect(std::string* filename) Line 14 + 54 bytes	C++
CNCVita!SoundLoader::Load(const std::string& filename) Line 7 + 44 bytes	C++
CNCVita!ContentManager::ReadAsset(std::string* assetName) Line 76 + 12 bytes	C++
CNCVita!ContentManager::Load(std::string* assetName) Line 33 + 8 bytes	C++
CNCVita!ResourceManager::LoadSound(std::string* i_path) Line 98 + 16 bytes	C++
CNCVita!ResourceManager::LoadContentDirectory(std::string* path, enum AssetType assetType) Line 39 + 18 bytes	C++
CNCVita!Resources::LoadAll() Line 131 + 32 bytes	C++
CNCVita!std::_Bind<true,void,void(*const)(void)>::_Do_call(std::tuple* _Myfargs) Line 1959	C++
CNCVita!std::_Bind<true,void,void(*const)(void)>::operator()() Line 1947	C++
CNCVita!std::_LaunchPad<std::_Bind<true,void,void(*const)(void)>>::_Run(std::_LaunchPad<std::_Bind<true,void,void(*const)(void)>>* _Ln) Line 212	C++
CNCVita!std::_LaunchPad<std::_Bind<true,void,void(*const)(void)>>::_Go() Line 204	C++
SceLibc_0xF005CC80!function_starting_at_0xF00EB39C() + 12 bytes	C++
SceLibKernel_0xE00DAE40!function_starting_at_0xE05E8E8C()	C++

```

Am I missing something? Any settings I should be using?  
Thanks,

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [March 19, 2015, 4:02am UTC](https://qa.fmod.com/t/vita-stack-overflow/11858/2 "2015-03-19T04:02:18Z")

</div>

How large are you setting the stack for that thread?  
I’d recommend 64KB as a minimum.

---

<div class="post-metadata">

**Author:** ![tribute](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/tribute/32/6086_2.png) [@tribute](https://qa.fmod.com/u/tribute)\
**Post date:** [March 19, 2015, 1:21pm UTC](https://qa.fmod.com/t/vita-stack-overflow/11858/3 "2015-03-19T13:21:34Z")

</div>

Not quite sure. I was using an std::thread. Swapped it up with an sce thread and increased the stack size. Seems to have solved it. Good to go now.

Thanks,
