Bug 140521 - NetCDF data source crashes
Summary: NetCDF data source crashes
Status: RESOLVED WORKSFORME
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-23 22:58 UTC by Eli Fidler
Modified: 2007-08-07 00:49 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eli Fidler 2007-01-23 22:58:35 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    SuSE RPMs
OS:                Linux

When I use the NetCDF data source with GOTEX.C130_N130AR.LRT.RF06.PNI.nc, trying to plot base_time vs INDEX crashes Kst. 

I think the problem is because the NetCDF file only contains one value for base_time and it's not in the range of frames for the other values.
Comment 1 Nicolas Brisset 2007-01-24 16:04:36 UTC
Strange, it does not crash here (kst 1.3.1 on Solaris 8/KDE 3.4.0).
I get a 1-value vector for base_time (value = 1077114120) and INDEX is a vector of length 3061 with values from 0 to 3060.
Have you tracked the cause of the crash further ?

I'm always uncertain how things work with frames and frame counts for datasources where vectors have different lengths. The behavior of frameCount(const QString& field) when field is empty is kind of undefined, and I chose to return the max value. No idea what that might break, though...
Comment 2 Eli Fidler 2007-01-24 23:16:50 UTC
It crashes on var->get_rec(i+s) at line 192. i+s is 0.

When I do ncdump -v base_time -f c GOTEX.C130_N130AR.LRT.RF06.PNI.nc, it shows 

base_time = 1077114120;  // base_time(1209150752)

as the only value. Note the index (1209150752) is much bigger than 3061 (the maximum index of the other variables). Perhaps fetching base_time as a record is invalid?
Comment 3 Nicolas Brisset 2007-01-25 09:25:37 UTC
Interesting. I get:
  base_time = 1077114120;  // base_time(0) on Solaris
with the ncdump command. My netcdf version is:
netcdf library version 3.6.0 of Mar 16 2005 16:53:46 $

On Linux I get:
 base_time = 1077114120;  // base_time(134717925)
with the same command, same version (3.6.0)

It looks like an endianness issue to me, and interestingly netcdf 3.6.1 (latest stable version) gives on Linux:
 base_time = 1077114120;  // base_time(0)

So I'd say it's a netcdf endianness bug in some versions, that seems fixed in 3.6.1. What version are you using ? If upgrading to 3.6.1 solves the problem, we can close this bug :-)
Comment 4 Eli Fidler 2007-01-25 21:47:01 UTC
Hmm... I updated to 3.6.1 and it still crashes in the same place. ncdump now shows the right thing, however.
Comment 5 Nicolas Brisset 2007-01-29 17:22:52 UTC
Pardon me for asking such a stupid question, but are you sure your kst datasource plugin is using the newer version ? I guess you've recompiled/relinked it and made sure it points to the right version, but I think loaded plugins/datasources are not updated as long as kst is not closed and started anew. I even wanted to create a bug report for that, as it is quite confusing. I'm not familiar with the way libraries are loaded dynamically in kst, but maybe you did not really have the newer version running ?
Otherwise I don't really understand why it wouldn't work. I'll have to try it on a PC, since under Solaris it works without problems.
Comment 6 Andrew Walker 2007-08-07 00:49:16 UTC
Please re-open the bug once it is confirmed that the problem can be recreated with the latest version of the NetCDF data source.