Hi,
I'm hitting what seems to be a bug in the EPD NetCDF reading or writing library. I'm using EPD version 7.3.1 (epd-7.3-1-rh5-x86_64). Here's the python -v dump of the netCDF packages that are loaded by my script:
--------------------------------------------
dlopen("/opt/epd-7.3-1-rh5-x86_64/lib/python2.7/site-packages/netCDF4.so", 2);
import netCDF4_utils # from /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/site-packages/netCDF4_utils.py
import netcdftime # from /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/site-packages/netcdftime.py
import netCDF4 # dynamically loaded from /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/site-packages/netCDF4.so
--------------------------------------------
I'm basically trying to write out 3 NumPy arrays (dataset, scan_lines, and cells) as a netCDF4 file and then be able to read the netCDF4 back again in Python. The write operation seems to work fine without any errors or issues. However, when I read the exact same file back, Python crashes with a segmentation fault so I don't get any error message pointing to a specific line or library.
I created a script that will usually end up with this Segmentation Fault (I'm working on getting one that will segfault every time, see note below). It's attached to this email, just run netcdfReadWriteTest.py
I submitted this bug to Jonathan Rocher at Enthought and he confirmed the issue under RHEL and directed me to contact you. He also confirmed that the same code exhibits the same "Access violation reading" under Windows and works without issues under Mac OS.
I'm hoping you might be able to look into this to help suss out the problem.
Thanks,
Nick Vance
Note: Sometimes when I run the test I don't get a backtrace, just a Segmentation fault error:
--------------------------------------------
$ python netcdfReadWriteTest.py
Reading Pickle Files In: ./raw_data_dumps/N65684083W167928375.5000m.2010.002.134000.aqua.modis_extracted
Read parameter sizes: 1, 10, 71
Writing out NetCDF File: /data/data-j/collection-pieces/hytes/scenes/lab-test-scenes/version-2-1-testdata/code/netCDF-test/test.netcdf
Re-reading NetCDF File: /data/data-j/collection-pieces/hytes/scenes/lab-test-scenes/version-2-1-testdata/code/netCDF-test/test.netcdf
----------1----------
----------2----------
----------3----------
----------4----------
Segmentation fault
--------------------------------------------
Other times (I'm unsure what causes the difference, but it might depend on what group of Pickle data you load, there are several included) I get a backtrace like this:
--------------------------------------------
$ python netcdfReadWriteTest.py
Reading Pickle Files In: ./raw_data_dumps/N65684083W167928375.5000m.2010.002.232000.aqua.modis_extracted
Read parameter sizes: 1, 10, 73
Writing out NetCDF File: /data/data-j/collection-pieces/hytes/scenes/lab-test-scenes/version-2-1-testdata/code/netCDF-test/test.netcdf
Re-reading NetCDF File: /data/data-j/collection-pieces/hytes/scenes/lab-test-scenes/version-2-1-testdata/code/netCDF-test/test.netcdf
----------1----------
----------2----------
----------3----------
----------4----------
----------5----------
----------6----------
Re-Read parameter sizes: 1, 10, 73
Reading Pickle Files In: ./raw_data_dumps/N65684083W167928375.5000m.2010.002.214000.aqua.modis_extracted.dat1
*** glibc detected *** /opt/epd-7.3-1-rh5-x86_64/bin/python: free(): invalid next size (normal): 0x00000000021ab200 ***
======= Backtrace: =========
/lib/libc.so.6(+0x78bb6)[0x7fb195b47bb6]
/lib/libc.so.6(cfree+0x73)[0x7fb195b4e483]
/opt/epd-7.3-1-rh5-x86_64/lib/python2.7/site-packages/numpy/core/multiarray.so(+0x832af)[0x7fb193c292af]
/opt/epd-7.3-1-rh5-x86_64/lib/python2.7/site-packages/numpy/core/multiarray.so(+0x8330e)[0x7fb193c2930e]
/opt/epd-7.3-1-rh5-x86_64/lib/libpython2.7.so.1.0(+0x7b163)[0x7fb196777163]
/opt/epd-7.3-1-rh5-x86_64/lib/libpython2.7.so.1.0(PyDict_SetItem+0x73)[0x7fb196778183]
/opt/epd-7.3-1-rh5-x86_64/lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x4d7b)[0x7fb1967d63cb]
/opt/epd-7.3-1-rh5-x86_64/lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x8d2)[0x7fb1967d8c12]
/opt/epd-7.3-1-rh5-x86_64/lib/libpython2.7.so.1.0(PyEval_EvalCode+0x32)[0x7fb1967d8c62]
/opt/epd-7.3-1-rh5-x86_64/lib/libpython2.7.so.1.0(+0xf68e2)[0x7fb1967f28e2]
/opt/epd-7.3-1-rh5-x86_64/lib/libpython2.7.so.1.0(PyRun_FileExFlags+0x96)[0x7fb1967f29b6]
/opt/epd-7.3-1-rh5-x86_64/lib/libpython2.7.so.1.0(PyRun_SimpleFileExFlags+0x1f7)[0x7fb1967f3f17]
/opt/epd-7.3-1-rh5-x86_64/lib/libpython2.7.so.1.0(Py_Main+0xc86)[0x7fb196804a86]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7fb195aedc4d]
/opt/epd-7.3-1-rh5-x86_64/bin/python[0x4006f9]
======= Memory map: ========
00400000-00401000 r-xp 00000000 08:21 45368962 /opt/epd-7.3-1-rh5-x86_64/bin/python2.7
00600000-00601000 rw-p 00000000 08:21 45368962 /opt/epd-7.3-1-rh5-x86_64/bin/python2.7
019a8000-026d1000 rw-p 00000000 00:00 0 [heap]
7fb188000000-7fb188021000 rw-p 00000000 00:00 0
7fb188021000-7fb18c000000 ---p 00000000 00:00 0
7fb18dc81000-7fb18dc97000 r-xp 00000000 08:21 5242885 /lib/libgcc_s.so.1
7fb18dc97000-7fb18de96000 ---p 00016000 08:21 5242885 /lib/libgcc_s.so.1
7fb18de96000-7fb18de97000 r--p 00015000 08:21 5242885 /lib/libgcc_s.so.1
7fb18de97000-7fb18de98000 rw-p 00016000 08:21 5242885 /lib/libgcc_s.so.1
7fb18de98000-7fb18e013000 r-xp 00000000 08:21 45369175 /opt/epd-7.3-1-rh5-x86_64/lib/libcrypto.so.1.0.0
7fb18e013000-7fb18e212000 ---p 0017b000 08:21 45369175 /opt/epd-7.3-1-rh5-x86_64/lib/libcrypto.so.1.0.0
7fb18e212000-7fb18e235000 rw-p 0017a000 08:21 45369175 /opt/epd-7.3-1-rh5-x86_64/lib/libcrypto.so.1.0.0
7fb18e235000-7fb18e238000 rw-p 00000000 00:00 0
7fb18e238000-7fb18e288000 r-xp 00000000 08:21 45371397 /opt/epd-7.3-1-rh5-x86_64/lib/libssl.so.1.0.0
7fb18e288000-7fb18e487000 ---p 00050000 08:21 45371397 /opt/epd-7.3-1-rh5-x86_64/lib/libssl.so.1.0.0
7fb18e487000-7fb18e48f000 rw-p 0004f000 08:21 45371397 /opt/epd-7.3-1-rh5-x86_64/lib/libssl.so.1.0.0
7fb18e48f000-7fb18e492000 r-xp 00000000 08:21 45371005 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/lib-dynload/_hashlib.so
7fb18e492000-7fb18e692000 ---p 00003000 08:21 45371005 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/lib-dynload/_hashlib.so
7fb18e692000-7fb18e693000 rw-p 00003000 08:21 45371005 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/lib-dynload/_hashlib.so
7fb18e693000-7fb18e697000 r-xp 00000000 08:21 45371000 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/lib-dynload/_locale.so
7fb18e697000-7fb18e897000 ---p 00004000 08:21 45371000 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/lib-dynload/_locale.so
7fb18e897000-7fb18e898000 rw-p 00004000 08:21 45371000 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/lib-dynload/_locale.so
7fb18e898000-7fb18e8a8000 r-xp 00000000 08:21 45370984 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/lib-dynload/datetime.so
7fb18e8a8000-7fb18eaa7000 ---p 00010000 08:21 45370984 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/lib-dynload/datetime.so
7fb18eaa7000-7fb18eaab000 rw-p 0000f000 08:21 45370984 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/lib-dynload/datetime.so
7fb18eaab000-7fb18eaee000 r-xp 00000000 08:21 1050318 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/site-packages/numpy/random/mtrand.so
7fb18eaee000-7fb18eced000 ---p 00043000 08:21 1050318 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/site-packages/numpy/random/mtrand.so
7fb18eced000-7fb18ed23000 rw-p 00042000 08:21 1050318 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/site-packages/numpy/random/mtrand.so
7fb18ed23000-7fb18ed28000 r-xp 00000000 08:21 45370993 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/lib-dynload/strop.so
7fb18ed28000-7fb18ef27000 ---p 00005000 08:21 45370993 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/lib-dynload/strop.so
7fb18ef27000-7fb18ef29000 rw-p 00004000 08:21 45370993 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/lib-dynload/strop.so
7fb18ef29000-7fb18ef32000 r-xp 00000000 08:21 1050128 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/site-packages/numpy/fft/fftpack_lite.so
7fb18ef32000-7fb18f132000 ---p 00009000 08:21 1050128 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/site-packages/numpy/fft/fftpack_lite.so
7fb18f132000-7fb18f133000 rw-p 00009000 08:21 1050128 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/site-packages/numpy/fft/fftpack_lite.so
7fb18f133000-7fb18f135000 r-xp 00000000 08:21 45371026 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/lib-dynload/grp.so
7fb18f135000-7fb18f334000 ---p 00002000 08:21 45371026 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/lib-dynload/grp.so
7fb18f334000-7fb18f335000 rw-p 00001000 08:21 45371026 /opt/epd-7.3-1-rh5-x86_64/lib/python2.7/lib-dynload/grp.soAborted
--------------------------------------------