Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Crash when indexing Code::Blocks project #1109

Closed
wmww opened this issue Nov 12, 2020 · 1 comment · Fixed by #1110
Closed

Crash when indexing Code::Blocks project #1109

wmww opened this issue Nov 12, 2020 · 1 comment · Fixed by #1110

Comments

@wmww
Copy link
Contributor

wmww commented Nov 12, 2020

When I try to index a Code::Blocks project I get the following crash. Observed on Linux with both the Sourcetrail 2020.2.43 AppImage and current master. I can upload a tarball of the whole project on request.

GDB output
(gdb) r
Starting program: /home/wmww/code/utils/Sourcetrail/build/app/Sourcetrail 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
QCoreApplication::applicationDirPath: Please instantiate the QApplication object first
ERROR: Please run Sourcetrail via the Sourcetrail.sh script!
[New Thread 0x7fffebb6b700 (LWP 678556)]
qt5ct: using qt5ct plugin
09:19:44 | LogManager.cpp:35 setLoggingEnabled() | INFO: Enabled logging for Sourcetrail 64 bit, version 2020.2.65
09:19:44 | SharedMemoryGarbageCollector.cpp:59 run() | INFO: start shared memory garbage collection
[New Thread 0x7fffeaea1700 (LWP 678557)]
[New Thread 0x7fffe94dc700 (LWP 678558)]
qt5ct: D-Bus global menu: no
[New Thread 0x7fffe8b69700 (LWP 678559)]
[New Thread 0x7fffda981700 (LWP 678560)]
[New Thread 0x7fffda180700 (LWP 678561)]
[New Thread 0x7fffd997f700 (LWP 678562)]
[New Thread 0x7fffd917e700 (LWP 678563)]
[New Thread 0x7fffd897d700 (LWP 678564)]
[New Thread 0x7fffcbfff700 (LWP 678565)]
09:19:44 | INFO: send MessageStatus Starting Sourcetrail 64 bit, version 2020.2.65
09:19:44 | ApplicationSettingsPrefiller.cpp:31 prefillJavaRuntimePath() | INFO: Prefilling Java path
09:19:44 | StatusBarController.cpp:87 setStatus() | INFO: STATUS Starting Sourcetrail 64 bit, version 2020.2.65
09:19:44 | INFO: send MessageStatus Load settings: /home/wmww/.config/sourcetrail/ApplicationSettings.xml
09:19:44 | utilityQt.cpp:66 loadFontsFromDirectory() | INFO: Loaded FontFamily: Source Code Pro
09:19:44 | utilityQt.cpp:66 loadFontsFromDirectory() | INFO: Loaded FontFamily: Source Code Pro
09:19:44 | utilityQt.cpp:66 loadFontsFromDirectory() | INFO: Loaded FontFamily: Fira Sans
09:19:44 | utilityQt.cpp:66 loadFontsFromDirectory() | INFO: Loaded FontFamily: Source Code Pro
09:19:44 | utilityQt.cpp:66 loadFontsFromDirectory() | INFO: Loaded FontFamily: Fira Sans
09:19:44 | utilityQt.cpp:66 loadFontsFromDirectory() | INFO: Loaded FontFamily: Roboto
09:19:44 | utilityQt.cpp:66 loadFontsFromDirectory() | INFO: Loaded FontFamily: Roboto
qt5ct: custom style sheet is disabled
09:19:44 | StatusBarController.cpp:87 setStatus() | INFO: STATUS Load settings: /home/wmww/.config/sourcetrail/ApplicationSettings.xml
09:19:44 | INFO: send MessageStatus Enabled console and file logging.
09:19:44 | StatusBarController.cpp:87 setStatus() | INFO: STATUS Enabled console and file logging.
09:19:44 | INFO: send MessagePingReceived 
09:19:44 | INFO: send MessageStatus Ran Java runtime path detection, no path found.
09:19:44 | StatusBarController.cpp:87 setStatus() | INFO: STATUS Ran Java runtime path detection, no path found.
09:19:44 | INFO: send MessageLoadProject , settingsChanged: false, refreshMode: 0
libpng warning: iCCP: known incorrect sRGB profile
09:19:45 | INFO: send MessageWindowFocus 
09:19:45 | INFO: send MessagePingReceived 
09:19:46 | INFO: send MessageLoadProject /home/wmww/code/esoteric/Brainfuck/cpp_brainfuck.srctrlprj, settingsChanged: false, refreshMode: 0
09:19:46 | INFO: send MessageStatus Loading Project: /home/wmww/code/esoteric/Brainfuck/cpp_brainfuck.srctrlprj - loading
09:19:46 | StatusBarController.cpp:87 setStatus() | INFO: STATUS Loading Project: /home/wmww/code/esoteric/Brainfuck/cpp_brainfuck.srctrlprj
09:19:47 | Project.cpp:155 load() | INFO: Discarding temporary indexing data on user's decision
09:19:47 | INFO: send MessageStatus Project could not load any symbols because the index database is empty. Please re-index the project.
09:19:47 | StatusBarController.cpp:87 setStatus() | INFO: STATUS Project could not load any symbols because the index database is empty. Please re-index the project.
09:19:47 | INFO: send MessageRefresh 
09:19:48 | INFO: send MessageStatus Preparing Indexing - loading
09:19:48 | StatusBarController.cpp:87 setStatus() | INFO: STATUS Preparing Indexing
09:19:48 | INFO: send MessageErrorCountClear 
09:19:48 | INFO: send MessageStatus Preparing Indexing: Setting up Indexers - loading
09:19:48 | StatusBarController.cpp:87 setStatus() | INFO: STATUS Preparing Indexing: Setting up Indexers
09:19:48 | INFO: send MessageIndexingStatus 

Thread 9 "Sourcetrail" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd917e700 (LWP 678563)]
0x0000555555645324 in std::vector<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::allocator<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >::size (this=0x18) at /usr/include/c++/9/bits/stl_vector.h:916
916	      { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }
(gdb) bt
#0  0x0000555555645324 in std::vector<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::allocator<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >::size (this=0x18) at /usr/include/c++/9/bits/stl_vector.h:916
#1  0x00005555559197ca in utility::convert<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, FilePath> (
    sourceContainer=<error reading variable: Cannot access memory at address 0x20>) at /home/wmww/code/utils/Sourcetrail/src/lib/utility/utility.h:303
#2  0x00005555559166d8 in Codeblocks::Project::<lambda(const wstring&)>::operator()(const std::wstring &) const (__closure=0x7fffb824f450, targetName=L"transpile")
    at /home/wmww/code/utils/Sourcetrail/src/lib_cxx/utility/codeblocks/CodeblocksProject.cpp:237
#3  0x00005555559183d9 in std::_Function_handler<std::vector<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::allocator<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >(const std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >&), Codeblocks::Project::getIndexerCommands(std::shared_ptr<const SourceGroupSettingsCxxCodeblocks>, std::shared_ptr<const ApplicationSettings>) const::<lambda(const wstring&)> >::_M_invoke(const std::_Any_data &, const std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > &) (__functor=..., __args#0=L"transpile") at /usr/include/c++/9/bits/std_function.h:286
#4  0x000055555591b122 in std::function<std::vector<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::allocator<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > (std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&)>::operator()(std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&) const (this=0x7fffd917d370, __args#0=L"transpile") at /usr/include/c++/9/bits/std_function.h:688
#5  0x0000555555919b2d in OrderedCache<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::vector<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::allocator<std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > > >::getValue (this=0x7fffd917d370, key=L"transpile")
    at /home/wmww/code/utils/Sourcetrail/src/lib/utility/OrderedCache.h:38
#6  0x0000555555917386 in Codeblocks::Project::getIndexerCommands (this=0x7fffb8248080, sourceGroupSettings=std::shared_ptr<const SourceGroupSettingsCxxCodeblocks> (use count 2, weak count 0) = {...}, 
    appSettings=std::shared_ptr<const ApplicationSettings> (use count 2, weak count 0) = {...}) at /home/wmww/code/utils/Sourcetrail/src/lib_cxx/utility/codeblocks/CodeblocksProject.cpp:309
#7  0x00005555559027e5 in SourceGroupCxxCodeblocks::getIndexerCommandProvider (this=0x7fffb8001160, info=...) at /home/wmww/code/utils/Sourcetrail/src/lib_cxx/project/SourceGroupCxxCodeblocks.cpp:75
#8  0x0000555555b427e0 in Project::buildIndex (this=0x7fffb80028e0, info=..., dialogView=std::shared_ptr<DialogView> (use count 4, weak count 0) = {...})
    at /home/wmww/code/utils/Sourcetrail/src/lib/project/Project.cpp:595
#9  0x0000555555b400dc in Project::<lambda(const RefreshInfo&)>::operator()(const RefreshInfo &) const (__closure=0x55555699d2e0, info=...) at /home/wmww/code/utils/Sourcetrail/src/lib/project/Project.cpp:420
#10 0x0000555555b469d7 in std::_Function_handler<void(const RefreshInfo&), Project::refresh(std::shared_ptr<DialogView>, RefreshMode, bool)::<lambda(const RefreshInfo&)> >::_M_invoke(const std::_Any_data &, const RefreshInfo &) (__functor=..., __args#0=...) at /usr/include/c++/9/bits/std_function.h:300
#11 0x00005555557f3c0b in std::function<void (RefreshInfo const&)>::operator()(RefreshInfo const&) const (this=0x5555570e2f70, __args#0=...) at /usr/include/c++/9/bits/std_function.h:688
#12 0x00005555557e9bd8 in QtDialogView::<lambda()>::<lambda(RefreshMode)>::<lambda()>::operator()(void) const (__closure=0x5555570e2f70)
    at /home/wmww/code/utils/Sourcetrail/src/lib_gui/qt/view/QtDialogView.cpp:184
#13 0x00005555557f229d in std::_Function_handler<void(), QtDialogView::startIndexingDialog(Project*, const std::vector<RefreshMode>&, RefreshMode, bool, bool, std::function<void(const RefreshInfo&)>, std::function<void()>)::<lambda()>::<lambda(RefreshMode)>::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...) at /usr/include/c++/9/bits/std_function.h:300
#14 0x000055555565b878 in std::function<void ()>::operator()() const (this=0x55555713fdd0) at /usr/include/c++/9/bits/std_function.h:688
#15 0x0000555555c8a3dc in TaskLambda::doUpdate (this=0x55555713fdc0, blackboard=std::shared_ptr<Blackboard> (use count 4, weak count 0) = {...})
    at /home/wmww/code/utils/Sourcetrail/src/lib/utility/scheduling/TaskLambda.cpp:9
#16 0x0000555555c81ce3 in Task::update (this=0x55555713fdc0, blackboard=std::shared_ptr<Blackboard> (use count 4, weak count 0) = {...})
    at /home/wmww/code/utils/Sourcetrail/src/lib/utility/scheduling/Task.cpp:29
#17 0x0000555555c8c814 in TaskRunner::update (this=0x55555699db10, blackboard=std::shared_ptr<Blackboard> (use count 4, weak count 0) = {...})
    at /home/wmww/code/utils/Sourcetrail/src/lib/utility/scheduling/TaskRunner.cpp:41
#18 0x0000555555c8c63b in TaskRunner::update (this=0x55555699db10, schedulerId=1) at /home/wmww/code/utils/Sourcetrail/src/lib/utility/scheduling/TaskRunner.cpp:18
#19 0x0000555555c8fc05 in TaskScheduler::processTasks (this=0x555556692280) at /home/wmww/code/utils/Sourcetrail/src/lib/utility/scheduling/TaskScheduler.cpp:158
#20 0x0000555555c8f504 in TaskScheduler::startSchedulerLoop (this=0x555556692280) at /home/wmww/code/utils/Sourcetrail/src/lib/utility/scheduling/TaskScheduler.cpp:66
#21 0x0000555555c93294 in std::__invoke_impl<void, void (TaskScheduler::*)(), TaskScheduler*> (
    __f=@0x555556f00210: (void (TaskScheduler::*)(TaskScheduler * const)) 0x555555c8f354 <TaskScheduler::startSchedulerLoop()>, __t=@0x555556f00208: 0x555556692280) at /usr/include/c++/9/bits/invoke.h:73
#22 0x0000555555c931c2 in std::__invoke<void (TaskScheduler::*)(), TaskScheduler*> (__fn=@0x555556f00210: (void (TaskScheduler::*)(TaskScheduler * const)) 0x555555c8f354 <TaskScheduler::startSchedulerLoop()>)
    at /usr/include/c++/9/bits/invoke.h:95
#23 0x0000555555c93121 in std::thread::_Invoker<std::tuple<void (TaskScheduler::*)(), TaskScheduler*> >::_M_invoke<0ul, 1ul> (this=0x555556f00208) at /usr/include/c++/9/thread:244
#24 0x0000555555c930d8 in std::thread::_Invoker<std::tuple<void (TaskScheduler::*)(), TaskScheduler*> >::operator() (this=0x555556f00208) at /usr/include/c++/9/thread:251
#25 0x0000555555c930b8 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (TaskScheduler::*)(), TaskScheduler*> > >::_M_run (this=0x555556f00200) at /usr/include/c++/9/thread:195
#26 0x00007fffef929d84 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#27 0x00007fffefa3d609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#28 0x00007fffef617293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
(gdb) 
@wmww
Copy link
Contributor Author

wmww commented Nov 12, 2020

Looks like target->getCompiler() is returning null but not being checked.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant