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

Ubuntu K crashed with exit code 132.. Respawning #875

Closed
b-seite opened this issue Feb 6, 2019 · 15 comments
Closed

Ubuntu K crashed with exit code 132.. Respawning #875

b-seite opened this issue Feb 6, 2019 · 15 comments

Comments

@b-seite
Copy link
Contributor

b-seite commented Feb 6, 2019

Hey Carles,

since half a year of not using the bot i tried my luck. I updated to the latest commit but when i start K i get this message.
It don't matter if i start my real instance or a test instance.
Is that a ubuntu thing? or am i too stupid?

Thanks for any Help
B-seite

`K-trading-bot linux-x86_64 2019-02-06 04:10:39.
v0.4.12+16 (0day).
02/06 11:04:59.601900 CF Outbound IP address is 2003:d6:d3cd:300:216:cbff:feab:8beb.
02/06 11:04:59.602645 GW NULL handshake:

  • autoBot: no
  • symbols: BTC_USD
  • minTick: 0.01000000
  • minSize: 0.01000000
  • makeFee: 0.00000000
  • takeFee: 0.00000000.
    02/06 11:04:59.603273 DB loaded OK from /var/lib/K/db/K-trading-bot.NULL.BTC.USD.db.
    02/06 11:04:59.604345 DB Warrrrning: using default values for Quoting Parameters.
    02/06 11:04:59.604802 DB Warrrrning: consider to warm up some EWMA Values.
    02/06 11:04:59.606275 UI Warrrrning: Connected web clients will enjoy unsecure SSL encryption..
    (because the private key is visible in the source!). See --help argument to setup your own SSL.
    02/06 11:04:59.607025 UI ready at https://2003:d6:d3cd:300:216:cbff:feab:8beb:3000.
    Illegal instruction (core dumped)
    K crashed with exit code 132.. Respawning.`
@ctubio
Copy link
Owner

ctubio commented Feb 6, 2019

morning B-seite''''
yours is another issue, not related to the problem of old glibc of ubuntu (because the crash is at the very begin and says "wrong GLIBC version" clearly

im not sure what this error may be, but if you paste your config file (without api keys or sensitive data!) or if you run the bot with uncommented gdb --args (as seen at the bottom of the config file), then you can type run and bt once gdb starts to get a nice backtrace; another option is uncomenting valgrind also at the bottom of the config file and just run it to get a backtrace without type nothing

hope this helps to bdebug it :( i didnt experiencied a crash after loading the UI, that is when the bot attempts to connect the websockets

🐨 note that your handshake says NULL, so no gateway really

🐨 are you sure you wanna run the NULL gateway? if so let me debug it cos i didnt use it since long time ago and may be broken :S

@flfsbr
Copy link

flfsbr commented Feb 7, 2019

K-trading-bot linux-x86_64 2019-02-06 20:58:34.
v0.4.12+18 (0day).
02/07 13:31:06.817188 CF Outbound IP address is 35.198.191.146.
02/07 13:31:06.909891 GW HITBTC allows client IP.
02/07 13:31:06.910276 GW HITBTC handshake:

  • gateway: https://api.hitbtc.com/api/2
  • gateway: wss://api.hitbtc.com/api/2/ws
  • autoBot: yes
  • symbols: BCHABCUSD
  • minTick: 0.00100000
  • minSize: 0.00010000
  • makeFee: 0.00000000
  • takeFee: 0.00000000.
    02/07 13:31:06.910803 DB loaded OK from :memory:.
    02/07 13:31:06.911255 DB loaded OK from /var/lib/K/db/K-trading-bot.HITBTC.BCHABC.USD.db.
    02/07 13:31:06.918755 DB Warrrrning: using default values for Quoting Parameters.
    02/07 13:31:06.919319 DB Warrrrning: consider to warm up some EWMA Values.
    02/07 13:31:06.919927 SH Errrror: Unable to set "hotkey" handler because display is a nullptr.
    02/07 13:31:06.920016 GW HITBTC Attempting to cancel all open orders, please wait..
    02/07 13:31:07.007966 GW HITBTC cancel all open orders OK.
    K exit code 1.
    K crashed with exit code 1.. Respawning..

@ctubio
Copy link
Owner

ctubio commented Feb 7, 2019

ookei i was able to reproduce it now, lemme commit a fix :(

@ctubio ctubio closed this as completed in 213ab66 Feb 7, 2019
@b-seite
Copy link
Contributor Author

b-seite commented Feb 7, 2019

Hey Carles,
i have no luck with valgrind or gdb. both of them say gdb: --args specified but no program specified and valgrind: no program specified if i uncomment them.
The Problem occurs with the unmodified K.sh.dist and all other instances i have

@ctubio
Copy link
Owner

ctubio commented Feb 7, 2019

so your issue is not related to the hotkey bug of yesterday's night, lets open it again then

@ctubio ctubio reopened this Feb 7, 2019
@ctubio
Copy link
Owner

ctubio commented Feb 7, 2019

you need to use these commands with the executable file, not with the sh file, for example:
gdb --args K.sh will fail, but the following will work:

until `#valgrind` gdb --args $K_BINARY_FILE          \
    --title      ${0##*/}                               \
    --port       $UI_OPENPORT                           \
    --user       $UI_USERNAME                           \
    --pass       $UI_PASSWORD                           \
    --exchange   $API_EXCHANGE                          \
    --currency   $API_CURRENCY                          \
    --apikey     $API_KEY                               \
    --secret     $API_SECRET                            \
    --passphrase $API_PASSPHRASE                        \
    --username   $API_USERNAME                          \
                 $OPTIONAL_ARGUMENTS "$@"           ;   #
  do                                                # K #

i hope we can see then where your bot crashes :S

@ctubio
Copy link
Owner

ctubio commented Feb 7, 2019

also can you share what is the version of your linux distro? (maybe helps :S)

@b-seite
Copy link
Contributor Author

b-seite commented Feb 7, 2019

Hey Carles,

here comes something hopefully helpful from gdb

New Thread 0x7ffff7222700 (LWP 25428)]

Thread 2 "K-trading-bot" received signal SIGILL, Illegal instruction.
[Wechseln zu Thread 0x7ffff7222700 (LWP 25428)]
0x0000555555781236 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<₿::GwExchangeData::askForSyncData(unsigned int const&)::{lambda()#1}> >, std::vector<₿::mOrder, std::allocator<std::vector> > >::_Async_state_impl(std::tuple<₿::GwExchangeData::askForSyncData(unsigned int const&)::{lambda()#1}>&&)::{lambda()#1}> > >::_M_run() ()
(gdb) bt
#0  0x0000555555781236 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<₿::GwExchangeData::askForSyncData(unsigned int const&)::{lambda()#1}> >, std::vector<₿::mOrder, std::allocator<std::vector> > >::_Async_state_impl(std::tuple<₿::GwExchangeData::askForSyncData(unsigned int const&)::{lambda()#1}>&&)::{lambda()#1}> > >::_M_run() ()
#1  0x0000555555b3901f in execute_native_thread_routine ()
#2  0x00007ffff761b6db in start_thread (arg=0x7ffff7222700) at pthread_create.c:463
#3  0x00007ffff734488f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

i also tried valgrind but when i am using it the bot runs without crashing... strange behaviour

uname -a says this: Linux Server 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

@ctubio
Copy link
Owner

ctubio commented Feb 8, 2019

Hello b-seite''''
is long time since askForSyncData and sync_orders are not modified (and sync_orders is just return {}; on hitbtc) but seems that is the function that is crashing in your logs

sync_orders is the first external function called from the lib at build-*/local/lib/K-*.a

soo or you are using an old lib instead of the latest or otherwise the latest is not compatible with ubuntu bionic

i will try to reproduce the issue with a ubuntu bionic (that i think that is what you have), but will need some days :S

if you dont disagree i will try with http://releases.ubuntu.com/18.04/ubuntu-18.04.1.0-live-server-amd64.iso

(:koala: if you dont wanna wait try Debian Buster'¡)

@ctubio ctubio changed the title K crashed with exit code 132.. Respawning Ubuntu K crashed with exit code 132.. Respawning Feb 8, 2019
@flfsbr
Copy link

flfsbr commented Feb 8, 2019

v0.4.12+19 Is working again. Thanks.

@b-seite
Copy link
Contributor Author

b-seite commented Feb 22, 2019

Hey Carles, any news here?

i recognised that i also can not compile K. is that a different problem os does it correspond? here is the output:
`Building hello-world..
make src KSRC=hello-world
make[1]: Entering directory '/home/boris/K'
Building hello-world src x86_64-linux-gnu..
x86_64-linux-gnu-g++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

sed: no input files
Makefile:113: recipe for target 'src' failed
make[1]: [src] Error 123 (ignored)
make Linux CHOST=x86_64-linux-gnu
make[2]: Entering directory '/home/boris/K'
make[3]: Entering directory '/home/boris/K'
x86_64-linux-gnu-g++ -DNDEBUG -o build-linux-x86_64/local/bin/K-hello-world
-DHAVE_STD_UNIQUE_PTR -DUWS_THREADSAFE
-static-libstdc++ -static-libgcc -rdynamic
src/bin/hello-world/hello-world.cxx -std=c++17 -O3 -pthread -DK_0_GIT='"635e8e03f1df9bcbad4ffe55a158903a109ada20"' -DK_STAMP='"2019-02-22 15:04:33"' -DK_0_DAY='"v0.4.12+30"' -DK_BUILD='"linux-x86_64"' -DK_SOURCE='"K-hello-world"' -Ibuild-linux-x86_64/local/include -I/home/boris/K/src/lib build-linux-x86_64/local/include/uWS/*.cpp build-linux-x86_64/local/lib/K-linux-x86_64.a build-linux-x86_64/local/lib/libsqlite3.a build-linux-x86_64/local/lib/libncurses.a build-linux-x86_64/local/lib/libquickfix.a build-linux-x86_64/local/lib/libz.a build-linux-x86_64/local/lib/libcurl.a build-linux-x86_64/local/lib/libssl.a build-linux-x86_64/local/lib/libcrypto.a build-linux-x86_64/local/lib/libcares.a -ldl
x86_64-linux-gnu-g++: error: build-linux-x86_64/local/lib/K-linux-x86_64.a: No such file or directory
Makefile:130: recipe for target 'Linux' failed
make[3]: *** [Linux] Error 1
make[3]: Leaving directory '/home/boris/K'
Makefile:128: recipe for target 'Linux' failed
make[2]: *** [Linux] Error 2
make[2]: Leaving directory '/home/boris/K'
Makefile:113: recipe for target 'src' failed
make[1]: *** [src] Error 2
make[1]: Leaving directory '/home/boris/K'
Makefile:92: recipe for target 'hello-world' failed
make: *** [hello-world] Error 2`

the file K-linux-x86_64.a is at its position so i do not know what the problem is..

@ctubio
Copy link
Owner

ctubio commented Feb 22, 2019

morning b-seite''''
about my ubuntu installation i failed last weekend but ima retry again this one, hope for it on next 48h

about the missing build-linux-x86_64/local/lib/K-linux-x86_64.a i would like to trust you but it also happens to me that i dont belive some error and later turns ofcourse the error to be right; in other words, can you double check that the file /home/boris/K/build-linux-x86_64/local/lib/K-linux-x86_64.a exists with the expected permissions? as a reference, mine (and all should) look like:

ls -la ~/K/build-linux-x86_64/local/lib/K-linux-x86_64.a
-rw-rw-r-- 1 dhc-user dhc-user 1.5M Feb 21 10:45 /home/dhc-user/K/build-linux-x86_64/local/lib/K-linux-x86_64.a

if you believe the error is wrong, i would then remove all and start from scratch :S cos makes no sense overall :S the only possible excuse for g++ to not find it is because g++ runs on a different path than K and for sure you are running make from K folder so i dont undestand :S (your output clearly says /home/boris/K and then relative from it loads build-linux-x86_64/local/lib/K-linux-x86_64.a as expected)

@ctubio
Copy link
Owner

ctubio commented Feb 22, 2019

lemme test ubuntu 18.04 cos your two issues are given at the time of loading the lib :D (so may be related)

ctubio added a commit that referenced this issue Feb 24, 2019
Free Software Free Society

To increase the frequency of commits by ctubio,
you can buy-me-a-drink with a small git-tip at:
  1GitTipB6sY2YSbkH3BJHepUB7Cjymi9R1

To force me to write more source documentation,
you can buy-me-a-drink with a small doc-tip at:
  1KDocsmbhUEh7JgmYjuMH3nDivzSM6dphP

I promise to drink chocolate milk after commit.

To request new features or in case this commit breaks something for you,
please, create a new github issue with all possible information for me,
but never share your API Keys!

Signed-off-by: Carles Tubio <ctubio@users.noreply.github.com>
@ctubio
Copy link
Owner

ctubio commented Feb 24, 2019

🐨 3b5209f only fixes make dist for ZIP installations

(soOn will try make :D)

@ctubio
Copy link
Owner

ctubio commented Feb 24, 2019

soo seems everything is working as expected with http://releases.ubuntu.com/18.04/ubuntu-18.04.1.0-live-server-amd64.iso (make install && make dist && make && ./K.sh)

hope is the same for you now''
many thanks for the report'¡

@ctubio ctubio closed this as completed Feb 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants