borevitzlab / timestreamlib

DEPRECATED. Please use the current version of the TimeStream tools at https://gitlab.com/appf-anu/pyts2.
https://gitlab.com/appf-anu/pyts2
GNU General Public License v3.0
7 stars 4 forks source link

timestream segfaults #37

Closed Joelgranados closed 10 years ago

Joelgranados commented 10 years ago

My virtual environment:

ExifRead==1.4.2
PyYAML==3.11
argparse==1.2.1
backports.ssl-match-hostname==3.4.0.2
certifi==14.05.14
docopt==0.6.2
matplotlib==1.3.1
netCDF4==1.1.0
nose==1.3.3
numpy==1.8.1
pyparsing==2.0.2
python-dateutil==2.2
scikit-image==0.10.1
scipy==0.14.0
six==1.7.3
timestream==0.1a2
tornado==4.0
voluptuous==0.8.4
wsgiref==0.1.2

and python-opencv 2.4.9+dfsg-1

The log before it segfaulted:

...
---Writing Image---
---Extract Plant Features---
---Writing Features---
Done
Missing Image
Missing Image
Process /mnt/phenocam/a_data/TimeStreams/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig/2014/2014_06/2014_06_24/2014_06_24_12/BVZ0036-GC05L-C01~fullres-orig_2014_06_24_12_00_00_00.JPG ...
Time stamp 2014-06-24 12:00:00
---perform optical undistortion---
---perform color card detection---
---perform color correction---
---perform tray detection---
---perform pot d
Joelgranados commented 10 years ago

I downloaded BVZ0036-GC05L-C01~fullres-orig_2014_06_24_12_00_00_00.JPG and the image seems to be intact. It is not mangled and the exif data is all there. It might not be the image that is causing the segmentation fault, but the code that does something strange and invalid.

kdm9 commented 10 years ago

Could you post a gdb backtrace?

gdb `which python`
run pipeline_demo.py
bt
chuong commented 10 years ago

I am having the same problem. The segmentation fault happens randomly. This may be memory leaks or memory/hardware errors on the machine.

For example: .... 14:36:35: Expected image /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05R-C01~fullres-orig/2014/2014_06/2014_06_28/2014_06_28_05/BVZ0036-GC05R-C01~fullres-orig_2014_06_28_05_00_00_00.JPG at 2014_06_28_05_00_00 in /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05R-C01~fullres-orig did not exist. timestreamlib: WARNING: Expected image /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05R-C01~fullres-orig/2014/2014_06/2014_06_28/2014_06_28_05/BVZ0036-GC05R-C01~fullres-orig_2014_06_28_05_00_00_00.JPG at 2014_06_28_05_00_00 in /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05R-C01~fullres-orig did not exist. Missing Image 14:36:35: Expected image /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05R-C01~fullres-orig/2014/2014_06/2014_06_28/2014_06_28_05/BVZ0036-GC05R-C01~fullres-orig_2014_06_28_05_30_00_00.JPG at 2014_06_28_05_30_00 in /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05R-C01~fullres-orig did not exist. timestreamlib: WARNING: Expected image /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05R-C01~fullres-orig/2014/2014_06/2014_06_28/2014_06_28_05/BVZ0036-GC05R-C01~fullres-orig_2014_06_28_05_30_00_00.JPG at 2014_06_28_05_30_00 in /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05R-C01~fullres-orig did not exist. Missing Image Segmentation fault

or : ... Process /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig/2014/2014_06/2014_06_24/2014_06_24_14/BVZ0036-GC05L-C01~fullres-orig_2014_06_24_14_30_00_00.JPG ... Time stamp 2014-06-24 14:30:00 ---perform optical undistortion--- ---perform color card detection--- ---Perform color correction--- ---Write image--- ---perform tray detection--- ---perform pot detection--- Done Process /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig/2014/2014_06/2014_06_24/2014_06_24_15/BVZ0036-GC05L-C01~fullres-orig_2014_06_24_15_00_00_00.JPG ... Time stamp 2014-06-24 15:00:00 ---perform optical undistortion--- ---perform color card detection--- ---Perform color correction--- ---Write image--- ---perform tray detection--- ---perform pot detection--- Done Segmentation fault

chuong commented 10 years ago

At one occasion this happens at "ts_out.write_image(img)" of pipecomponents.py: ... Process /mnt/phenocam/a_data/TimeStreams/Borevitz/BVZ0018/BVZ0018-GC05R-C01~fullres-orig/2013/2013_08/2013_08_20/2013_08_20_08/BVZ0018-GC05R-C01~fullres-orig_2013_08_20_08_30_00_00.jpg ... Time stamp 2013-08-20 08:30:00 ---Perform optical undistortion--- ---perform color card detection--- ---Perform color correction--- ---Write image--- ---Perform tray detection--- ---Perform pot detection--- Done Process /mnt/phenocam/a_data/TimeStreams/Borevitz/BVZ0018/BVZ0018-GC05R-C01~fullres-orig/2013/2013_08/2013_08_20/2013_08_20_08/BVZ0018-GC05R-C01~fullres-orig_2013_08_20_08_35_00_00.jpg ... Time stamp 2013-08-20 08:35:00 ---Perform optical undistortion--- ---perform color card detection--- ---Perform color correction--- ---Write image--- Traceback (most recent call last): File "pipeline_demo.py", line 148, in try: File "/home/chuong/Workspace/timestreamlib/timestream/manipulate/pipeline.py", line 82, in process res = elem(contArgs, *res) File "/home/chuong/Workspace/timestreamlib/timestream/manipulate/pipecomponents.py", line 692, in call

chuong commented 10 years ago

Below is the debug information as required by Kevin:

chuong@north1ws:~/Workspace/timestreamlib/util$ gdb which python GNU gdb (GDB) 7.4.1-debian Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /usr/bin/python...(no debugging symbols found)...done. (gdb) run pipeline_demo.py /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig/ /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig/_data/pipeline_v2_potdetect.yml /home/chuong/Data/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-30min/ Starting program: /usr/bin/python pipeline_demo.py /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig/ /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig/_data/pipeline_v2_potdetect.yml /home/chuong/Data/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-30min/ warning: Could not load shared library symbols for linux-vdso.so.1. Do you need "set solib-search-path" or "set sysroot"? [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". p11-kit: invalid config filename, will be ignored in the future: /etc/pkcs11/modules/gnome-keyring-module [New Thread 0x7fffd8727700 (LWP 25587)] timestream path = /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig Timestream instance created: ts.path: /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig ts.name: BVZ0036-GC05L-C01~fullres-orig ts.version: 1 ts.start_datetime: 2014-06-18 17:00:00 ts.end_datetime: 2014-07-30 13:00:00 ts.image_type: jpg ts.extension: JPG ts.interval: 30 Iterating by date startDate = 2014-06-18 08:00:00 endDate = None 14:53:12: Expected image /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig/2014/2014_06/2014_06_18/2014_06_18_17/BVZ0036-GC05L-C01~fullres-orig_2014_06_18_17_30_00_00.JPG at 2014_06_18_17_30_00 in /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig did not exist. timestreamlib: WARNING: Expected image /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig/2014/2014_06/2014_06_18/2014_06_18_17/BVZ0036-GC05L-C01~fullres-orig_2014_06_18_17_30_00_00.JPG at 2014_06_18_17_30_00 in /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig did not exist. Missing Image ...................(skipping here).................. Process /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig/2014/2014_06/2014_06_24/2014_06_24_14/BVZ0036-GC05L-C01~fullres-orig_2014_06_24_14_30_00_00.JPG ... Time stamp 2014-06-24 14:30:00 ---perform optical undistortion--- ---perform color card detection--- ---Perform color correction--- ---Write image--- ---perform tray detection--- ---perform pot detection--- Done Process /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig/2014/2014_06/2014_06_24/2014_06_24_15/BVZ0036-GC05L-C01~fullres-orig_2014_06_24_15_00_00_00.JPG ... Time stamp 2014-06-24 15:00:00 ---perform optical undistortion--- ---perform color card detection--- ---Perform color correction--- ---Write image--- ---perform tray detection--- ---perform pot detection--- Done

Program received signal SIGSEGV, Segmentation fault. 0x00007fffe6cbc989 in ffi_closure_unix64_inner () from /usr/lib/x86_64-linux-gnu/libffi.so.6 (gdb) bt

0 0x00007fffe6cbc989 in ffi_closure_unix64_inner () from /usr/lib/x86_64-linux-gnu/libffi.so.6

1 0x00007fffe6cbce86 in ffi_closure_unix64 () from /usr/lib/x86_64-linux-gnu/libffi.so.6

2 0x00007fffc6333f7e in FreeImage_OutputMessageProc () from /usr/lib/libfreeimage.so.3

3 0x00007fffc63463f3 in ?? () from /usr/lib/libfreeimage.so.3

4 0x00007ffff2781fe5 in ?? () from /usr/lib/x86_64-linux-gnu/libjpeg.so.8

5 0x00007ffff2779da6 in ?? () from /usr/lib/x86_64-linux-gnu/libjpeg.so.8

6 0x00007ffff2779e32 in ?? () from /usr/lib/x86_64-linux-gnu/libjpeg.so.8

7 0x00007ffff277b58e in ?? () from /usr/lib/x86_64-linux-gnu/libjpeg.so.8

8 0x00007ffff2777f95 in ?? () from /usr/lib/x86_64-linux-gnu/libjpeg.so.8

9 0x00007ffff277d252 in ?? () from /usr/lib/x86_64-linux-gnu/libjpeg.so.8

10 0x00007ffff2775990 in jpeg_read_scanlines () from /usr/lib/x86_64-linux-gnu/libjpeg.so.8

11 0x00007fffc6346f38 in ?? () from /usr/lib/libfreeimage.so.3

12 0x00007fffc6336914 in FreeImage_LoadFromHandle () from /usr/lib/libfreeimage.so.3

13 0x00007fffc63369b1 in FreeImage_Load () from /usr/lib/libfreeimage.so.3

14 0x00007fffe6cbcd1e in ffi_call_unix64 () from /usr/lib/x86_64-linux-gnu/libffi.so.6

15 0x00007fffe6cbc788 in ffi_call () from /usr/lib/x86_64-linux-gnu/libffi.so.6

16 0x00007fffdc94bdf5 in _ctypes_callproc () from /usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so

17 0x00007fffdc950642 in ?? () from /usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so

18 0x00000000004c4569 in PyEval_EvalFrameEx ()

19 0x00000000004c4012 in PyEval_EvalFrameEx ()

20 0x00000000004c2109 in PyEval_EvalCodeEx ()

21 0x00000000004c3d5c in PyEval_EvalFrameEx ()

22 0x00000000004dee70 in ?? ()

23 0x00000000004c72f5 in PyEval_EvalFrameEx ()

24 0x00000000004dee70 in ?? ()

25 0x00000000004c72f5 in PyEval_EvalFrameEx ()

26 0x00000000004c2109 in PyEval_EvalCodeEx ()

27 0x00000000004c3d5c in PyEval_EvalFrameEx ()

28 0x00000000004dee70 in ?? ()

29 0x00000000004ad8a0 in ?? ()

30 0x00000000004ad49c in PyObject_CallFunction ()

31 0x00000000004abdb6 in PyObject_GetAttr ()

32 0x00000000004c36e9 in PyEval_EvalFrameEx ()

33 0x00000000004c2109 in PyEval_EvalCodeEx ()

34 0x00000000004fb75f in ?? ()

35 0x00000000004f1302 in PyRun_FileExFlags ()

36 0x00000000004f0444 in PyRun_SimpleFileExFlags ()

37 0x0000000000492b83 in Py_Main ()

38 0x00007ffff6f18b45 in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6

39 0x0000000000492565 in _start ()

(gdb)

kdm9 commented 10 years ago

OK, this looks like the issue I fixed here: https://github.com/scikit-image/scikit-image/pull/1039

please do this in your virtualenvs:

pip install git+https://github.com/scikit-image/scikit-image.git
kdm9 commented 10 years ago

And please close this if that fixes it, thanks guys.

K

chuong commented 10 years ago

I had a problem when testing this in virtual python env. This is the error:

(timestream)chuong@north1ws:~/Workspace/timestreamlib/util$ python pipeline_demo.py /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig/ /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig/_data/pipeline_v2_potdetect.yml /home/chuong/Data/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-30min/ Traceback (most recent call last): File "pipeline_demo.py", line 10, in import timestream File "build/bdist.linux-x86_64/egg/timestream/init.py", line 24, in

ImportError: libopencv_flann.so.2.3: cannot open shared object file: No such file or directory (timestream)chuong@north1ws:~/Workspace/timestreamlib/util$ export PYTHONPATH="${PYTHONPATH}:/home/chuong/Workspace/timestreamlib"(timestream)chuong@north1ws:~/Workspace/timestreamlib/util$ python pipeline_demo.py /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig/ /fast/phenomics/ts_cache/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-orig/_data/pipeline_v2_potdetect.yml /home/chuong/Data/Borevitz/BVZ0036/BVZ0036-GC05L-C01~fullres-30min/ Traceback (most recent call last): File "pipeline_demo.py", line 10, in import timestream File "build/bdist.linux-x86_64/egg/timestream/__init__.py", line 24, in ImportError: libopencv_flann.so.2.3: cannot open shared object file: No such file or directory On Wed, Jul 30, 2014 at 5:50 PM, Kevin Murray notifications@github.com wrote: > And please close this if that fixes it, thanks guys. > > K > > — > Reply to this email directly or view it on GitHub > https://github.com/borevitzlab/timestreamlib/issues/37#issuecomment-50584471 > .
Joelgranados commented 10 years ago

I updated to recent skimage and the segfault went away. Closing....

kdm9 commented 10 years ago

cheers man!