Closed gerritholl closed 9 years ago
Using the debugger, I found out that it is triggered by:
In [4]: sd = pyhdf.SD.SD("/data/01/gholl/data/Eureka_hdf/groundbased_ftir.ch4_utoronto001_eureka_2
0080301t102850z_20080920t144053z_001.hdf")
In [5]: sds = sd.select(15)
In [6]: ipdb.run("sds.info()")
> <string>(1)<module>()
ipdb> break /export/data/home/gholl/venv/gerrit/lib/python3.4/site-packages/pyhdf/SD.py:2142
Breakpoint 1 at /export/data/home/gholl/venv/gerrit/lib/python3.4/site-packages/pyhdf/SD.py:2142
ipdb> cont
> /export/data/home/gholl/venv/gerrit/lib/python3.4/site-packages/pyhdf/SD.py(2142)info()
2141 status, sds_name, rank, data_type, n_attrs = \
1> 2142 _C.SDgetinfo(self._id, buf)
2143 _checkErr('info', status, "cannot execute")
ipdb> step
*** stack smashing detected ***: /export/data/home/gholl/venv/gerrit/bin/python3.4 terminated
======= Backtrace: =========
(etc.)
My guess is that the variable name is too long and SDgetinfo is running out of space to store the name. Do you know the variable name and how long it is? We have a limit of 256 characters.
If the variable name length is not the issue, I'll need the HDF file to investigate further. You'll have to host it somewhere so I can download it.
On second thought, variable name length is probably not issue since you say it works under python 2.7.
Hi,
On 26 November 2014 at 13:06, Fazlul Shahriar notifications@github.com wrote:
On second thought, variable name length is probably not issue since you say it works under python 2.7.
The variable name is CH4.MIXING.RATIO.VOLUME_ABSORPTION.SOLAR_UNCERTAINTY.SYSTEMATIC.COVARIANCE
I put the file in question at
https://dl.dropboxusercontent.com/u/4650900/testfile.pdf
(I will leave it there only temporarily)
Gerrit.
On 26 November 2014 at 13:23, Gerrit Holl gerrit.holl@gmail.com wrote:
Hi,
On 26 November 2014 at 13:06, Fazlul Shahriar notifications@github.com wrote:
On second thought, variable name length is probably not issue since you say it works under python 2.7.
The variable name is CH4.MIXING.RATIO.VOLUME_ABSORPTION.SOLAR_UNCERTAINTY.SYSTEMATIC.COVARIANCE
I put the file in question at
Sorry, that should be
https://dl.dropboxusercontent.com/u/4650900/testfile.hdf
(I will leave it there only temporarily)
Gerrit.
I just pushed out the fix, but the fix was already there in 0.9 release except I forgot to regenerate the swig wrapper. You can generate the wrapper by running:
swig -python hdfext.i
and then install the package again.
On 26 November 2014 at 17:18, Fazlul Shahriar notifications@github.com wrote:
I just pushed out the fix, but the fix was already there in 0.9 release except I forgot to regenerate the swig wrapper. You can generate the wrapper by running:
swig -python hdfext.i
and then install the package again.
Thanks for the rapid fix, that's great!
Gerrit.
When I try to run
pyhdf.SD.SD(...).datasets()
, or(...).select(15).get()
in Python 3.4, I get Stack smashing detected. I can open the same data file fine using the traditionalpyhdf
in Python 2.7. I'm using Python-hdf4 0.9.See below.