Datetime conversion using timegm can (and does) overflow
After updating to tracker 3.1.x the datetime/direct-1
and datetime/insert-1
tests have started failing on NixOS (presumably after !324 (commits)).
+++ - 2021-04-06 10:22:51.419586123 +0000
@@ -1 +1 @@
-"0000-01-01T00:00:00Z" "2020-01-01T00:00:00Z" "9999-01-01T00:00:00Z"
+"1969-12-31T23:59:59Z" "2020-01-01T00:00:00Z" "1969-12-31T23:59:59Z"
I've done some printf debugging and it looks like the call to timegm
in src/libtracker-common/tracker-date-time.c:130
returns -1 and sets errno == EOVERFLOW
. I think maybe this error should be caught and propagated in such a way that e.g.
https://gitlab.gnome.org/GNOME/tracker/-/blob/master/src/libtracker-data/tracker-sparql.c#L9570-9572 can trigger to save it as a string instead?
Edit: Forgot to mention: it seems like this failure is happening in the 32bit build, which is needed even on a 64bit system when building Steam.