CartoDB / observatory-extension

BSD 3-Clause "New" or "Revised" License
6 stars 4 forks source link

Debug: segmentation fault #157

Closed ethervoid closed 7 years ago

ethervoid commented 8 years ago

Wednesday 22 of July we have a crash in the dataservices server due a segmentation fault in the function obs_getmeasurebyid

removed tracebacks

// @rafatower @javisantana

rafatower commented 8 years ago

@iriberri is this somehow related to the default values on going discussion?

iriberri commented 8 years ago

null values cannot be formatted as an SQL identifier

Smells like nulls in here: https://github.com/CartoDB/observatory-extension/blob/e12b729c517365fb9c66f8ce7ffd40334afe012e/src/pg/sql/41_observatory_augmentation.sql#L544-L547

I guess geom_ref or data_geoid_colname could be the cause. Perhaps something like this (putting geom_ref to null in the request) could be useful to test:

SELECT OBS_GetMeasureById(null, 'us.census.acs.B11001001', 'us.census.tiger.county')

but I won't run it in production just in case. Imagine you have a table with references in a column and some of the values are null, this is a very possible scenario.

iriberri commented 8 years ago

By the way time_span is the only possible parameter with default value there and it goes through a:

COALESCE(time_span, '')

which is an empty string in any case, not a NULL, so I don't think this is the case.

talos commented 7 years ago

In 41_observatory_augmentation.sql we've removed all the mistaken uses of format('%L'). @rafatower can we close this?

rafatower commented 7 years ago

A probable cause of this segfault, fixed in prod https://github.com/CartoDB/postgresql-debian/blob/9.5-cdb/debian/patches/93-plpython-segfault-excetion-handling.patch