bind9/lib
Michał Kępień 923c443389 Fix getrbp()
The following compiler warning is emitted for the BACKTRACE_X86STACK
part of lib/isc/backtrace.c:

    backtrace.c: In function ‘getrbp’:
    backtrace.c:142:1: warning: no return statement in function returning non-void [-Wreturn-type]

While getrbp() stores the value of the RBP register in the RAX register
and thus does attempt to return a value, this is not enough for an
optimizing compiler to always produce the expected result.  With -O2,
the following machine code may be generated in isc_backtrace_gettrace():

    0x00007ffff7b0ff7a <+10>:	mov    %rbp,%rax
    0x00007ffff7b0ff7d <+13>:	mov    $0x17,%eax
    0x00007ffff7b0ff82 <+18>:	retq

The above is equivalent to:

    sp = (void **)getrbp();
    return (ISC_R_NOTFOUND);

and results in the backtrace never getting printed.

Fix by using an intermediate variable.  With this change in place, the
machine code generated with -O2 becomes something like:

    0x00007ffff7af5638 <+24>:	mov    $0x17,%eax
    0x00007ffff7af563d <+29>:	mov    %rbp,%rdx
    0x00007ffff7af5640 <+32>:	test   %rdx,%rdx
    0x00007ffff7af5643 <+35>:	je     0x7ffff7af56bd <isc_backtrace_gettrace+157>
    ...
    0x00007ffff7af56bd <+157>:	retq

(Note that this method of grabbing a stack trace is finicky anyway
because in order for RBP to be relied upon, -fno-omit-stack-frame must
be present among CFLAGS.)
2020-10-30 09:12:50 +01:00
..
bind9 update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
dns Handle DNS_R_NCACHENXRRSET in fetch_callback_{dnskey,validator}() 2020-10-30 08:21:43 +11:00
irs update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
isc Fix getrbp() 2020-10-30 09:12:50 +01:00
isccc update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
isccfg prep 9.16.7 2020-09-16 22:50:38 +02:00
ns Fix the isc_nm_closedown() to actually close the pending connections 2020-10-22 15:00:00 -07:00
samples The dns_message_create() cannot fail, change the return to void 2020-09-30 14:26:26 +02:00
win32/bindevt update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
.gitignore added gitignore, removed cvsignore 2012-03-03 23:10:05 -08:00
Kyuafile link in lib/isccc/tests/Kyuafile 2018-11-13 07:23:36 +11:00
Makefile.in remove lib/tests as nothing uses it anymore 2018-03-09 14:12:50 -08:00