-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sample application seg faults on macOS #129
Comments
Hi, thanks for the report. I cannot reproduce the problem on my machine. First things first, did you copy the data files next to the binary? (You probably did, otherwise you'd get a lot of warnings, but just want to make sure). If that's not the issue, could you try compiling the framework in debug mode and running it under debugger? Following the guide for linking with source and generating an XCode project is probably the easiest way to do it. I'd like to get a call-stack of the crash. I'm still exploring why no crash log is generated. |
Thanks for the quick response, and for not laughing me out of the room since this seems like something that should be obvious. Yes, the Data files are in place; sorry for missing that in the original post. For the record though, even without the files I do not see any warnings; see the run below, which was done against the release binaries. I'll try a Link with Source build as soon as possible, and update this ticket with any interesting results. src $ ls
CMakeLists.txt Findbsf.cmake main.cpp
src $ cmake -H. -Bbuild -G Xcode
-- The C compiler identification is AppleClang 9.1.0.9020039
-- The CXX compiler identification is AppleClang 9.1.0.9020039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for bsf installation...
-- ...bsf OK.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jeff/var/src/cpp/src/build
src $ cmake --build build
=== BUILD AGGREGATE TARGET ZERO_CHECK OF PROJECT myProject WITH CONFIGURATION Debug ===
Check dependencies
Write auxiliary files
write-file /Users/jeff/var/src/cpp/src/build/myProject.build/Debug/ZERO_CHECK.build/Script-DFF7DB901BBA4D5C8C2B5C00.sh
chmod 0755 /Users/jeff/var/src/cpp/src/build/myProject.build/Debug/ZERO_CHECK.build/Script-DFF7DB901BBA4D5C8C2B5C00.sh
PhaseScriptExecution CMake\ Rules build/myProject.build/Debug/ZERO_CHECK.build/Script-DFF7DB901BBA4D5C8C2B5C00.sh
cd /Users/jeff/var/src/cpp/src
/bin/sh -c /Users/jeff/var/src/cpp/src/build/myProject.build/Debug/ZERO_CHECK.build/Script-DFF7DB901BBA4D5C8C2B5C00.sh
echo ""
make -f /Users/jeff/var/src/cpp/src/build/CMakeScripts/ReRunCMake.make
make[1]: `/Users/jeff/var/src/cpp/src/build/CMakeFiles/cmake.check_cache' is up to date.
=== BUILD TARGET myApp OF PROJECT myProject WITH CONFIGURATION Debug ===
Check dependencies
Write auxiliary files
/bin/mkdir -p /Users/jeff/var/src/cpp/src/build/myProject.build/Debug/myApp.build/Objects-normal/x86_64
write-file /Users/jeff/var/src/cpp/src/build/myProject.build/Debug/myApp.build/Objects-normal/x86_64/myApp.LinkFileList
CompileC build/myProject.build/Debug/myApp.build/Objects-normal/x86_64/main.o main.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/jeff/var/src/cpp/src
export LANG=en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=160 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fcolor-diagnostics -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -DCMAKE_INTDIR=\"Debug\" -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.13 -g -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -I/Users/jeff/var/src/cpp/src/build/Debug/include -isystem /Users/jeff/opt/bsf_v1.0.0b_osx/include/bsfUtility -isystem /Users/jeff/opt/bsf_v1.0.0b_osx/include/bsfCore -isystem /Users/jeff/opt/bsf_v1.0.0b_osx/include/bsfEngine -I/Users/jeff/var/src/cpp/src/build/myProject.build/Debug/myApp.build/DerivedSources/x86_64 -I/Users/jeff/var/src/cpp/src/build/myProject.build/Debug/myApp.build/DerivedSources -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Users/jeff/var/src/cpp/src/build/Debug -std=gnu++14 -MMD -MT dependencies -MF /Users/jeff/var/src/cpp/src/build/myProject.build/Debug/myApp.build/Objects-normal/x86_64/main.d --serialize-diagnostics /Users/jeff/var/src/cpp/src/build/myProject.build/Debug/myApp.build/Objects-normal/x86_64/main.dia -c /Users/jeff/var/src/cpp/src/main.cpp -o /Users/jeff/var/src/cpp/src/build/myProject.build/Debug/myApp.build/Objects-normal/x86_64/main.o
Ld build/Debug/myApp normal x86_64
cd /Users/jeff/var/src/cpp/src
export MACOSX_DEPLOYMENT_TARGET=10.13
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -L/Users/jeff/var/src/cpp/src/build/Debug -F/Users/jeff/var/src/cpp/src/build/Debug -filelist /Users/jeff/var/src/cpp/src/build/myProject.build/Debug/myApp.build/Objects-normal/x86_64/myApp.LinkFileList -Xlinker -rpath -Xlinker /Users/jeff/opt/bsf_v1.0.0b_osx/lib -mmacosx-version-min=10.13 -Xlinker -object_path_lto -Xlinker /Users/jeff/var/src/cpp/src/build/myProject.build/Debug/myApp.build/Objects-normal/x86_64/myApp_lto.o -Xlinker -no_deduplicate -Wl,-search_paths_first -Wl,-headerpad_max_install_names /Users/jeff/opt/bsf_v1.0.0b_osx/lib/libbsf.dylib -Xlinker -dependency_info -Xlinker /Users/jeff/var/src/cpp/src/build/myProject.build/Debug/myApp.build/Objects-normal/x86_64/myApp_dependency_info.dat -o /Users/jeff/var/src/cpp/src/build/Debug/myApp
=== BUILD AGGREGATE TARGET ALL_BUILD OF PROJECT myProject WITH CONFIGURATION Debug ===
Check dependencies
Write auxiliary files
write-file /Users/jeff/var/src/cpp/src/build/myProject.build/Debug/ALL_BUILD.build/Script-A4B3DB79AFD4443E807BC0B8.sh
chmod 0755 /Users/jeff/var/src/cpp/src/build/myProject.build/Debug/ALL_BUILD.build/Script-A4B3DB79AFD4443E807BC0B8.sh
PhaseScriptExecution CMake\ Rules build/myProject.build/Debug/ALL_BUILD.build/Script-A4B3DB79AFD4443E807BC0B8.sh
cd /Users/jeff/var/src/cpp/src
/bin/sh -c /Users/jeff/var/src/cpp/src/build/myProject.build/Debug/ALL_BUILD.build/Script-A4B3DB79AFD4443E807BC0B8.sh
echo ""
echo Build\ all\ projects
Build all projects
** BUILD SUCCEEDED **
src $ cp -r ~/opt/bsf_v1.0.0b_osx/bin/Data build/Debug
src $ ls build/Debug build/Debug/Data
build/Debug:
Data myApp
build/Debug/Data:
Cursors Meshes Skin Timestamp.asset
GUISkin.asset ShaderDependencies.json SplashScreen.png.asset arial.ttf.asset
Icons Shaders Textures arial.ttf_8_texpage_0.asset
src $ ./build/Debug/myApp
Segmentation fault: 11
src $ rm -rf build/Debug/Data
src $ ./build/Debug/myApp
Segmentation fault: 11
src $ |
Quick and dirty trace using manually built debug binaries: src $ PATH=/usr/bin /usr/bin/lldb ./build/Debug/myApp
(lldb) target create "./build/Debug/myApp"
Current executable set to './build/Debug/myApp' (x86_64).
(lldb) run
Process 54694 launched: './build/Debug/myApp' (x86_64)
Process 54694 stopped
* thread #6, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x00007fff5230c232 libsystem_c.dylib`strlen + 18
libsystem_c.dylib`strlen:
-> 0x7fff5230c232 <+18>: pcmpeqb (%rdi), %xmm0
0x7fff5230c236 <+22>: pmovmskb %xmm0, %esi
0x7fff5230c23a <+26>: andq $0xf, %rcx
0x7fff5230c23e <+30>: orq $-0x1, %rax
Target 0: (myApp) stopped.
(lldb) |
Thanks. Could you do |
src $ PATH=/usr/bin /usr/bin/lldb ./build/Debug/myApp
(lldb) target create "./build/Debug/myApp"
Current executable set to './build/Debug/myApp' (x86_64).
(lldb) run
Process 55191 launched: './build/Debug/myApp' (x86_64)
Process 55191 stopped
* thread #6, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x00007fff5230c232 libsystem_c.dylib`strlen + 18
libsystem_c.dylib`strlen:
-> 0x7fff5230c232 <+18>: pcmpeqb (%rdi), %xmm0
0x7fff5230c236 <+22>: pmovmskb %xmm0, %esi
0x7fff5230c23a <+26>: andq $0xf, %rcx
0x7fff5230c23e <+30>: orq $-0x1, %rax
Target 0: (myApp) stopped.
(lldb) thread backtrace all
thread #1, queue = 'com.apple.main-thread'
frame #0: 0x00007fff5240ca1e libsystem_kernel.dylib`__psynch_cvwait + 10
frame #1: 0x00007fff525d5589 libsystem_pthread.dylib`_pthread_cond_wait + 732
frame #2: 0x00007fff5021dcb0 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
frame #3: 0x00000001004a7565 libbsf.dylib`bs::CoreThread::blockUntilCommandCompleted(this=0x0000000103612490, commandId=0) at BsCoreThread.cpp:285
frame #4: 0x00000001004a79a6 libbsf.dylib`bs::CoreThread::queueCommand(this=0x0000000103612490, commandCallback=0x00007ffeefbfee90, flags=(mBits = 3))>, bs::Flags<bs::CoreThreadQueueFlag, unsigned int>) at BsCoreThread.cpp:245
frame #5: 0x0000000100b773fa libbsf.dylib`bs::ct::RenderAPI::initialize(this=0x0000000103546fb0, primaryWindowDesc=0x0000000103529178) at BsRenderAPI.cpp:164
frame #6: 0x0000000100641b18 libbsf.dylib`bs::RenderAPIManager::initialize(this=0x000000010360f060, pluginFilename=0x00000001035290f8, primaryWindowDesc=0x0000000103529178) at BsRenderAPIManager.cpp:46
frame #7: 0x0000000100253ddc libbsf.dylib`bs::CoreApplication::onStartUp(this=0x00000001035290e0) at BsCoreApplication.cpp:157
frame #8: 0x000000010107c6e2 libbsf.dylib`bs::Application::onStartUp(this=0x00000001035290e0) at BsApplication.cpp:51
frame #9: 0x0000000100004131 myApp`void bs::Module<bs::CoreApplication>::startUp<bs::Application, bs::START_UP_DESC&>(args=0x00007ffeefbff5d8) at BsModule.h:92
frame #10: 0x000000010000262d myApp`void bs::Application::startUp<bs::Application>(videoMode=(mWidth = 1280, mHeight = 720, mRefreshRate = 60, mOutputIdx = 0, mIsCustom = true), title=0x00007ffeefbff758, fullscreen=false) at BsApplication.h:33
frame #11: 0x00000001000024de myApp`main at main.cpp:7
frame #12: 0x00007fff522bc015 libdyld.dylib`start + 1
frame #13: 0x00007fff522bc015 libdyld.dylib`start + 1
thread #2
frame #0: 0x00007fff5240d292 libsystem_kernel.dylib`__workq_kernreturn + 10
frame #1: 0x00007fff525d4009 libsystem_pthread.dylib`_pthread_wqthread + 1035
frame #2: 0x00007fff525d3be9 libsystem_pthread.dylib`start_wqthread + 13
thread #3
frame #0: 0x00007fff5240d292 libsystem_kernel.dylib`__workq_kernreturn + 10
frame #1: 0x00007fff525d4009 libsystem_pthread.dylib`_pthread_wqthread + 1035
frame #2: 0x00007fff525d3be9 libsystem_pthread.dylib`start_wqthread + 13
thread #4
frame #0: 0x00007fff5240d292 libsystem_kernel.dylib`__workq_kernreturn + 10
frame #1: 0x00007fff525d4009 libsystem_pthread.dylib`_pthread_wqthread + 1035
frame #2: 0x00007fff525d3be9 libsystem_pthread.dylib`start_wqthread + 13
thread #5
frame #0: 0x00007fff5240ca1e libsystem_kernel.dylib`__psynch_cvwait + 10
frame #1: 0x00007fff525d5589 libsystem_pthread.dylib`_pthread_cond_wait + 732
frame #2: 0x00007fff5021dcb0 libc++.1.dylib`std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 18
frame #3: 0x00000001015c6927 libbsf.dylib`bs::TaskScheduler::runMain(this=0x0000000103612980) at BsTaskScheduler.cpp:120
frame #4: 0x00000001015ccdc1 libbsf.dylib`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (bs::TaskScheduler::*)(), bs::TaskScheduler*>&>(std::__1::__bind<void (bs::TaskScheduler::*)(), bs::TaskScheduler*>&&&) [inlined] decltype(__f=0x0000700006008c88, __a0=0x0000700006008c98)).*fp(std::__1::forward<>(fp1))) std::__1::__invoke<void (bs::TaskScheduler::*&)(), bs::TaskScheduler*&, void>(void (bs::TaskScheduler::*&&&)(), bs::TaskScheduler*&&&) at type_traits:4264
frame #5: 0x00000001015ccd42 libbsf.dylib`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (bs::TaskScheduler::*)(), bs::TaskScheduler*>&>(std::__1::__bind<void (bs::TaskScheduler::*)(), bs::TaskScheduler*>&&&) [inlined] std::__1::__bind_return<void (bs::TaskScheduler::*)(), std::__1::tuple<bs::TaskScheduler*>, std::__1::tuple<>, __is_valid_bind_return<void (bs::TaskScheduler::*)(), std::__1::tuple<bs::TaskScheduler*>, std::__1::tuple<> >::value>::type std::__1::__apply_functor<void (__f=0x0000700006008c88, __bound_args=0x0000700006008c98, __args=0x0000700006008a50)(), std::__1::tuple<bs::TaskScheduler*>, 0ul, std::__1::tuple<> >(void (bs::TaskScheduler::*&)(), std::__1::tuple<bs::TaskScheduler*>&, std::__1::__tuple_indices<0ul>, std::__1::tuple<>&&) at functional:2224
frame #6: 0x00000001015ccd12 libbsf.dylib`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (bs::TaskScheduler::*)(), bs::TaskScheduler*>&>(std::__1::__bind<void (bs::TaskScheduler::*)(), bs::TaskScheduler*>&&&) [inlined] std::__1::__bind_return<void (bs::TaskScheduler::*)(), std::__1::tuple<bs::TaskScheduler*>, std::__1::tuple<>, __is_valid_bind_return<void (bs::TaskScheduler::*)(), std::__1::tuple<bs::TaskScheduler*>, std::__1::tuple<> >::value>::type std::__1::__bind<void (this=0x0000700006008c88)(), bs::TaskScheduler*>::operator()<>() at functional:2257
frame #7: 0x00000001015cccef libbsf.dylib`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (bs::TaskScheduler::*)(), bs::TaskScheduler*>&>(std::__1::__bind<void (bs::TaskScheduler::*)(), bs::TaskScheduler*>&&&) [inlined] decltype(__f=0x0000700006008c88)(), bs::TaskScheduler*>&>(fp)(std::__1::forward<>(fp0))) std::__1::__invoke<std::__1::__bind<void (bs::TaskScheduler::*)(), bs::TaskScheduler*>&>(std::__1::__bind<void (bs::TaskScheduler::*)(), bs::TaskScheduler*>&&&) at type_traits:4323
frame #8: 0x00000001015cccdb libbsf.dylib`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (__args=0x0000700006008c88)(), bs::TaskScheduler*>&>(std::__1::__bind<void (bs::TaskScheduler::*)(), bs::TaskScheduler*>&&&) at __functional_base:349
frame #9: 0x00000001015ccc89 libbsf.dylib`std::__1::__function::__func<std::__1::__bind<void (bs::TaskScheduler::*)(), bs::TaskScheduler*>, std::__1::allocator<std::__1::__bind<void (bs::TaskScheduler::*)(), bs::TaskScheduler*> >, void ()>::operator(this=0x0000700006008c80)() at functional:1562
frame #10: 0x0000000100273e35 libbsf.dylib`std::__1::function<void ()>::operator(this=0x0000700006008c80)() const at functional:1921
frame #11: 0x00000001015d1475 libbsf.dylib`bs::PooledThread::run(this=0x0000000103612b00) at BsThreadPool.cpp:119
frame #12: 0x00000001015d6034 libbsf.dylib`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*> > >(void*) [inlined] decltype(__f=0x000000010360dd98, __a0=0x000000010360dda8)).*fp(std::__1::forward<>(fp1))) std::__1::__invoke<void (bs::PooledThread::*&)(), bs::PooledThread*&, void>(void (bs::PooledThread::*&&&)(), bs::PooledThread*&&&) at type_traits:4264
frame #13: 0x00000001015d5fb5 libbsf.dylib`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*> > >(void*) [inlined] std::__1::__bind_return<void (bs::PooledThread::*)(), std::__1::tuple<bs::PooledThread*>, std::__1::tuple<>, __is_valid_bind_return<void (bs::PooledThread::*)(), std::__1::tuple<bs::PooledThread*>, std::__1::tuple<> >::value>::type std::__1::__apply_functor<void (__f=0x000000010360dd98, __bound_args=0x000000010360dda8, __args=0x0000700006008e30)(), std::__1::tuple<bs::PooledThread*>, 0ul, std::__1::tuple<> >(void (bs::PooledThread::*&)(), std::__1::tuple<bs::PooledThread*>&, std::__1::__tuple_indices<0ul>, std::__1::tuple<>&&) at functional:2224
frame #14: 0x00000001015d5f76 libbsf.dylib`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*> > >(void*) [inlined] std::__1::__bind_return<void (bs::PooledThread::*)(), std::__1::tuple<bs::PooledThread*>, std::__1::tuple<>, __is_valid_bind_return<void (bs::PooledThread::*)(), std::__1::tuple<bs::PooledThread*>, std::__1::tuple<> >::value>::type std::__1::__bind<void (this=0x000000010360dd98)(), bs::PooledThread*>::operator()<>() at functional:2257
frame #15: 0x00000001015d5f3e libbsf.dylib`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*> > >(void*) [inlined] decltype(__f=0x000000010360dd98)(), bs::PooledThread*> >(fp)(std::__1::forward<>(fp0))) std::__1::__invoke<std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*> >(std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*>&&) at type_traits:4323
frame #16: 0x00000001015d5f1b libbsf.dylib`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*> > >(void*) [inlined] void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*> >(__t=0x000000010360dd90)(), bs::PooledThread*> >&, std::__1::__tuple_indices<>) at thread:342
frame #17: 0x00000001015d5ee5 libbsf.dylib`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*> > >(__vp=0x000000010360dd90) at thread:352
frame #18: 0x00007fff525d4661 libsystem_pthread.dylib`_pthread_body + 340
frame #19: 0x00007fff525d450d libsystem_pthread.dylib`_pthread_start + 377
frame #20: 0x00007fff525d3bf9 libsystem_pthread.dylib`thread_start + 13
* thread #6, stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
* frame #0: 0x00007fff5230c232 libsystem_c.dylib`strlen + 18
frame #1: 0x0000000100003a15 myApp`std::__1::char_traits<char>::length(__s=0x0000000000000000) at __string:217
frame #2: 0x0000000100628c5c libbsf.dylib`std::__1::basic_string<char, std::__1::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> >::assign(this=0x000000010352ed08, __s=0x0000000000000000) at string:2165
frame #3: 0x000000010ac8f352 libbsfGLRenderAPI.dylib`bs::ct::MacOSVideoOutputInfo::MacOSVideoOutputInfo(unsigned int, unsigned int) [inlined] std::__1::basic_string<char, std::__1::char_traits<char>, bs::StdAlloc<char, bs::GenAlloc> >::operator=(this=0x000000010352ed08, __s=0x0000000000000000) at string:832
frame #4: 0x000000010ac8f346 libbsfGLRenderAPI.dylib`bs::ct::MacOSVideoOutputInfo::MacOSVideoOutputInfo(this=0x000000010352ed00, displayID=2077752445, outputIdx=0) at BsMacOSVideoModeInfo.cpp:57
frame #5: 0x000000010ac8f811 libbsfGLRenderAPI.dylib`bs::ct::MacOSVideoOutputInfo::MacOSVideoOutputInfo(this=0x000000010352ed00, displayID=2077752445, outputIdx=0) at BsMacOSVideoModeInfo.cpp:40
frame #6: 0x000000010ac8e49d libbsfGLRenderAPI.dylib`bs::ct::MacOSVideoOutputInfo* bs::bs_new<bs::ct::MacOSVideoOutputInfo, unsigned int&, unsigned int&>(args=0x000000010aabb024, args=0x000070000608a9f4) at BsMemoryAllocator.h:338
frame #7: 0x000000010ac8e094 libbsfGLRenderAPI.dylib`bs::ct::MacOSVideoModeInfo::MacOSVideoModeInfo(this=0x000000010352e6f8) at BsMacOSVideoModeInfo.cpp:27
frame #8: 0x000000010ac8f1c5 libbsfGLRenderAPI.dylib`bs::ct::MacOSVideoModeInfo::MacOSVideoModeInfo(this=0x000000010352e6f8) at BsMacOSVideoModeInfo.cpp:9
frame #9: 0x000000010ac7d42a libbsfGLRenderAPI.dylib`std::__1::shared_ptr<bs::ct::MacOSVideoModeInfo> std::__1::shared_ptr<bs::ct::MacOSVideoModeInfo>::allocate_shared<bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc> >(bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc> const&) [inlined] std::__1::__compressed_pair_elem<bs::ct::MacOSVideoModeInfo, 1, false>::__compressed_pair_elem(this=0x000000010352e6f8) at memory:2043
frame #10: 0x000000010ac7d425 libbsfGLRenderAPI.dylib`std::__1::shared_ptr<bs::ct::MacOSVideoModeInfo> std::__1::shared_ptr<bs::ct::MacOSVideoModeInfo>::allocate_shared<bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc> >(bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc> const&) [inlined] std::__1::__compressed_pair<bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc>, bs::ct::MacOSVideoModeInfo>::__compressed_pair<bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc>, true>(this=0x000000010352e6f8, __t=0x000070000608ae10) at memory:2141
frame #11: 0x000000010ac7d3fe libbsfGLRenderAPI.dylib`std::__1::shared_ptr<bs::ct::MacOSVideoModeInfo> std::__1::shared_ptr<bs::ct::MacOSVideoModeInfo>::allocate_shared<bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc> >(bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc> const&) [inlined] std::__1::__compressed_pair<bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc>, bs::ct::MacOSVideoModeInfo>::__compressed_pair<bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc>, true>(this=0x000000010352e6f8, __t=0x000070000608ae10) at memory:2141
frame #12: 0x000000010ac7d3ee libbsfGLRenderAPI.dylib`std::__1::shared_ptr<bs::ct::MacOSVideoModeInfo> std::__1::shared_ptr<bs::ct::MacOSVideoModeInfo>::allocate_shared<bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc> >(bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc> const&) [inlined] std::__1::__shared_ptr_emplace<bs::ct::MacOSVideoModeInfo, bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc> >::__shared_ptr_emplace(this=0x000000010352e6e0, __a=StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc> @ 0x000070000608ae10) at memory:3567
frame #13: 0x000000010ac7d38e libbsfGLRenderAPI.dylib`std::__1::shared_ptr<bs::ct::MacOSVideoModeInfo> std::__1::shared_ptr<bs::ct::MacOSVideoModeInfo>::allocate_shared<bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc> >(bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc> const&) [inlined] std::__1::__shared_ptr_emplace<bs::ct::MacOSVideoModeInfo, bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc> >::__shared_ptr_emplace(this=0x000000010352e6e0) at memory:3567
frame #14: 0x000000010ac7d38e libbsfGLRenderAPI.dylib`std::__1::shared_ptr<bs::ct::MacOSVideoModeInfo> std::__1::shared_ptr<bs::ct::MacOSVideoModeInfo>::allocate_shared<bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc> >(__a=0x000070000608aec0) at memory:4249
frame #15: 0x000000010ac7bdb0 libbsfGLRenderAPI.dylib`std::__1::shared_ptr<bs::ct::MacOSVideoModeInfo> bs::bs_shared_ptr_new<bs::ct::MacOSVideoModeInfo, bs::GenAlloc>() [inlined] std::__1::enable_if<!(is_array<bs::ct::MacOSVideoModeInfo>::value), std::__1::shared_ptr<bs::ct::MacOSVideoModeInfo> >::type std::__1::allocate_shared<bs::ct::MacOSVideoModeInfo, bs::StdAlloc<bs::ct::MacOSVideoModeInfo, bs::GenAlloc> >(__a=0x000070000608aec0) at memory:4612
frame #16: 0x000000010ac7bda3 libbsfGLRenderAPI.dylib`std::__1::shared_ptr<bs::ct::MacOSVideoModeInfo> bs::bs_shared_ptr_new<bs::ct::MacOSVideoModeInfo, bs::GenAlloc>() at BsStdHeaders.h:185
frame #17: 0x000000010ac7bd03 libbsfGLRenderAPI.dylib`bs::ct::MacOSGLSupport::getVideoModeInfo(this=0x000000010352e9f0) const at BsMacOSGLSupport.cpp:60
frame #18: 0x000000010abea8ca libbsfGLRenderAPI.dylib`bs::ct::GLRenderAPI::initialize(this=0x0000000103546fb0) at BsGLRenderAPI.cpp:133
frame #19: 0x0000000100b96481 libbsf.dylib`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (bs::ct::RenderAPI::*)(), bs::ct::RenderAPI*>&>(std::__1::__bind<void (bs::ct::RenderAPI::*)(), bs::ct::RenderAPI*>&&&) [inlined] decltype(__f=0x000000010403a618, __a0=0x000000010403a628)).*fp(std::__1::forward<>(fp1))) std::__1::__invoke<void (bs::ct::RenderAPI::*&)(), bs::ct::RenderAPI*&, void>(void (bs::ct::RenderAPI::*&&&)(), bs::ct::RenderAPI*&&&) at type_traits:4264
frame #20: 0x0000000100b96402 libbsf.dylib`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (bs::ct::RenderAPI::*)(), bs::ct::RenderAPI*>&>(std::__1::__bind<void (bs::ct::RenderAPI::*)(), bs::ct::RenderAPI*>&&&) [inlined] std::__1::__bind_return<void (bs::ct::RenderAPI::*)(), std::__1::tuple<bs::ct::RenderAPI*>, std::__1::tuple<>, __is_valid_bind_return<void (bs::ct::RenderAPI::*)(), std::__1::tuple<bs::ct::RenderAPI*>, std::__1::tuple<> >::value>::type std::__1::__apply_functor<void (__f=0x000000010403a618, __bound_args=0x000000010403a628, __args=0x000070000608b090)(), std::__1::tuple<bs::ct::RenderAPI*>, 0ul, std::__1::tuple<> >(void (bs::ct::RenderAPI::*&)(), std::__1::tuple<bs::ct::RenderAPI*>&, std::__1::__tuple_indices<0ul>, std::__1::tuple<>&&) at functional:2224
frame #21: 0x0000000100b963d2 libbsf.dylib`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (bs::ct::RenderAPI::*)(), bs::ct::RenderAPI*>&>(std::__1::__bind<void (bs::ct::RenderAPI::*)(), bs::ct::RenderAPI*>&&&) [inlined] std::__1::__bind_return<void (bs::ct::RenderAPI::*)(), std::__1::tuple<bs::ct::RenderAPI*>, std::__1::tuple<>, __is_valid_bind_return<void (bs::ct::RenderAPI::*)(), std::__1::tuple<bs::ct::RenderAPI*>, std::__1::tuple<> >::value>::type std::__1::__bind<void (this=0x000000010403a618)(), bs::ct::RenderAPI*>::operator()<>() at functional:2257
frame #22: 0x0000000100b963af libbsf.dylib`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (bs::ct::RenderAPI::*)(), bs::ct::RenderAPI*>&>(std::__1::__bind<void (bs::ct::RenderAPI::*)(), bs::ct::RenderAPI*>&&&) [inlined] decltype(__f=0x000000010403a618)(), bs::ct::RenderAPI*>&>(fp)(std::__1::forward<>(fp0))) std::__1::__invoke<std::__1::__bind<void (bs::ct::RenderAPI::*)(), bs::ct::RenderAPI*>&>(std::__1::__bind<void (bs::ct::RenderAPI::*)(), bs::ct::RenderAPI*>&&&) at type_traits:4323
frame #23: 0x0000000100b9639b libbsf.dylib`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (__args=0x000000010403a618)(), bs::ct::RenderAPI*>&>(std::__1::__bind<void (bs::ct::RenderAPI::*)(), bs::ct::RenderAPI*>&&&) at __functional_base:349
frame #24: 0x0000000100b96349 libbsf.dylib`std::__1::__function::__func<std::__1::__bind<void (bs::ct::RenderAPI::*)(), bs::ct::RenderAPI*>, std::__1::allocator<std::__1::__bind<void (bs::ct::RenderAPI::*)(), bs::ct::RenderAPI*> >, void ()>::operator(this=0x000000010403a610)() at functional:1562
frame #25: 0x0000000100273e35 libbsf.dylib`std::__1::function<void ()>::operator(this=0x000000010403a610)() const at functional:1921
frame #26: 0x000000010046a757 libbsf.dylib`bs::CommandQueueBase::playbackWithNotify(this=0x000000010360cde0, commands=0x0000000103607b80, notifyCallback=0x000070000608b9c0)>) at BsCommandQueue.cpp:124
frame #27: 0x00000001004a5023 libbsf.dylib`bs::CoreThread::runCoreThread(this=0x0000000103612490) at BsCoreThread.cpp:117
frame #28: 0x00000001004a9cf1 libbsf.dylib`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (bs::CoreThread::*)(), bs::CoreThread*>&>(std::__1::__bind<void (bs::CoreThread::*)(), bs::CoreThread*>&&&) [inlined] decltype(__f=0x000070000608bc88, __a0=0x000070000608bc98)).*fp(std::__1::forward<>(fp1))) std::__1::__invoke<void (bs::CoreThread::*&)(), bs::CoreThread*&, void>(void (bs::CoreThread::*&&&)(), bs::CoreThread*&&&) at type_traits:4264
frame #29: 0x00000001004a9c72 libbsf.dylib`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (bs::CoreThread::*)(), bs::CoreThread*>&>(std::__1::__bind<void (bs::CoreThread::*)(), bs::CoreThread*>&&&) [inlined] std::__1::__bind_return<void (bs::CoreThread::*)(), std::__1::tuple<bs::CoreThread*>, std::__1::tuple<>, __is_valid_bind_return<void (bs::CoreThread::*)(), std::__1::tuple<bs::CoreThread*>, std::__1::tuple<> >::value>::type std::__1::__apply_functor<void (__f=0x000070000608bc88, __bound_args=0x000070000608bc98, __args=0x000070000608ba50)(), std::__1::tuple<bs::CoreThread*>, 0ul, std::__1::tuple<> >(void (bs::CoreThread::*&)(), std::__1::tuple<bs::CoreThread*>&, std::__1::__tuple_indices<0ul>, std::__1::tuple<>&&) at functional:2224
frame #30: 0x00000001004a9c42 libbsf.dylib`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (bs::CoreThread::*)(), bs::CoreThread*>&>(std::__1::__bind<void (bs::CoreThread::*)(), bs::CoreThread*>&&&) [inlined] std::__1::__bind_return<void (bs::CoreThread::*)(), std::__1::tuple<bs::CoreThread*>, std::__1::tuple<>, __is_valid_bind_return<void (bs::CoreThread::*)(), std::__1::tuple<bs::CoreThread*>, std::__1::tuple<> >::value>::type std::__1::__bind<void (this=0x000070000608bc88)(), bs::CoreThread*>::operator()<>() at functional:2257
frame #31: 0x00000001004a9c1f libbsf.dylib`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (bs::CoreThread::*)(), bs::CoreThread*>&>(std::__1::__bind<void (bs::CoreThread::*)(), bs::CoreThread*>&&&) [inlined] decltype(__f=0x000070000608bc88)(), bs::CoreThread*>&>(fp)(std::__1::forward<>(fp0))) std::__1::__invoke<std::__1::__bind<void (bs::CoreThread::*)(), bs::CoreThread*>&>(std::__1::__bind<void (bs::CoreThread::*)(), bs::CoreThread*>&&&) at type_traits:4323
frame #32: 0x00000001004a9c0b libbsf.dylib`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (__args=0x000070000608bc88)(), bs::CoreThread*>&>(std::__1::__bind<void (bs::CoreThread::*)(), bs::CoreThread*>&&&) at __functional_base:349
frame #33: 0x00000001004a9bb9 libbsf.dylib`std::__1::__function::__func<std::__1::__bind<void (bs::CoreThread::*)(), bs::CoreThread*>, std::__1::allocator<std::__1::__bind<void (bs::CoreThread::*)(), bs::CoreThread*> >, void ()>::operator(this=0x000070000608bc80)() at functional:1562
frame #34: 0x0000000100273e35 libbsf.dylib`std::__1::function<void ()>::operator(this=0x000070000608bc80)() const at functional:1921
frame #35: 0x00000001015d1475 libbsf.dylib`bs::PooledThread::run(this=0x00000001036126b0) at BsThreadPool.cpp:119
frame #36: 0x00000001015d6034 libbsf.dylib`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*> > >(void*) [inlined] decltype(__f=0x000000010360a5d8, __a0=0x000000010360a5e8)).*fp(std::__1::forward<>(fp1))) std::__1::__invoke<void (bs::PooledThread::*&)(), bs::PooledThread*&, void>(void (bs::PooledThread::*&&&)(), bs::PooledThread*&&&) at type_traits:4264
frame #37: 0x00000001015d5fb5 libbsf.dylib`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*> > >(void*) [inlined] std::__1::__bind_return<void (bs::PooledThread::*)(), std::__1::tuple<bs::PooledThread*>, std::__1::tuple<>, __is_valid_bind_return<void (bs::PooledThread::*)(), std::__1::tuple<bs::PooledThread*>, std::__1::tuple<> >::value>::type std::__1::__apply_functor<void (__f=0x000000010360a5d8, __bound_args=0x000000010360a5e8, __args=0x000070000608be30)(), std::__1::tuple<bs::PooledThread*>, 0ul, std::__1::tuple<> >(void (bs::PooledThread::*&)(), std::__1::tuple<bs::PooledThread*>&, std::__1::__tuple_indices<0ul>, std::__1::tuple<>&&) at functional:2224
frame #38: 0x00000001015d5f76 libbsf.dylib`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*> > >(void*) [inlined] std::__1::__bind_return<void (bs::PooledThread::*)(), std::__1::tuple<bs::PooledThread*>, std::__1::tuple<>, __is_valid_bind_return<void (bs::PooledThread::*)(), std::__1::tuple<bs::PooledThread*>, std::__1::tuple<> >::value>::type std::__1::__bind<void (this=0x000000010360a5d8)(), bs::PooledThread*>::operator()<>() at functional:2257
frame #39: 0x00000001015d5f3e libbsf.dylib`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*> > >(void*) [inlined] decltype(__f=0x000000010360a5d8)(), bs::PooledThread*> >(fp)(std::__1::forward<>(fp0))) std::__1::__invoke<std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*> >(std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*>&&) at type_traits:4323
frame #40: 0x00000001015d5f1b libbsf.dylib`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*> > >(void*) [inlined] void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*> >(__t=0x000000010360a5d0)(), bs::PooledThread*> >&, std::__1::__tuple_indices<>) at thread:342
frame #41: 0x00000001015d5ee5 libbsf.dylib`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, std::__1::__bind<void (bs::PooledThread::*)(), bs::PooledThread*> > >(__vp=0x000000010360a5d0) at thread:352
frame #42: 0x00007fff525d4661 libsystem_pthread.dylib`_pthread_body + 340
frame #43: 0x00007fff525d450d libsystem_pthread.dylib`_pthread_start + 377
frame #44: 0x00007fff525d3bf9 libsystem_pthread.dylib`thread_start + 13
(lldb) |
Nice, thanks helping track it down. Seems to crash when enumerating your displays, failing to retrieve a name of a display. Might be due to OS differences (I'm still on Sierra), or just different monitors. I'll let you know when I have a fix - hopefully tomorrow. |
Nice, thanks! If I have a moment, I'll take a deeper look as well. |
I submitted a couple of fixes on master. One to resolve the problem with the crash information not printing when a segmentation fault happens. The other should resolve your particular problem. When you get a chance please verify this resolves the problem, since I cannot reproduce it myself. |
Thanks Marko, but I'm not seeing any difference. I'm up for a screen share if that seems helpful. |
Could you post the stack trace with the updated version. I'm guessing its crashing at some different location right now. |
|
The call-stack doesn't appear to have symbol information. Any chance you are linking with the release-compiled |
I hadn't merged your new commits; sorry about that. The sample app still segfaults, but now logs a crash report. Here's the standard output:
GitHub issues apparently don't support HTML attachments, but here's the full Crash Report with a .txt extension: log.html.txt |
Thanks. I think I misjudged what the original issue was. Can you please try editing the
Replace those four lines with:
(Note that I haven't tried compiling the code, there might be a minor typo to correct). I believe that should resolve your issue. Thanks for cooperating with me about this. |
Hey, I see a window! Thanks Marko; want that code in a PR? |
Happy to see it resolved! Sure, go ahead. |
FYI, I still get a crash on quitting the app. Unrelated?
|
Seems to be a separate issue. Not as obvious what is causing it though, need to explore further. |
I have submitted a potential fix for the crash on exit issue. I've also integrated the fix for the first issue. Let me know if everything looks fine now. |
Confirmed: Everything looks fine now. |
The first sample application at https://www.bsframework.io/docs/build.html seg faults in Application::startUp. This occurs on both
master
(58a47c8) andrelease-v1.0.0
(40e0d08). I'm using the exact CMake and source code from the example. The fault occurs with prebuilt binaries as well as with a manually built bsf. No CrashReports are created. I'm running macOS High Sierra, and installed ossp-uuid using HomeBrew.The text was updated successfully, but these errors were encountered: