Segfault upon cisTEM initialization

9 posts / 0 new
Last post
ianliu
ianliu's picture
Segfault upon cisTEM initialization

I have successfully compiled cisTEM with wxWidgets 3.0.5, but I'm getting a segmentation fault upon initialization. Here is the stacktrace:

#0  0x00000000005b5862 in MyAlignMoviesPanel::OnUpdateUI(wxUpdateUIEvent&) (this=0x1b95850, event=...) at gui/AlignMoviesPanel.cpp:389
#1  0x00000000019fda30 in  ()
#2  0x00000000005b5c06 in MyAlignMoviesPanel::MyAlignMoviesPanel(wxWindow*) (this=0x19fd4a0, parent=<optimized out>) at gui/AlignMoviesPanel.cpp:21
#3  0x00000000004ddeaa in MyGuiApp::OnInit() (this=<optimized out>) at programs/projectx/projectx.cpp:123
#4  0x00000000008a69cc in wxEntry(int&, wchar_t**) ()
#5  0x00000000004b8108 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at programs/projectx/projectx.cpp:14

Here is the configure line I have used:

LIBS='-lexpat' CPPFLAGS='-g3 -O0' ./configure \
  --prefix /opt/ohpc/pub/apps/cistem-1.0.0-beta-compiled/ \
  --with-fftw-dir=$FFTW_DIR \
  --with-wx-config=/opt/ohpc/pub/apps/wxWidgets-3.0.5/bin/wx-config

I've compiled my own static version of wxWidgets, and I can confirm that wxWidgets works by compiling/running sample programs.

Any hints why I'm getting this segfault?

Thanks!

timgrant
Hi,

Hi,

The 1.0.0-beta version is only tested with wxWidgets 3.0.2 compiled against GTK2, and this may make a difference as some important changes happened in 3.0.3. I actually thought there was a check to only allow compilation with 3.0.2, so it's good to know it let you compile with 3.0.5.

Is there a reason that you want to compile yourself?  The precompiled binaries will likely be much faster, as they are compiled using the intel MKL.  

Thanks,

Tim

ianliu
ianliu's picture
Dear timgrant,

Dear timgrant,

I've relaxed the configure.ac condition to allow compilation with 3.0.5. I thought it would work because it is a micro version bump. I will try compiling with 3.0.2 then.

The reason I'm trying to compile is because I'm getting a lot of coredumps when running some programs, but the coredumps have no debugging information.

timgrant
Unfortunately, the released

Unfortunately, the released version of cisTEM produces too many core dumps, in many cases  it does this when there is no true error, it's just that abort() was used instead of exit() in a number of places.  This is fixed in the development version, and so will be fixed in the next release.

If there are specific problems you'd like to investigate, I can send you a version compiled with debug symbols?  I am also happy to help investiage them.

Thanks,

Tim

 

ianliu
ianliu's picture
> This is fixed in the

> This is fixed in the development version, and so will be fixed in the next release.

Good to know! I was wondering, where can I find the repository of cisTEM? I've searched the website but couldn't find any link.

> If there are specific problems you'd like to investigate, I can send you a version compiled with debug symbols?  I am also happy to help investiage them.

I'm not very acquainted with EM; I'm a developer hired at CNPEM helping some researchers with these problems. So, ideally, I would like to compile from sources and maybe contribute to the software. A binary with debug information would be nice, but then I wouldn't be able to fiddle with the code :P

FYI, I've compiled WX 3.0.2 with the following configure line, but got the same segfault as before. Interestingly enough, wx-config --version reported as version 3.0.1; I think there's a bug in the version number of that release.

./configure --enable-monolithic --disable-shared --with-gtk=2 --prefix /opt/ohpc/pub/apps/wx-3.0.2
ianliu
ianliu's picture
I'm debugging the program

I'm debugging the program initialization, and here is a more detailed backtrace:

#0  0x00000000005b510c in MyAlignMoviesPanel::OnUpdateUI(wxUpdateUIEvent&) (this=0x2aaaaf80c1c0 <_IO_2_1_stderr_>, event=...)
    at gui/AlignMoviesPanel.cpp:397
#1  0x0000000001409440 in _ZSt4cerr@@GLIBCXX_3.4 ()
#2  0x00000000018f3260 in  ()
#3  0x0000000001409440 in _ZSt4cerr@@GLIBCXX_3.4 ()
#4  0x00000000005b546c in MyAlignMoviesPanel::MyAlignMoviesPanel(wxWindow*) (this=0x18f3260, parent=<optimized out>)
    at gui/AlignMoviesPanel.cpp:24
#5  0x00000000004dd132 in MyGuiApp::OnInit() (this=<optimized out>) at programs/projectx/projectx.cpp:123
#6  0x00000000008a6d9c in wxEntry(int&, wchar_t**) (this=<optimized out>) at ./include/wx/app.h:93
#7  0x00000000008a6d9c in wxEntry(int&, wchar_t**) (argc=@0x1410970: 1, argv=<optimized out>) at ./src/common/init.cpp:479
#8  0x00000000008a77c0 in wxEntry(int&, char**) (argc=argc@entry=@0x7fffffffbefc: 1, argv=<optimized out>) at ./src/common/init.cpp:507
#9  0x00000000004b6f68 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at programs/projectx/projectx.cpp:14

Notice that the line numbers might have changed compared with the original source code, because I've added some debugging lines. Nonetheless, check how the this pointer changed from 0x18f3260 on stack frame #4 to 0x2aaaaf80c1c0 on stack frame #0. I don't know why this is happening, and I also don't know why the MyAlignMoviesPanel::OnUpdateUI method is being called after MyAlignMoviesPanel::FillGroupComboBox returns.

Do you have any hints?

Thanks

ianliu
ianliu's picture
I also forgot to mention that

I also forgot to mention that the segfault is happening because RunProfileComboBox is null, and MyAlignMoviesPanel::OnUpdateUI is trying to dereference it like so: RunProfileComboBox->Enable(false). But RunProfileComboBox is null because the this pointer is being corrupted somehow.

timgrant
Is this happening when you

Is this happening when you open cisTEM, or when you load a project?

Thanks,

Tim

timgrant
This sounds like a memory

This sounds like a memory leak somewhere else must be corrupting the pointer, RunProfileComboBox should never be NULL..

Tim

Log in or register to post comments