Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Core dumped" in 'async' mode #93

Open
mrayva opened this issue Apr 24, 2018 · 5 comments
Open

"Core dumped" in 'async' mode #93

mrayva opened this issue Apr 24, 2018 · 5 comments

Comments

@mrayva
Copy link

mrayva commented Apr 24, 2018

For every example query, compiled into c++ ( options -F -O3 -F -COMPILE-WITH-STATIC )

"terminate called after throwing an instance of 'std::system_error'
what(): Unknown error -1
Aborted (core dumped)"

@losmi83
Copy link
Contributor

losmi83 commented Apr 24, 2018

Please clarify: 1) which DBT release (linux, macos, win) is used; 2) which commands are used to generate code and compile.

@mrayva
Copy link
Author

mrayva commented Apr 24, 2018

Ubuntu 16.04 SCALA VERSION 2.10.7 SBT VERSION 1.1.1 gcc 5.4.0 20160609

[info] Running ddbt.Compiler -l cpp -o bin/rs_example1.hpp -c bin/rs_example1.exe -x -xd bin -F -O3 -F -COMPILE-WITH-STATIC /usr/local/opt/dbtoaster/examples/queries/simple/rs_example1.sql

@losmi83
Copy link
Contributor

losmi83 commented Apr 24, 2018

Ok, so you're using the master branch of the backend. I assume you also set up the connection with the DBToaster frontend.

I cannot reproduce this problem on my machine (macOS); most likely the DBToaster runtime library (ddbtoaster/srccpp/lib/libdbtoaster.a) on your machine is compiled with a different version of gcc. Try running "make -C ddbtoaster/srccpp/lib clean; make -C ddbtoaster/srccpp/lib".

Also, DBToaster generates trigger functions (e.g., in bin/rs_example1.hpp). You can link that code with your application if preferred, no need to use the provided runtime library.

@mrayva
Copy link
Author

mrayva commented Apr 26, 2018

This is more or less how I build it under Ubuntu (a complete version attached)

curl -L https://dbtoaster.github.io/dist/dbtoaster_linux_3387.tgz | tar xvz &&
git clone https://github.com/dbtoaster/dbtoaster-a5.git &&
git clone https://github.com/dbtoaster/dbtoaster-backend.git

cd /usr/local/opt/dbtoaster-a5/ && make -B && cd ..
sed 's|/path/to/frontend/dbtoaster-a5|'"$PWD"'/dbtoaster-a5|' < dbtoaster-backend/ddbtoaster/conf/ddbt.properties.example > dbtoaster-backend/ddbtoaster/conf/ddbt.properties

shopt -s globstar && sed -i "s|'examples/|'$(pwd)/dbtoaster/examples/|" dbtoaster/examples/queries/**/*.sql

shopt -s globstar && sed -i -r "s|'./(.).dat|'$(pwd)/dbtoaster/examples/data/simple/\1.dat|" dbtoaster/examples/queries/**/.sql

shopt -s globstar && ls -R1 $PWD/dbtoaster/examples/**/.sql | sed -r "s|((./)(.+)(.sql)$)|sbt 'toast -l cpp -o bin/\3.hpp -c bin/\3.exe -x -xd bin -F -O3 -F -COMPILE-WITH-STATIC \1'|" > dbtoaster-backend/buildall.sh

cd dbtoaster-backend && mkdir -p bin && chmod +x buildall.sh && ./buildall.sh

find bin -maxdepth 1 -perm -111 -type f | sed -e 's/$/ -a/' > run.sh && chmod +x run.sh

./run.sh

dbtoaster-build.sh.gz

@losmi83
Copy link
Contributor

losmi83 commented Apr 26, 2018

The provided script (with some minor syntax modifications) generates and runs C++ programs without any problems in a similar Linux environment. The only difference is the version of g++ -- try upgrading to 6.x or 7.x. The generated C++ code uses inlining directives, which I remember were buggy in 5.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants