silviucpp/erlcass

Error running app

pankajsoni19 opened this issue · 11 comments

I compiled using rebar3.
All supported dependencies are installed

When I try to run the app, it gives following error

>>> lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.4 LTS
Release:	18.04
Codename:	bionic
>>> ./rebar3 shell --apps erlcass lager
===> Verifying dependencies...
===> Compiling erlcass
cpp-driver fork already exist. delete _build/deps for a fresh checkout.
make[1]: Entering directory '/home/ubuntu/data/erlcass/c_src'
make[1]: '/home/ubuntu/data/erlcass/c_src/../priv/erlcass_nif.so' is up to date.
make[1]: Leaving directory '/home/ubuntu/data/erlcass/c_src'
Erlang/OTP 22 [erts-10.7.2] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]

Eshell V10.7.2  (abort with ^G)
1> ===> The rebar3 shell is a development tool; to deploy applications in production, consider using releases (http://www.rebar3.org/docs/releases)
08:00:21.852 [info] loading library: "/home/ubuntu/data/erlcass/_build/default/lib/erlcass/priv/erlcass_nif" 
Floating point exception (core dumped)

Any idea?

compile

root@ip-172-31-5-236:/home/ubuntu/data/erlcass# ./rebar3 compile
===> Verifying dependencies...
===> Compiling goldrush
===> Compiling lager
===> Compiling erlcass
Linux, Ubuntu
Hit:1 http://us-east-2.ec2.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://us-east-2.ec2.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:3 http://us-east-2.ec2.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:5 http://us-east-2.ec2.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [947 kB]
Get:6 http://us-east-2.ec2.archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [322 kB]
Get:7 http://us-east-2.ec2.archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [54.9 kB]
Get:8 http://us-east-2.ec2.archive.ubuntu.com/ubuntu bionic-updates/restricted Translation-en [13.7 kB]
Hit:9 https://s3.amazonaws.com/downloads.scylladb.com/downloads/scylla/deb/ubuntu/scylladb-4.0 xenial InRelease
Fetched 1590 kB in 1s (2049 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
libuv1-dev is already the newest version (1.18.0-3).
make is already the newest version (4.1-9.1ubuntu1).
cmake is already the newest version (3.10.2-1ubuntu2.18.04.1).
g++ is already the newest version (4:7.4.0-1ubuntu2.3).
libssl-dev is already the newest version (1.1.1-1ubuntu2.1~18.04.5).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
/home/ubuntu/data/erlcass/_build/deps /home/ubuntu/data/erlcass
Cloning into 'cpp-driver'...
/home/ubuntu/data/erlcass/_build/deps/cpp-driver /home/ubuntu/data/erlcass/_build/deps /home/ubuntu/data/erlcass
Note: checking out '3a5d3a50299fafc9c02c2dd42447e617593a19e9'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 3a5d3a50 Merge pull request #450 from datastax/2.13.0_release_prep
/home/ubuntu/data/erlcass/_build/deps /home/ubuntu/data/erlcass
/home/ubuntu/data/erlcass
/home/ubuntu/data/erlcass/_build/deps/cpp-driver/build /home/ubuntu/data/erlcass
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find CLANG_FORMAT (missing: CLANG_FORMAT_EXE) 
-- Unable to find clang-format. Not creating format targets.
-- PROJECT version: 2.13.0
-- libuv version: v1.18.0
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libssl.so (found version "1.1.1") 
-- OpenSSL version: v1.1.1
-- Using std::atomic implementation for atomic operations
-- Checking to see if CXX compiler accepts flag -std=c++11
-- Checking to see if CXX compiler accepts flag -std=c++11 - yes
-- Using hash header <functional> and namespace "std"
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for memcpy
-- Looking for memcpy - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of long long
-- Check size of long long - done
-- Check size of uint16_t
-- Check size of uint16_t - done
-- Check size of u_int16_t
-- Check size of u_int16_t - done
-- Check size of __uint16_t
-- Check size of __uint16_t - done
-- Looking for GRND_NONBLOCK
-- Looking for GRND_NONBLOCK - found
-- Looking for timerfd_create
-- Looking for timerfd_create - found
-- Looking for SO_NOSIGPIPE
-- Looking for SO_NOSIGPIPE - not found
-- Looking for sigtimedwait
-- Looking for sigtimedwait - found
-- Performing Test HAVE_BUILTIN_BSWAP32
-- Performing Test HAVE_BUILTIN_BSWAP32 - Success
-- Performing Test HAVE_BUILTIN_BSWAP64
-- Performing Test HAVE_BUILTIN_BSWAP64 - Success
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/data/erlcass/_build/deps/cpp-driver/build
make[1]: Entering directory '/home/ubuntu/data/erlcass/_build/deps/cpp-driver/build'
make[2]: Entering directory '/home/ubuntu/data/erlcass/_build/deps/cpp-driver/build'
make[3]: Entering directory '/home/ubuntu/data/erlcass/_build/deps/cpp-driver/build'
make[3]: Entering directory '/home/ubuntu/data/erlcass/_build/deps/cpp-driver/build'
Scanning dependencies of target cassandra_static
make[3]: Leaving directory '/home/ubuntu/data/erlcass/_build/deps/cpp-driver/build'
Scanning dependencies of target cassandra
make[3]: Leaving directory '/home/ubuntu/data/erlcass/_build/deps/cpp-driver/build'
make[3]: Entering directory '/home/ubuntu/data/erlcass/_build/deps/cpp-driver/build'
make[3]: Entering directory '/home/ubuntu/data/erlcass/_build/deps/cpp-driver/build'
[  0%] Building CXX object CMakeFiles/cassandra_static.dir/src/async.cpp.o
[  0%] Building CXX object CMakeFiles/cassandra_static.dir/src/address.cpp.o

Hello,

Is the problem related to any query ? I never faced this problem and we are using the library in lot of big projects.

Silviu

I compiled it using rebar3 and wanted to run few test cases. So I loaded the code using
/rebar3 shell --apps erlcass

It fails at this point itself with the floating point error.

However I checkout v3.2.6 , compiled using exact same steps and loaded it into shell. It works perfectly well. This is amazon aws t3a.medium instance. 64 bit.

It could be the .so file has some issues? the error is really not descriptive. thus commented here.

It might be a bug into the native driver between last master and 3.2.6 there is a major update into the native driver from datastax.

It's crashing only by starting the app without running any query ?

Silviu

yes. just by compiling and trying to start the app.

./rebar3 compile
./rebar3 shell --apps erlcass

my bad. after specifying a config it works.

 ./rebar3 shell --apps erlcass --config /home/ubuntu/data/erlcass/sys.config

looks like it was dividing contact_points somewhere. and this list by default was empty.

@pankajsoni19 Can you please provide me the config that cause the crash ? I want to fix this to return an error or something instead

Silviu

while i was running the 3.2.6 branch , I didn't specify config, it seemed to load the app. just that it said connection failed. So I switched to 4.0.0 branch and ran the same command, here it crashed with the floating point error. I am guessing the default empty endpoint point list would be an issue. as floating point error means division by 0 [ atleast what google says ]

./rebar3 shell --apps erlcass

So I guessed maybe the code needs config and can't boot without it. I specified the config later and it started well. BTW I was trying to connect with scyllaDB rather than cassandra. You should mention that your driver works for it too.

Ok Thanks I will look when I have some time in starting the app without any config

This seems fixed in master