[gnutls-devel] GnuTLS | Unwinding from sha256_block_data_order_avx2 crashes the process, GDB unable to backtrace (#1111)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Mon Nov 2 16:29:55 CET 2020



Tomasz Grabiec created an issue: https://gitlab.com/gnutls/gnutls/-/issues/1111



## Description of problem:

sha256_block_data_order_avx2 doesn't contain .cfi annotations which would provide DWARF debug info needed to backtrace through this function.

This breaks with our watchdog code which calls libgcc's _Unwind_Backtrace() from a timer-triggered signal handler.

Also, GDB is unable to backtrace when breakpoint is located inside the function:

```
#20 <signal handler called>
#21 0x00007f25e879c16f in sha256_block_data_order_avx2 () from /opt/scylladb/libreloc/libgnutls.so.30
Cannot access memory at address 0x382d94f1a063c1cf
```

See the fix for a similar issue in openssl: https://github.com/openssl/openssl/commit/1ef638982757ddc2536a70e6463cf4deca58640f


## Version of gnutls used:

3.6.14

## Distributor of gnutls (e.g., Ubuntu, Fedora, RHEL)


## How reproducible:

Steps to Reproduce:

 * Add a breakpoint in the middle of sha256_block_data_order_avx2
 * Trigger invocation of sha256_block_data_order_avx2, e.g. by opening an ssl connection
 * Invoke the "bt" gdb command

## Actual results:

GDB is unable to backtrace to earlier frames.

## Expected results:

GDB is able to backtrace to earlier frames.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/issues/1111
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20201102/bcfaf9e7/attachment.html>


More information about the Gnutls-devel mailing list