mattn / go-sqlite3

sqlite3 driver for go using database/sql

Home Page:http://mattn.github.io/go-sqlite3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Segmentation fault in Ubuntu 18.04 with GLIBC_2.34

Teajey opened this issue · comments

My server runs Ubuntu 18.04 and I'm having trouble getting my app (that uses go-sqlite) to run there.

First, I had to install a newer version of glibc:

$ ./sqlite-linux-repro
./sqlite-linux-repro: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by ./sqlite-linux-repro)
./sqlite-linux-repro: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./sqlite-linux-repro)
./sqlite-linux-repro: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./sqlite-linux-repro)
./sqlite-linux-repro: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./sqlite-linux-repro)

And since doing that I've been getting a segfault

$ LD_PRELOAD=/opt/glibc-2.34/lib/libc.so.6 ./sqlite-linux-repro
[1]    3707 segmentation fault (core dumped)  LD_PRELOAD=/opt/glibc-2.34/lib/libc.so.6 ./sqlite-linux-repro

Here's a minimal reproduction: https://github.com/Teajey/sqlite-linux-repro

There's a Dockerfile that recreates the conditions:

docker build -t sqlite-linux-repro .
docker run -it --rm sqlite-linux-repro

There's no stderr output for some reason. But you can verify the segfault by checking the exit code:

$ echo $?
139

Perhaps it's a problem with using these versions of Ubuntu and glibc together.

I'm unfortunately not clued-up enough to find the core dump file, let alone make sense of it.

Thanks for any help.

./sqlite-linux-repro: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.28' not found (required by ./sqlite-linux-repro)`

implies you built your application on a distro that is newer than 18.04, you app then requires a newer version of libc, but that the only version of libc available is too old. Instead build your application on Ubuntu 18.04 if you want to be sure it will run on 18.04. It'll probably also then run on newer versions of Ubuntu, since newer versions of libc should work fine too (but not the other way around, which is what you're hitting).