bind9/lib/isc
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
..
include Fix the data race when read-writing sock->active by using cmpxchg 2020-10-22 15:00:07 -07:00
netmgr Properly handle outer TCP connection closed in TCPDNS. 2020-10-29 13:21:55 +01:00
pthreads update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
tests Add the ability to print out the list of test names (-l) 2020-10-01 22:57:46 +10:00
unix Clean the last remnant of ISC_PLATFORM_HAVEIPV6 macro 2020-10-08 09:03:08 +02:00
win32 Add helper function to enable DF (don't fragment) flag on UDP sockets 2020-10-05 16:19:23 +02:00
.gitignore [master] update gitignore files; use rev-parse to get srcid 2014-06-17 13:49:30 -07:00
aes.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
api prep 9.16.8 2020-10-22 09:09:07 +02:00
app.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
assertions.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
astack.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
backtrace-emptytbl.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
backtrace.c Fix getrbp() 2020-10-30 09:12:50 +01:00
base32.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
base64.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
bind9.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
buffer.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
bufferlist.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
commandline.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
counter.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
crc64.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
entropy.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
entropy_private.h update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
error.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
event.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
fsaccess.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
hash.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
heap.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
hex.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
hmac.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
hp.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
ht.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
httpd.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
iterated_hash.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
Kyuafile regen master 2017-12-29 01:44:18 +00:00
lex.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
lfsr.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
lib.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
log.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
Makefile.in Report Extended DNS Error codes 2020-05-13 10:26:39 +10:00
md.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
mem.c Exclude isc_mem_isovermem from ThreadSanitizer 2020-09-17 17:35:58 +02:00
mem_p.h update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
mutexblock.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
netaddr.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
netscope.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
nonce.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
openssl_shim.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
openssl_shim.h update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
parseint.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
pk11.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
pk11_result.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
pool.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
portset.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
queue.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
quota.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
radix.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
random.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
ratelimiter.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
regex.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
region.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
result.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
rwlock.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
safe.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
serial.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
siphash.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
sockaddr.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
stats.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
string.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
symtab.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
task.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
task_p.h update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
taskpool.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
timer.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
timer_p.h update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
tm.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
utf8.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
version.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00
xoshiro128starstar.c update all copyright headers to eliminate the typo 2020-09-14 16:50:58 -07:00