Skip to content

Instantly share code, notes, and snippets.

@lribeiro
Created September 13, 2016 10:23
Show Gist options
  • Save lribeiro/d0d866fa9ce2abe326fb598b6a844bc7 to your computer and use it in GitHub Desktop.
Save lribeiro/d0d866fa9ce2abe326fb598b6a844bc7 to your computer and use it in GitHub Desktop.
root@fd3f38b13502:/home/chimera# cat a.cr
require "openssl/cipher"
puts 1
root@fd3f38b13502:/home/chimera# crystal build --release --link-flags "-L/opt/crystal/embedded/lib" a.cr
root@fd3f38b13502:/home/chimera# ./a
1
root@fd3f38b13502:/home/chimera# crystal build --release --link-flags "-static -L/opt/crystal/embedded/lib" a.cr
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libcrypto.a(fips.o): In function `verify_checksums':
(.text+0x4e6): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/crystal/embedded/lib/libevent.a(evutil.o): In function `test_for_getaddrinfo_hacks':
evutil.c:(.text+0x1488): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/opt/crystal/embedded/lib/libevent.a(evutil.o): In function `evutil_unparse_protoname':
evutil.c:(.text+0xf0d): warning: Using 'getprotobynumber' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
root@fd3f38b13502:/home/chimera# ./a
Segmentation fault (core dumped)
root@fd3f38b13502:/home/chimera# gdb ./a core
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./a...done.
[New LWP 1887]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./a'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00007fc08cd3aa33 in __GI__dl_addr (address=address@entry=0x7fc08cc7cde0 <ptmalloc_init>, info=info@entry=0x7ffd2b6bc060, mapp=mapp@entry=0x7ffd2b6bc058, symbolp=symbolp@entry=0x0) at dl-addr.c:131
#2 0x00007fc08cc7cb96 in ptmalloc_init () at arena.c:397
#3 0x00007fc08cc7cf7d in ptmalloc_init () at malloc.c:2924
#4 malloc_hook_ini (sz=1168, caller=<optimized out>) at hooks.c:31
#5 0x00007fc08d22b078 in CRYPTO_malloc () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#6 0x00007fc08d35c6df in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#7 0x00007fc08d35deb9 in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#8 0x00007fc08d35c5f0 in ?? () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#9 0x00007fc08d2e68f3 in RAND_init_fips () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#10 0x00007fc08d229f7a in OPENSSL_init_library () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#11 0x000000000062f42a in call_init.part ()
#12 0x000000000062f53b in _dl_init ()
#13 0x0000000000609085 in dl_open_worker ()
#14 0x0000000000607194 in _dl_catch_error ()
#15 0x00000000006089e9 in _dl_open ()
#16 0x00000000005b4a07 in dlopen_doit ()
#17 0x0000000000607194 in _dl_catch_error ()
#18 0x00000000005b4e32 in _dlerror_run ()
#19 0x00000000005b4a5e in __dlopen ()
#20 0x00000000004c160a in verify_checksums ()
#21 0x00000000004c19ff in FIPS_module_mode_set ()
#22 0x000000000044efbb in FIPS_mode_set ()
#23 0x00000000004007e8 in OPENSSL_init_library ()
#24 0x000000000058f3c7 in __libc_csu_init ()
#25 0x000000000058e9ce in generic_start_main ()
#26 0x000000000058ec1a in __libc_start_main ()
#27 0x0000000000400b29 in _start ()
(gdb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment