ARPA-SIMC / dballe

Fast on-disk database for meteorological observed and forecast data.
Other
19 stars 6 forks source link

Segmentation fault querying min and max datetimes in dballe.CursorSummarySummary #232

Closed bchiavarini closed 4 years ago

bchiavarini commented 4 years ago

Hi, I have some problems of segmentation fault using query parameters as "yearmax","yearmin" ecc.. with dballe.CursorSummarySummary. I did some tests and i have noticed that the problem rises when i use an explorer.query_summary or explorer.query_summary_all querying networks i have in db but with data excluded by the query used to filter the summary.

For example:\ I have in db only data from "agrmet" network with reftime 2020-04-04.\ With query = {'datetimemin': datetime.datetime(2006, 1, 1, 1, 0), 'datetimemax': datetime.datetime(2020, 6, 1, 15, 13), 'rep_memo': 'agrmet', 'query': 'details'} if a do an iteration on a explorer.query_summary_all and i ask for cur["yearmax"] i have no problem.\ If i use query = {'datetimemin': datetime.datetime(2006, 1, 1, 1, 0), 'datetimemax': datetime.datetime(2020, 3, 1, 15, 13), 'rep_memo': 'agrmet', 'query': 'details'} asking for cur["yearmax"] causes a segmentation fault.\ But if i ask for an other network that is not in db (for example query = {'datetimemin': datetime.datetime(2006, 1, 1, 1, 0), 'datetimemax': datetime.datetime(2020, 3, 1, 15, 13), 'rep_memo': 'boa', 'query': 'details'} no problems are risen. The same thing happens also using an explorer filled by a json file as in the attached code example: segfault_issue.zip

I am using DBalle 8.11

Thanks for your help!

spanezz commented 4 years ago

Thanks for the excellent test case, I confirm that I can reproduce the segfault. I'll now work on it