【问题背景】
在openEuler上移植cisTEM软件后,发现运行出现了coredump,详细信息如下
#0 0x0000000000538428 in MovieGroupPickerComboPanel::FillComboBox(bool) (this=0x328fd670, include_all_movies_group=true) at gui/../core/../gui/AssetPickerComboPanel.h:73
#1 0x000000000052fff0 in MyAlignMoviesPanel::MyAlignMoviesPanel(wxWindow*) (this=0x328fa910, parent=0xfffffc947d30) at gui/AlignMoviesPanel.cpp:42
#2 0x000000000052feb0 in MyAlignMoviesPanel::MyAlignMoviesPanel(wxWindow*) (this=0x328fa910, parent=0x3251a000) at gui/AlignMoviesPanel.cpp:10
#3 0x000000000043ebf8 in MyGuiApp::OnInit() (this=0x32393ec0) at programs/projectx/projectx.cpp:123
#4 0x0000000000441cac in wxAppConsoleBase::CallOnInit() (this=0x32393ec0) at /home/yylu/cisTEM/wxWigets/wxWidgetsinstall/include/wx-3.0/wx/app.h:93
#5 0x0000ffff09050158 in wxEntry(int&, wchar_t**) (argc=<optimized out>, argv=<optimized out>) at ../src/common/init.cpp:479
#6 0x000000000043e784 in main(int, char**) (argc=1, argv=0xfffffc948928) at programs/projectx/projectx.cpp:14
【问题分析】
1、修改Makefile中的编译选项
(1)、在修改了/path/to/cisTEM/cistem-1.0.0-beta/目录下的Makefile,修改如下:
CPPFLAGS = -DNDEBUG -funroll-loops –O0 -Wall -pipe -fexpensive-optimizations -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -g
CXXFLAGS = -DNDEBUG -funroll-loops –O0 -Wall -pipe -fexpensive-optimizations -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE –g
(2)、重新make之后分析core文件gdb调试信息如下:
warning: File "/usr/lib64/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
add-auto-load-safe-path /usr/lib64/libthread_db-1.0.so
line to your configuration file "/root/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/root/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
warning: File "/usr/lib64/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
Core was generated by `./cisTEM'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000fffdffcde2dc in _Unwind_Resume () from /lib64/libgcc_s.so.1
[Current thread is 1 (LWP 2593069)]
Missing separate debuginfos, use: dnf debuginfo-install atk-2.30.0-3.ky10.aarch64 bzip2-1.0.8-3.ky10.aarch64 cairo-1.15.14-3.ky10.aarch64 dbus-libs-1.12.16-13.ky10.aarch64 expat-2.2.6-5.ky10.aarch64 fcitx-gtk2-4.2.9.1-2.p03.ky10.aarch64 fcitx-libs-4.2.9.1-2.p03.ky10.aarch64 fftw-libs-single-3.3.8-6.ky10.aarch64 fontconfig-2.13.1-3.ky10.aarch64 freetype-2.9.1-5.ky10.aarch64 fribidi-1.0.5-4.ky10.aarch64 gamin-0.1.10-37.ky10.aarch64 gdk-pixbuf2-2.38.0-9.ky10.aarch64 glib2-2.62.1-1.ky10.aarch64 glibc-2.28-36.1.ky10.aarch64 graphite2-1.3.13-2.ky10.aarch64 gtk2-2.24.32-7.p02.ky10.aarch64 gvfs-client-1.40.2-6.p02.ky10.aarch64 harfbuzz-1.8.7-2.ky10.aarch64 jbigkit-libs-2.1-17.ky10.aarch64 libICE-1.0.10-2.ky10.aarch64 libSM-1.2.3-2.ky10.aarch64 libX11-1.6.9-2.ky10.aarch64 libXau-1.0.9-2.ky10.aarch64 libXcomposite-0.4.4-17.ky10.aarch64 libXcursor-1.1.15-5.ky10.aarch64 libXdamage-1.1.4-18.ky10.aarch64 libXext-1.3.4-2.ky10.aarch64 libXfixes-5.0.3-11.ky10.aarch64 libXi-1.7.9-11.ky10.aarch64 libXinerama-1.1.4-5.ky10.aarch64 libXrandr-1.5.1-10.ky10.aarch64 libXrender-0.9.10-10.ky10.aarch64 libXxf86vm-1.1.4-13.ky10.aarch64 libblkid-2.35.2-1.p01.ky10.aarch64 libdatrie-0.2.12-1.ky10.aarch64 libffi-3.3-7.ky10.aarch64 libgcc-7.3.0-20190804.h30.ky10.aarch64 libgcrypt-1.8.3-5.ky10.aarch64 libgpg-error-1.35-3.ky10.aarch64 libjpeg-turbo-2.0.0-4.ky10.aarch64 libmount-2.35.2-1.p01.ky10.aarch64 libpng-1.6.36-4.ky10.aarch64 libsecurity1-1.0-8kord.se.ky10.aarch64 libselinux-2.9-se.05.ky10.aarch64 libstdc++-7.3.0-20190804.h30.ky10.aarch64 libthai-0.1.28-3.ky10.aarch64 libtiff-4.1.0-1.ky10.aarch64 libuuid-2.35.2-1.p01.ky10.aarch64 libxcb-1.13.1-2.ky10.aarch64 libxkbcommon-0.8.4-3.ky10.aarch64 lz4-1.9.2-2.ky10.aarch64 pango-1.43.0-3.ky10.aarch64 pcre-8.43-5.ky10.aarch64 pcre2-10.33-2.ky10.aarch64 pixman-0.38.0-1.ky10.aarch64 systemd-libs-243-31.se.p03.ky10.aarch64 xz-libs-5.2.4-10.ky10.aarch64 zlib-1.2.11-17.1.ky10.aarch64
(gdb) bt
#0 0x0000fffdffcde2dc in _Unwind_Resume () at /lib64/libgcc_s.so.1
#1 0x00000000005319a8 in MyAlignMoviesPanel::MyAlignMoviesPanel(wxWindow*) ()
#2 0x00000000004395f8 in MyGuiApp::OnInit() ()
#3 0x0000fffe00270158 in wxEntry(int&, wchar_t**) () at /home/yylu/cisTEM/wxWigets/wxWidgetsinstall/lib/libwx_baseu-3.0.so.0
#4 0x0000000000439088 in main ()
(gdb) info locals
No symbol table info available.
(gdb) Quit
(3)、从上面的gdb调试信息来看,仍然无法定位到具体core掉的代码详细信息
2、进一步修改src目录下的makefile文件
(1)、通过分析发现在src中还有一个makefile文件并未修改,/home/yylu/cisTEM/cistem-1.0.0-beta/src,修改如下标黄部分:
CPPFLAGS = -DNDEBUG -funroll-loops -O0 -Wall -pipe -fexpensive-optimizations -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -g
CXXFLAGS = -DNDEBUG -funroll-loops –O0 -Wall -pipe -fexpensive-optimizations -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE –g
(2)、重新make clean之后make,并执行make install,注意此时不要执行./configure -prefix=/path/to/cistem,会重新生成makefile文件
(3)、重新运行后出现coredump,分析core信息如下
#0 0x0000000000538428 in MovieGroupPickerComboPanel::FillComboBox(bool) (this=0x328fd670, include_all_movies_group=true) at gui/../core/../gui/AssetPickerComboPanel.h:73
#1 0x000000000052fff0 in MyAlignMoviesPanel::MyAlignMoviesPanel(wxWindow*) (this=0x328fa910, parent=0xfffffc947d30) at gui/AlignMoviesPanel.cpp:42
#2 0x000000000052feb0 in MyAlignMoviesPanel::MyAlignMoviesPanel(wxWindow*) (this=0x328fa910, parent=0x3251a000) at gui/AlignMoviesPanel.cpp:10
#3 0x000000000043ebf8 in MyGuiApp::OnInit() (this=0x32393ec0) at programs/projectx/projectx.cpp:123
#4 0x0000000000441cac in wxAppConsoleBase::CallOnInit() (this=0x32393ec0) at /home/yylu/cisTEM/wxWigets/wxWidgetsinstall/include/wx-3.0/wx/app.h:93
#5 0x0000ffff09050158 in wxEntry(int&, wchar_t**) (argc=<optimized out>, argv=<optimized out>) at ../src/common/init.cpp:479
#6 0x000000000043e784 in main(int, char**) (argc=1, argv=0xfffffc948928) at programs/projectx/projectx.cpp:14
【问题根因】
1、进一步分析代码:
通过进一步分析代码,发现AssetPickerComboPanel.h文件中函数没有return,进一步排查发现该文件中其他函数均没有返回值

2、修改代码重新编译后可以运行该程序:

3、关闭窗口出现coredump:
当用鼠标关闭该窗口时,会出现coredump信息,进一步分析是因为projectx.cpp文件中OnExit()函数没有返回值,按照如下黄色部分修改后问题解决;
int MyGuiApp::OnExit()
{
delete cistem_config;
/* main_frame->Destroy();
overview_panel->Destroy();
actions_panel->Destroy();
assets_panel->Destroy();
settings_panel->Destroy();
// Individual Panels
movie_asset_panel->Destroy();
image_asset_panel->Destroy();
align_movies_panel->Destroy();
run_profiles_panel->Destroy();*/
return true;
}
【修改方案】
修改AssetPickerComboPanel.h、projectx.cpp文件中代码,将需要有返回值的加上return,重新编译


【END】
如有疑问,欢迎评论区留言讨论~
【问题背景】
在openEuler上移植cisTEM软件后,发现运行出现了coredump,详细信息如下
#0 0x0000000000538428 in MovieGroupPickerComboPanel::FillComboBox(bool) (this=0x328fd670, include_all_movies_group=true) at gui/../core/../gui/AssetPickerComboPanel.h:73
#1 0x000000000052fff0 in MyAlignMoviesPanel::MyAlignMoviesPanel(wxWindow*) (this=0x328fa910, parent=0xfffffc947d30) at gui/AlignMoviesPanel.cpp:42
#2 0x000000000052feb0 in MyAlignMoviesPanel::MyAlignMoviesPanel(wxWindow*) (this=0x328fa910, parent=0x3251a000) at gui/AlignMoviesPanel.cpp:10
#3 0x000000000043ebf8 in MyGuiApp::OnInit() (this=0x32393ec0) at programs/projectx/projectx.cpp:123
#4 0x0000000000441cac in wxAppConsoleBase::CallOnInit() (this=0x32393ec0) at /home/yylu/cisTEM/wxWigets/wxWidgetsinstall/include/wx-3.0/wx/app.h:93
#5 0x0000ffff09050158 in wxEntry(int&, wchar_t**) (argc=<optimized out>, argv=<optimized out>) at ../src/common/init.cpp:479
#6 0x000000000043e784 in main(int, char**) (argc=1, argv=0xfffffc948928) at programs/projectx/projectx.cpp:14
【问题分析】
1、修改Makefile中的编译选项
(1)、在修改了/path/to/cisTEM/cistem-1.0.0-beta/目录下的Makefile,修改如下:
CPPFLAGS = -DNDEBUG -funroll-loops –O0 -Wall -pipe -fexpensive-optimizations -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -g
CXXFLAGS = -DNDEBUG -funroll-loops –O0 -Wall -pipe -fexpensive-optimizations -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE –g
(2)、重新make之后分析core文件gdb调试信息如下:
warning: File "/usr/lib64/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
add-auto-load-safe-path /usr/lib64/libthread_db-1.0.so
line to your configuration file "/root/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/root/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
warning: File "/usr/lib64/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
Core was generated by `./cisTEM'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000fffdffcde2dc in _Unwind_Resume () from /lib64/libgcc_s.so.1
[Current thread is 1 (LWP 2593069)]
Missing separate debuginfos, use: dnf debuginfo-install atk-2.30.0-3.ky10.aarch64 bzip2-1.0.8-3.ky10.aarch64 cairo-1.15.14-3.ky10.aarch64 dbus-libs-1.12.16-13.ky10.aarch64 expat-2.2.6-5.ky10.aarch64 fcitx-gtk2-4.2.9.1-2.p03.ky10.aarch64 fcitx-libs-4.2.9.1-2.p03.ky10.aarch64 fftw-libs-single-3.3.8-6.ky10.aarch64 fontconfig-2.13.1-3.ky10.aarch64 freetype-2.9.1-5.ky10.aarch64 fribidi-1.0.5-4.ky10.aarch64 gamin-0.1.10-37.ky10.aarch64 gdk-pixbuf2-2.38.0-9.ky10.aarch64 glib2-2.62.1-1.ky10.aarch64 glibc-2.28-36.1.ky10.aarch64 graphite2-1.3.13-2.ky10.aarch64 gtk2-2.24.32-7.p02.ky10.aarch64 gvfs-client-1.40.2-6.p02.ky10.aarch64 harfbuzz-1.8.7-2.ky10.aarch64 jbigkit-libs-2.1-17.ky10.aarch64 libICE-1.0.10-2.ky10.aarch64 libSM-1.2.3-2.ky10.aarch64 libX11-1.6.9-2.ky10.aarch64 libXau-1.0.9-2.ky10.aarch64 libXcomposite-0.4.4-17.ky10.aarch64 libXcursor-1.1.15-5.ky10.aarch64 libXdamage-1.1.4-18.ky10.aarch64 libXext-1.3.4-2.ky10.aarch64 libXfixes-5.0.3-11.ky10.aarch64 libXi-1.7.9-11.ky10.aarch64 libXinerama-1.1.4-5.ky10.aarch64 libXrandr-1.5.1-10.ky10.aarch64 libXrender-0.9.10-10.ky10.aarch64 libXxf86vm-1.1.4-13.ky10.aarch64 libblkid-2.35.2-1.p01.ky10.aarch64 libdatrie-0.2.12-1.ky10.aarch64 libffi-3.3-7.ky10.aarch64 libgcc-7.3.0-20190804.h30.ky10.aarch64 libgcrypt-1.8.3-5.ky10.aarch64 libgpg-error-1.35-3.ky10.aarch64 libjpeg-turbo-2.0.0-4.ky10.aarch64 libmount-2.35.2-1.p01.ky10.aarch64 libpng-1.6.36-4.ky10.aarch64 libsecurity1-1.0-8kord.se.ky10.aarch64 libselinux-2.9-se.05.ky10.aarch64 libstdc++-7.3.0-20190804.h30.ky10.aarch64 libthai-0.1.28-3.ky10.aarch64 libtiff-4.1.0-1.ky10.aarch64 libuuid-2.35.2-1.p01.ky10.aarch64 libxcb-1.13.1-2.ky10.aarch64 libxkbcommon-0.8.4-3.ky10.aarch64 lz4-1.9.2-2.ky10.aarch64 pango-1.43.0-3.ky10.aarch64 pcre-8.43-5.ky10.aarch64 pcre2-10.33-2.ky10.aarch64 pixman-0.38.0-1.ky10.aarch64 systemd-libs-243-31.se.p03.ky10.aarch64 xz-libs-5.2.4-10.ky10.aarch64 zlib-1.2.11-17.1.ky10.aarch64
(gdb) bt
#0 0x0000fffdffcde2dc in _Unwind_Resume () at /lib64/libgcc_s.so.1
#1 0x00000000005319a8 in MyAlignMoviesPanel::MyAlignMoviesPanel(wxWindow*) ()
#2 0x00000000004395f8 in MyGuiApp::OnInit() ()
#3 0x0000fffe00270158 in wxEntry(int&, wchar_t**) () at /home/yylu/cisTEM/wxWigets/wxWidgetsinstall/lib/libwx_baseu-3.0.so.0
#4 0x0000000000439088 in main ()
(gdb) info locals
No symbol table info available.
(gdb) Quit
(3)、从上面的gdb调试信息来看,仍然无法定位到具体core掉的代码详细信息
2、进一步修改src目录下的makefile文件
(1)、通过分析发现在src中还有一个makefile文件并未修改,/home/yylu/cisTEM/cistem-1.0.0-beta/src,修改如下标黄部分:
CPPFLAGS = -DNDEBUG -funroll-loops -O0 -Wall -pipe -fexpensive-optimizations -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -g
CXXFLAGS = -DNDEBUG -funroll-loops –O0 -Wall -pipe -fexpensive-optimizations -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE –g
(2)、重新make clean之后make,并执行make install,注意此时不要执行./configure -prefix=/path/to/cistem,会重新生成makefile文件
(3)、重新运行后出现coredump,分析core信息如下
#0 0x0000000000538428 in MovieGroupPickerComboPanel::FillComboBox(bool) (this=0x328fd670, include_all_movies_group=true) at gui/../core/../gui/AssetPickerComboPanel.h:73
#1 0x000000000052fff0 in MyAlignMoviesPanel::MyAlignMoviesPanel(wxWindow*) (this=0x328fa910, parent=0xfffffc947d30) at gui/AlignMoviesPanel.cpp:42
#2 0x000000000052feb0 in MyAlignMoviesPanel::MyAlignMoviesPanel(wxWindow*) (this=0x328fa910, parent=0x3251a000) at gui/AlignMoviesPanel.cpp:10
#3 0x000000000043ebf8 in MyGuiApp::OnInit() (this=0x32393ec0) at programs/projectx/projectx.cpp:123
#4 0x0000000000441cac in wxAppConsoleBase::CallOnInit() (this=0x32393ec0) at /home/yylu/cisTEM/wxWigets/wxWidgetsinstall/include/wx-3.0/wx/app.h:93
#5 0x0000ffff09050158 in wxEntry(int&, wchar_t**) (argc=<optimized out>, argv=<optimized out>) at ../src/common/init.cpp:479
#6 0x000000000043e784 in main(int, char**) (argc=1, argv=0xfffffc948928) at programs/projectx/projectx.cpp:14
【问题根因】
1、进一步分析代码:
通过进一步分析代码,发现AssetPickerComboPanel.h文件中函数没有return,进一步排查发现该文件中其他函数均没有返回值
2、修改代码重新编译后可以运行该程序:
3、关闭窗口出现coredump:
当用鼠标关闭该窗口时,会出现coredump信息,进一步分析是因为projectx.cpp文件中OnExit()函数没有返回值,按照如下黄色部分修改后问题解决;
int MyGuiApp::OnExit()
{
delete cistem_config;
/* main_frame->Destroy();
overview_panel->Destroy();
actions_panel->Destroy();
assets_panel->Destroy();
settings_panel->Destroy();
// Individual Panels
movie_asset_panel->Destroy();
image_asset_panel->Destroy();
align_movies_panel->Destroy();
run_profiles_panel->Destroy();*/
return true;
}
【修改方案】
修改AssetPickerComboPanel.h、projectx.cpp文件中代码,将需要有返回值的加上return,重新编译
【END】
如有疑问,欢迎评论区留言讨论~