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

Retrieve filename of shared libs, use in stacktraces #11408

Merged

Conversation

rdp
Copy link
Contributor

@rdp rdp commented Nov 7, 2021

Before:

Unhandled exception: hello (Exception)
  from src/crystal/system/unix/socket.cr:215:5 in 'unbuffered_write'
  from src/io/buffered.cr:136:14 in 'write'
  from src/openssl/bio.cr:31:7 in '->'
  from ???
  from BIO_write
  from ???
  from BIO_ctrl
  from ???
  from ???
  from ???
  from SSL_do_handshake
  from src/openssl/ssl/socket.cr:32:15 in 'initialize'
  from src/openssl/ssl/socket.cr:3:5 in 'new:context:sync_close:hostname'
  from src/http/client.cr:794:5 in 'io'
  from src/http/client.cr:671:5 in 'send_request'
  from src/http/client.cr:603:5 in 'exec_internal_single'
  from src/http/client.cr:587:18 in 'exec_internal'
  from src/http/client.cr:581:7 in 'exec'
  from src/http/client.cr:713:5 in 'exec'
  from src/http/client.cr:745:7 in 'exec'
  from src/http/client.cr:406:3 in 'get'
  from ssl.cr:2:1 in '__crystal_main'
  from src/crystal/main.cr:110:5 in 'main_user_code'
  from src/crystal/main.cr:96:7 in 'main'
  from src/crystal/main.cr:119:3 in 'main'
  from __libc_start_main
  from _start
  from ???

After:

Unhandled exception: hello (Exception)
  from src/crystal/system/unix/socket.cr:215:5 in 'unbuffered_write'
  from src/io/buffered.cr:136:14 in 'write'
  from src/openssl/bio.cr:31:7 in '->'
  from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 in '??'
  from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 in 'BIO_write'
  from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 in '??'
  from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 in 'BIO_ctrl'
  from /usr/lib/x86_64-linux-gnu/libssl.so.1.1 in '??'
  from /usr/lib/x86_64-linux-gnu/libssl.so.1.1 in '??'
  from /usr/lib/x86_64-linux-gnu/libssl.so.1.1 in '??'
  from /usr/lib/x86_64-linux-gnu/libssl.so.1.1 in 'SSL_do_handshake'
  from src/openssl/ssl/socket.cr:32:15 in 'initialize'
  from src/openssl/ssl/socket.cr:3:5 in 'new:context:sync_close:hostname'
  from src/http/client.cr:794:5 in 'io'
  from src/http/client.cr:671:5 in 'send_request'
  from src/http/client.cr:603:5 in 'exec_internal_single'
  from src/http/client.cr:587:18 in 'exec_internal'
  from src/http/client.cr:581:7 in 'exec'
  from src/http/client.cr:713:5 in 'exec'
  from src/http/client.cr:745:7 in 'exec'
  from src/http/client.cr:406:3 in 'get'
  from ssl.cr:2:1 in '__crystal_main'
  from src/crystal/main.cr:110:5 in 'main_user_code'
  from src/crystal/main.cr:96:7 in 'main'
  from src/crystal/main.cr:119:3 in 'main'
  from /lib/x86_64-linux-gnu/libc.so.6 in '__libc_start_main'
  from ./ssl in '_start'
  from ???

Resolves #8534

@oprypin oprypin changed the title retrieve frame filename, use in stacktraces #8534 Retrieve filename of shared libs, use in stacktraces Nov 7, 2021
Copy link
Member

@beta-ziliani beta-ziliani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@straight-shoota straight-shoota merged commit c2429e2 into crystal-lang:master Nov 9, 2021
@rdp
Copy link
Contributor Author

rdp commented Nov 11, 2021

This doesn't include looking up line numbers within shared libs, but that can be done later if there's demand...or in gdb at present...

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

Successfully merging this pull request may close these issues.

Show shared library paths for symbols without debug info
3 participants