11418 (WX python related?) crash

Hi,

I recently installed from scratch the HEAD release from svn. I followed the instructions in the Makefile.CP2 file and http://cellprofiler.org/wiki/index.php/CP2.0_on_Linux, and everything seems to have gone smoothly (apart from updating a few of the release numbers of the dependencies, some versions of which are no longer available from their suggested sources). Yet once installed, I experience a crash every time I load a pipeline and try to configure any of the modules within.

Here are some of the error messages I get upon loading the pipeline:

[code]global name ‘M_SERIES’ is not defined
File “/usr/cp2/CellProfiler/cellprofiler/gui/pipelinecontroller.py”, line 234, in do_load_pipeline
self.__pipeline.load(pathname)

File “/usr/cp2/CellProfiler/cellprofiler/pipeline.py”, line 538, in load
self.loadtxt(fd)

File “/usr/cp2/CellProfiler/cellprofiler/pipeline.py”, line 771, in loadtxt
self.notify_listeners(PipelineLoadedEvent())

File “/usr/cp2/CellProfiler/cellprofiler/pipeline.py”, line 1770, in notify_listeners
listener(self,event)

File “/usr/cp2/CellProfiler/cellprofiler/gui/pipelinelistview.py”, line 223, in notify
self.__on_pipeline_loaded(pipeline,event)

File “/usr/cp2/CellProfiler/cellprofiler/gui/pipelinelistview.py”, line 480, in __on_pipeline_loaded
self.select_one_module(1)

File “/usr/cp2/CellProfiler/cellprofiler/gui/pipelinelistview.py”, line 252, in select_one_module
self.__on_item_selected(None)

File “/usr/cp2/CellProfiler/cellprofiler/gui/pipelinelistview.py”, line 583, in __on_item_selected
self.__module_view.set_selection(selections[0].module_num)

File “/usr/cp2/CellProfiler/cellprofiler/gui/moduleview.py”, line 451, in set_selection
self.validate_module()

File “/usr/cp2/CellProfiler/cellprofiler/gui/moduleview.py”, line 1578, in validate_module
self.__module.test_valid(self.__pipeline)

File “/usr/cp2/CellProfiler/cellprofiler/cpmodule.py”, line 304, in test_valid
self.visible_settings()[0])

File “/usr/cp2/CellProfiler/cellprofiler/modules/loadimages.py”, line 887, in visible_settings
choices.update([M_Z, M_T, M_SERIES])[/code]

Here’s some debugging output from the terminal:

code: Gtk-CRITICAL : gtk_range_set_range: assertion `min < max’ failed
INFO:root:Subversion revision: 11418
Subversion revision: 11418
ERROR:cellprofiler.gui.moduleview:WX internal error detected
Traceback (most recent call last):
File “/usr/cp2/CellProfiler/cellprofiler/gui/moduleview.py”, line 1732, in CalcMin
if self.get_item(col,j) is not None])
File “/usr/cp2/CellProfiler/cellprofiler/gui/moduleview.py”, line 1688, in get_item
return self.__items[j]

IndexError: list index out of range
WX internal error detected
Traceback (most recent call last):
File “/usr/cp2/CellProfiler/cellprofiler/gui/moduleview.py”, line 1732, in CalcMin
if self.get_item(col,j) is not None])
File “/usr/cp2/CellProfiler/cellprofiler/gui/moduleview.py”, line 1688, in get_item
return self.__items[j]

IndexError: list index out of range

A fatal error has been detected by the Java Runtime Environment:

SIGSEGV (0xb) at pc=0x00007fba18c01756, pid=23325, tid=140437446690560

JRE version: 6.0_20-b20

Java VM: OpenJDK 64-Bit Server VM (19.0-b09 mixed mode linux-amd64 compressed oops)

Derivative: IcedTea6 1.9.8

Distribution: Red Hat Enterprise Linux Server release 6.1 (Santiago), package rhel-1.39.1.9.8.el6_1-x86_64

Problematic frame:

C [core.so+0x70756] _ZN9wxPySizer7CalcMinEv+0xc6

[/code]

Any tips on how I should proceed?

Thanks a lot,

Lee.**

There’s more debugging output produced from a post-mortem core dump from the java vm. It’s a bit large, so I’ve not posted it here. Please let me know if I can send it to you by some other way.

Thanks,

Lee.

Hi Lee,

I’m afraid that usually the crash reports are not very helpful, because the JVM
crash handler jumps in. So its probably better if you start in a debugger, or post
more details what exactly you did before the crash happens.

To use a debugger, just call python with gdb in front:

gdb python CellProfiler.py

should do the job.

And post more details, did you only load a pipeline or also process some images?
Which module is the last working one? Can you see the GUI and progress stepwise?

Cheers!

Sorry about seeing this so late. Java is intercepting the segfault, but the segfault is caused by WX. There’s a grid sizer in WX that we use. I think there may be a bug where the code in moduleview tries to get an item from the grid that’s not there. In Windows, it fails as gracefully as would be possible, throwing an exception. Mac and apparently Linux are not as generous and segfault.

Do you have the pipeline for this? Or does it happen on every pipeline? Unfortunately, I’m going to be gone for a couple of weeks, back at the start of September. I can look at it then. I have made changes recently, you might try a version prior to my most recent moduleview changes.

–Lee

Hi Mario,

I’ll try stepping through in gdb, thanks for the tip.

The crash happens as follows:

  1. I start cell profiler python CellProfiler.py
  2. I select Load Pipeline from the File menu
  3. I see a series of errors pop-up in a new window (posted in my original message in this thread), however the pipeline seems to load, as the ordered list of modules appears in the left frame that lists them. I should note here that the icons for the modules do not load properly.
  4. Upon clicking on one of these modules in the list (any one, I’ve tried several always with the same result), the program crashes, producing the output I posted in the second code box in my first post to this thread.

So no images are actually processed. That’s why I suspect this to be a WXpython related error.

I also ran the suite of unit tests, which produced a rather lengthy xml file summarizing the test results in xunit format. I’ve posted it at http://www.cs.toronto.edu/~zamparo/tests-report.xml

Thanks for all your help,

Lee.

[quote=“emmenlau”]Hi Lee,

I’m afraid that usually the crash reports are not very helpful, because the JVM
crash handler jumps in. So its probably better if you start in a debugger, or post
more details what exactly you did before the crash happens.

To use a debugger, just call python with gdb in front:

gdb python CellProfiler.py

should do the job.

And post more details, did you only load a pipeline or also process some images?
Which module is the last working one? Can you see the GUI and progress stepwise?

Cheers![/quote]

Hi Lee,

I agree, that’s consistent with the error message produced in the terminal (which I posted in the 1st message in this thread) upon exiting from the crash.

It happens with each pipeline I’ve used for testing. In the time you’re away, I’ll try to find a version that predates your most recent moduleview changes, but that includes the bug fixes to bioformats so that FLEX files can be read. Can you suggest a version range?

Thanks,

Lee.

The latest moduleview changes occured with r11403. The Bio-Formats changes to fix the flex issue occurred on r10913 (per this post).
-Mark

Thanks Mark.

[quote=“mbray”]The latest moduleview changes occured with r11403. The Bio-Formats changes to fix the flex issue occurred on r10913 (per this post).
-Mark[/quote]

I’ve downgraded the CellProfiler/cellprofiler/gui files to revision 11395 (via cd CellProfiler/cellprofiler/gui; svn -r 11395; cd …/…; python CellProfiler.py --build-and-exit;), but I still get the same error.
After stepping through CellProfiler.py with pdb (don’t have the gdb bindings for python installed on the cluster), I’m able to get all the way to

code

/usr/cp2/CellProfiler/CellProfiler.py(391)()
-> App.MainLoop()
[/code]

And that’s grand. However, I still get the same crash:

[code]ERROR:cellprofiler.gui.moduleview:WX internal error detected
Traceback (most recent call last):
File “cellprofiler/gui/moduleview.py”, line 1717, in CalcMin
for col in range(2)])
AttributeError: ‘NoneType’ object has no attribute 'GetBorder’
WX internal error detected
Traceback (most recent call last):
File “cellprofiler/gui/moduleview.py”, line 1717, in CalcMin
for col in range(2)])
AttributeError: ‘NoneType’ object has no attribute ‘GetBorder’

A fatal error has been detected by the Java Runtime Environment:

SIGSEGV (0xb) at pc=0x00007feb857a9756, pid=16171, tid=140649724524288

<segfault report follows, roughly same as posted in 1st post.>
[/code]

Am I not doing enough to downgrade? Or should I also look into installing a different version of wxPython?

Thanks again,

Lee.

I’ve tried two different revisions of the CellProfiler/cellprofiler/gui code now (11395, 11319), and the behaviour is the same in each case. In an effort to show you more of what I’m experiencing, here are some screen captures of CP2:

  1. After cp2 starts, I can load my test pipeline. However, I get this pop-up window telling me that an exception has been caught:
    http://www.cs.toronto.edu/~zamparo/images/exception_on_load_pipeline.png

  2. After this, I can view the modules in the pipeline, but some of them are not loaded properly:
    http://www.cs.toronto.edu/~zamparo/images/pipeline_loaded.png

  3. I can view only those modules with a green checkmark (CreateBatchFiles):
    http://www.cs.toronto.edu/~zamparo/images/view_create_batch_files.png

  4. But none others. I can also view LoadImages without CP2 crashing, but the panel that should display the module settings is blank:
    http://www.cs.toronto.edu/~zamparo/images/view_load_images.png

The cause of the crash is probably due to the inability of the LoadImages module to get the data properly. This constant (M_SERIES) that cannot be found seems to only appear in the source tree in one spot (CellProfiler/cellprofiler/modules/loadimages.py: 887 -> choices.update([M_Z, M_T, M_SERIES]). Where is this defined? Am I missing a config file with these types of definition somewhere?

Thanks,

I forgot to change M_SERIES to C_SERIES in that one spot. The bug will only happen if you select “tiff… movies” in LoadImages and then check “Group images by metadata”. The bug is fixed in 11439.

Ok, thanks Lee!

Lee.