tecbot / gorocksdb

gorocksdb is a Go wrapper for RocksDB
http://rocksdb.org
MIT License
940 stars 269 forks source link

illegal instruction (core dumped) #202

Closed tintinlam007 closed 3 years ago

tintinlam007 commented 3 years ago

1. Docker platform:

operation system: Alpine LLinux v3.10 go version: go 1.13.4 go env: GOARCH=amd64 CGO_CFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" cpu: Intel(R) Xeon(R) CPU E7-4870 v2

2. Install steps In Docker:

FROM golang:1.14.4-alpine MAINTAINER unoexperto unoexperto.support@mailnull.com

RUN echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >>/etc/apk/repositories RUN apk add --update --no-cache build-base linux-headers git cmake bash perl #wget mercurial g++ autoconf libgflags-dev cmake bash RUN apk add --update --no-cache zlib zlib-dev bzip2 bzip2-dev snappy snappy-dev lz4 lz4-dev zstd@testing zstd-dev@testing libtbb-dev@testing libtbb@testing

--# installing latest gflags RUN cd /tmp && \ git clone https://github.com/gflags/gflags.git && \ cd gflags && \ mkdir build && \ cd build && \ cmake -DBUILD_SHARED_LIBS=1 -DGFLAGS_INSTALL_SHARED_LIBS=1 .. && \ make install && \ cd /tmp && \ rm -R /tmp/gflags/

--# Install Rocksdb RUN cd /tmp && \ git clone https://github.com/facebook/rocksdb.git && \ cd rocksdb && \ git checkout v6.10.2 && \ make shared_lib && \ mkdir -p /usr/local/rocksdb/lib && \ mkdir /usr/local/rocksdb/include && \ cp librocksdb.so /usr/local/rocksdb/lib && \ cp /usr/local/rocksdb/lib/librocksdb.so /usr/lib/ && \ cp -r include /usr/local/rocksdb/ && \ cp -r include/* /usr/include/ && \ rm -R /tmp/rocksdb/

--# Install gorocksdb ENV CGO_CFLAGS="-I/path/to/rocksdb/include" \ ENV CGO_LDFLAGS="-L/path/to/rocksdb -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy -llz4 -lzstd" \ RUN go get github.com/tecbot/gorocksdb

3. Test Program

package main import( "github.com/tecbot/gorocksdb ) func main(){ dbOpts :=gorocksdb.NewDefaultOptions() dbPath := "test.db" gorocksdb.OpenDb(dbOpts, dbPath) }

Save above as test.go

4. Build and run

go build go run test.go

5. Problem

it report: signal: illegal instruction (core dumped)

Thank you!

fishpenguin commented 3 years ago

I have met the same problem. Do you know how to resolve it?

tintinlam007 commented 3 years ago

ave met the same problem. Do you know how to resolve it?

I found the answer.

This problem happens when the host operation system is Ubuntu 14.04.4 LTS, it was solved when upgrade to Ubuntu 16.04.3 LTS!!

tintinlam007 commented 3 years ago

problem solved.