The commit e4cf6739e62c2ac1e5364315aaed1a7b73919253, which introduced changes as in second c code snippet, was done few days after you opened this issue, so it was crashing before it, this one being an attempt to fix it.
Can you get from the last core file the gdb output for:
``` frame 0 p *var p full_version ```