opened
kormat
username_0
From a local run earlier: https://gist.github.com/username_0/7203a9754d9fcda4f33a1e7b602dd094

I've seen this happen once before, but haven't been able to figure out how to reproduce it reliably.
pathdb sqlite unit test panics sometimes
issue
created
sgmonroy
username_1
It is very hard to reproduce it locally, although I succeeded once.

@username_2 pointed out that we should close the DB before remove the temp file.
Current code does remove the temp file then close the DB when the test is finished based on the order of defer statements.

Not much from the trace really. The C sqlite3_close_v2 function works even if you pass a NULL DB reference, which is what the trace indicates. So it should not SEGFAULT because of it.
comment
created
kormat
username_0
After doing some searching, i notice 3 things:
- I believe these segfaults are recent, and potentially only started after #1729 was merged, which added contexts to pathdb.
- https://github.com/mattn/go-sqlite3/issues/458 was about segfaults caused by race-conditions with contexts
- And that issue was fixed by https://github.com/mattn/go-sqlite3/commit/d40d4905434d5abfab8d29584adc850797897769, which is from 1 day _after_ our current pinned version of `go-sqlite3`
comment
created
kormat
username_0
I'm able to reproduce the segfault from mattn/go-sqlite3#458 on my machine. I suggest we update to go-sqlite3 `25ecb14adfc7543176f7d85291ec7dba82c6f7e4` (the latest release commit).
comment
created
lukedirtwalker
username_2
https://github.com/scionproto/scion/pull/1784 updates go-sqlite to the latest master, aka `b3511bfdd742af558b54eb6160aca9446d762a19`, it is slightly newer than the latest release commit (`25ecb1...`) but it contains one (I think relevant) race condition bug fix.
comment
closed
lukedirtwalker
username_2
issue