ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
<watzon> Quicktype should add support for IDL
<watzon> As an input format
andremedeiros has joined #crystal-lang
DTZUZU has quit [Read error: Connection reset by peer]
DTZUZU has joined #crystal-lang
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
_whitelogger has joined #crystal-lang
ua_ has quit [Ping timeout: 240 seconds]
ua_ has joined #crystal-lang
_ht has joined #crystal-lang
DeBot has quit [Quit: Crystal IRC]
jhass has quit [Quit: Bye]
asterite has quit [Quit: Bye]
straight-shoota has quit [Quit: ZNC 1.8.2 - https://znc.in]
DeBot has joined #crystal-lang
asterite has joined #crystal-lang
straight-shoota has joined #crystal-lang
jhass has joined #crystal-lang
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
yxhuvud has joined #crystal-lang
<FromGitter> <kingsleyh> hi - does anyone know what this error is when I compile my code? Program received and didn't handle signal ILL (4)
<FromGitter> <asterite> Looks similar to a segfault
<FromGitter> <kingsleyh> the binary compile and starts up - and then loads 1 record from the db and then stops with that error
<FromGitter> <kingsleyh> dmesg says: axen-master[49975] trap invalid opcode ip:6f90a3 sp:7f36c06aaae0 error:0 in axen-master[400000+819000]
<FromGitter> <kingsleyh> I ran the same thing on another EC2 instance and it did not have the problem
<FromGitter> <naqvis> sounds like a hidden bug which get triggered under certain conditions. if same executable is working fine on other box, then try to investigate the environment issues like dependent libraries versions or some environment specific settings
<FromGitter> <Daniel-Worrall> and the different dbs
<FromGitter> <kingsleyh> I'll copy the db from the other server and try it to rule that out
<FromGitter> <kingsleyh> I have a core dump file now
<FromGitter> <kingsleyh> how can I inspect it?
<FromGitter> <kingsleyh> I can install gdb - do I just run: gdb core
<FromGitter> <kingsleyh> or is there more to it than that
<FromGitter> <naqvis> is your binary built with debug info?
<FromGitter> <kingsleyh> yeah
<FromGitter> <kingsleyh> ok I created a new m4.large instance on AWS and checked out my code and build the binary
<FromGitter> <kingsleyh> it works with the supplied big db
<FromGitter> <kingsleyh> the same exact situation on the old m4.large does not work and give the illegal exception :(
<FromGitter> <kingsleyh> can I static compile via github actions? or static compile not working yet?
<FromGitter> <Daniel-Worrall> yes, tho I don't have the action file at hand
<FromGitter> <kingsleyh> can I use ubuntu-latest?
<FromGitter> <kingsleyh> or have to use something else?
<FromGitter> <Daniel-Worrall> for static, you'll need alpine
<FromGitter> <kingsleyh> ok does gh actions have one or you have to do something special?
<FromGitter> <Daniel-Worrall> There's an official docker image
<FromGitter> <kingsleyh> ah ok so you build it via docker in gh actions
<FromGitter> <kingsleyh> ok got it
<FromGitter> <kingsleyh> the static binary produced by docker using alpine linux works on the t3 instance on AWS but does not work on the m4.large instance
<FromGitter> <kingsleyh> any ideas about this?
<FromGitter> <naqvis> are you running same OS on both instances? t3 vs m4.large instances varies in hw specs only. So please be more specific on underlying OS, error you are receiving
<FromGitter> <kingsleyh> yeah
<FromGitter> <kingsleyh> works on m5.large
<FromGitter> <kingsleyh> but the static one doesn't work on m4.large
<FromGitter> <kingsleyh> I tried a couple new instances of m4
<FromGitter> <kingsleyh> none of the m4 sizes work with the static
<FromGitter> <kingsleyh> but all the t3 and m5 ones I did do work with the static
<FromGitter> <kingsleyh> very strange
<FromGitter> <kingsleyh> I think it's a some kind of crystal bug tho
<FromGitter> <kingsleyh> as the binary starts up but as soon as it touches the db it core dumps on the m4
<FromGitter> <kingsleyh> if I build it from source on the m4 then it does work on the fresh instance but it doesn't even work from compiled source on the old m4 I have
<FromGitter> <naqvis> strange enough observations and findings
<FromGitter> <naqvis> m4 and m5 only differs on cpu specs
<FromGitter> <naqvis> shouldn't be something that stops code from running
<FromGitter> <naqvis> which db your code is accessing when it crashes on m4?
<FromGitter> <naqvis> using any FFI? or pure crystal code?
<FromGitter> <naqvis> would be better if you can write a simple code to interact with db in question and do some simple query/operations and just try to run that code to see if its really db related integration which is causing the issue, or there is something else
<FromGitter> <kingsleyh> sqlite3
<FromGitter> <kingsleyh> it has a lot of crypto and C stuff
<FromGitter> <kingsleyh> as well
<FromGitter> <kingsleyh> but only seems to have issues with the db
<FromGitter> <naqvis> might be good to just a write a simple script with sqlite3 interaction and run that on m4 (where code is crashing)
<FromGitter> <naqvis> if that simple code crahses as well, then must be something related to sqlite3 libraries (as crystal sqlite3 functionality is wrapper against its c library)
<FromGitter> <naqvis> also would be good to invoke `ldd executable` to ensure there are no runtime dependencies listed on your statically compiled binary
<FromGitter> <naqvis> because passing `--static` doesn't always grantees that generated executable is fully static (below excerpt from crystal wiki) ⏎ ⏎ | When --static is given, linking static libraries is enabled, but it's not exclusive. The produced binary won't be fully static linked if the dynamic version of a library is higher in the compiler's library lookup chain than the static variant (or if the static library is
<FromGitter> ... entirely missing). In order to build a static binary you need to make sure that static versions of the linked libraries are available and the compiler can find them.
<FromGitter> <oprypin:matrix.org> very good advice
<FromGitter> <naqvis> 🌹
<FromGitter> <kingsleyh> I'm sorry I'm an idiot - I've been up since yesterday - and super tired - the static version does work on m4
<FromGitter> <kingsleyh> I was using a static that was built before I upgraded the gtihub action to generate a static on alpine linux
<FromGitter> <kingsleyh> the one I generated on ubuntu-latest - works on all t3 and all m5 - but not on m4
<FromGitter> <kingsleyh> the one generated on alpine linux - runs on all of them
<FromGitter> <kingsleyh> so it was user error on my part
<FromGitter> <kingsleyh> thanks for the help though :)
<FromGitter> <naqvis> take some rest
<FromGitter> <kingsleyh> we listed Axentro blockchain on an exchange on Friday so had a lot of issues come up that had to fix super fast
<FromGitter> <kingsleyh> but now need a rest hahaha
<FromGitter> <naqvis> congratulations, that's definitely a major milestone you have achieved
<FromGitter> <naqvis> 👍
<FromGitter> <kingsleyh> yeah just gotta get the price up now
<FromGitter> <kingsleyh> it's probably going to cost another ton of cash on marketing and market making
<FromGitter> <kingsleyh> and add another huge time drain to my day hhahha
<FromGitter> <jrei:matrix.org> Why using m4?
<FromGitter> <jrei:matrix.org> At work we use the AMD variants for new hosts, t3a and m5a
<FromGitter> <jrei:matrix.org> Good work, indeed. So much work you must have done... 😳
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
<FromGitter> <kingsleyh> just to save cash
<FromGitter> <kingsleyh> I switched to t3 and m5 now
<FromGitter> <jrei:matrix.org> us to yes, the a variants are even cheaper
<FromGitter> <jrei:matrix.org> there are also m6g ARM variants, but you may have tools preventing to use it and Crystal support is "only" Tier 2
avane has quit [Remote host closed the connection]
avane has joined #crystal-lang
sorcus has quit [Quit: WeeChat 3.0]
sorcus has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
_ht has quit [Remote host closed the connection]
ukd1 has joined #crystal-lang
ukd1 has quit [Ping timeout: 256 seconds]
ukd1 has joined #crystal-lang