freebsd-nq/contrib
Dimitry Andric 1e991466c3 Merge commit 1ce07cd614be from llvm git (by me):
Instantiate Error in Target::GetEntryPointAddress() only when
  necessary

  When Target::GetEntryPointAddress() calls
  exe_module->GetObjectFile()->GetEntryPointAddress(), and the returned
  entry_addr is valid, it can immediately be returned.

  However, just before that, an llvm::Error value has been setup, but
  in this case it is not consumed before returning, like is done
  further below in the function.

  In https://bugs.freebsd.org/248745 we got a bug report for this,
  where a very simple test case aborts and dumps core:

  * thread #1, name = 'testcase', stop reason = breakpoint 1.1
      frame #0: 0x00000000002018d4 testcase`main(argc=1, argv=0x00007fffffffea18) at testcase.c:3:5
     1    int main(int argc, char *argv[])
     2    {
  -> 3        return 0;
     4    }
  (lldb) p argc
  Program aborted due to an unhandled Error:
  Error value was Success. (Note: Success values must still be checked prior to being destroyed).

  Thread 1 received signal SIGABRT, Aborted.
  thr_kill () at thr_kill.S:3
  3       thr_kill.S: No such file or directory.
  (gdb) bt
  #0  thr_kill () at thr_kill.S:3
  #1  0x00000008049a0004 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:52
  #2  0x0000000804916229 in abort () at /usr/src/lib/libc/stdlib/abort.c:67
  #3  0x000000000451b5f5 in fatalUncheckedError () at /usr/src/contrib/llvm-project/llvm/lib/Support/Error.cpp:112
  #4  0x00000000019cf008 in GetEntryPointAddress () at /usr/src/contrib/llvm-project/llvm/include/llvm/Support/Error.h:267
  #5  0x0000000001bccbd8 in ConstructorSetup () at /usr/src/contrib/llvm-project/lldb/source/Target/ThreadPlanCallFunction.cpp:67
  #6  0x0000000001bcd2c0 in ThreadPlanCallFunction () at /usr/src/contrib/llvm-project/lldb/source/Target/ThreadPlanCallFunction.cpp:114
  #7  0x00000000020076d4 in InferiorCallMmap () at /usr/src/contrib/llvm-project/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp:97
  #8  0x0000000001f4be33 in DoAllocateMemory () at /usr/src/contrib/llvm-project/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp:604
  #9  0x0000000001fe51b9 in AllocatePage () at /usr/src/contrib/llvm-project/lldb/source/Target/Memory.cpp:347
  #10 0x0000000001fe5385 in AllocateMemory () at /usr/src/contrib/llvm-project/lldb/source/Target/Memory.cpp:383
  #11 0x0000000001974da2 in AllocateMemory () at /usr/src/contrib/llvm-project/lldb/source/Target/Process.cpp:2301
  #12 CanJIT () at /usr/src/contrib/llvm-project/lldb/source/Target/Process.cpp:2331
  #13 0x0000000001a1bf3d in Evaluate () at /usr/src/contrib/llvm-project/lldb/source/Expression/UserExpression.cpp:190
  #14 0x00000000019ce7a2 in EvaluateExpression () at /usr/src/contrib/llvm-project/lldb/source/Target/Target.cpp:2372
  #15 0x0000000001ad784c in EvaluateExpression () at /usr/src/contrib/llvm-project/lldb/source/Commands/CommandObjectExpression.cpp:414
  #16 0x0000000001ad86ae in DoExecute () at /usr/src/contrib/llvm-project/lldb/source/Commands/CommandObjectExpression.cpp:646
  #17 0x0000000001a5e3ed in Execute () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandObject.cpp:1003
  #18 0x0000000001a6c4a3 in HandleCommand () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:1762
  #19 0x0000000001a6f98c in IOHandlerInputComplete () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2760
  #20 0x0000000001a90b08 in Run () at /usr/src/contrib/llvm-project/lldb/source/Core/IOHandler.cpp:548
  #21 0x00000000019a6c6a in ExecuteIOHandlers () at /usr/src/contrib/llvm-project/lldb/source/Core/Debugger.cpp:903
  #22 0x0000000001a70337 in RunCommandInterpreter () at /usr/src/contrib/llvm-project/lldb/source/Interpreter/CommandInterpreter.cpp:2946
  #23 0x0000000001d9d812 in RunCommandInterpreter () at /usr/src/contrib/llvm-project/lldb/source/API/SBDebugger.cpp:1169
  #24 0x0000000001918be8 in MainLoop () at /usr/src/contrib/llvm-project/lldb/tools/driver/Driver.cpp:675
  #25 0x000000000191a114 in main () at /usr/src/contrib/llvm-project/lldb/tools/driver/Driver.cpp:890

  Fix the incorrect error catch by only instantiating an Error object
  if it is necessary.

  Reviewed By: JDevlieghere

  Differential Revision: https://reviews.llvm.org/D86355

This should fix lldb aborting as described in the scenario above.

Reported by:	dmgk
PR:		248745
2020-08-22 10:55:55 +00:00
..
apr Update apr to 1.7.0. See contrib/apr/CHANGES for a summary of changes. 2020-05-31 22:12:56 +00:00
apr-util Update apr-util to 1.6.1. See contrib/apr-util/CHANGES for a summary of 2020-06-01 10:14:45 +00:00
atf
bc Upgrade to version 3.1.5 2020-08-05 15:20:07 +00:00
bearssl
binutils GNU as: move deprecation message after option parsing 2020-05-18 16:07:14 +00:00
blacklist blacklistd.conf.5: typo/grammar fixes 2020-05-19 00:15:19 +00:00
bmake Update to bmake-20200710 2020-07-12 01:11:48 +00:00
bsnmp Fix immediate crash when snmpd is bound to a specific IP address. 2020-04-20 23:32:49 +00:00
byacc Remove a redundant file from test directory to unbreak yacc regression test. 2020-07-14 23:59:00 +00:00
bzip2 Upgrade to Bzip2 version 1.0.8. 2019-08-11 06:26:03 +00:00
capsicum-test Really skip the tests in capsicum tests 2020-02-17 20:25:33 +00:00
com_err
cortex-strings
dialog
diff
dma
ee
elftoolchain libdwarf: Hide SHT_NOBITS sections. 2020-07-20 18:22:38 +00:00
expat MFV r355071: libbsdxml (expat) 2.2.9. 2019-11-25 07:48:16 +00:00
file Revert r362261, "Re-apply r333944 to unbreak ports" 2020-06-29 13:30:48 +00:00
flex [flex] Fix compilation issue under mips-gcc-6.4 2020-07-14 05:00:08 +00:00
gdb [PPC64] Fix GDB sigtramp detection 2019-11-01 11:28:43 +00:00
gdtoa
googletest Re-enable disabled googletest-port-test tests after r363820 2020-08-04 02:20:15 +00:00
hyperv/tools
ipfilter Continued ipfilter #ifdef cleanup. The r343701 log entry contains a 2020-08-05 15:33:32 +00:00
jemalloc Set LG_VADDR to 48 on RISC-V. 2020-05-04 17:16:30 +00:00
kyua Revert r359385-r359387 2020-03-29 02:40:03 +00:00
ldns Fix crash in drill(1) when IP has two subsequent dots 2020-06-22 23:13:14 +00:00
ldns-host
less MFV r349535: less v551. 2019-06-29 18:41:40 +00:00
lib9p Import lib9p 7ddb1164407da19b9b1afb83df83ae65a71a9a66. 2020-05-14 19:57:52 +00:00
libarchive MFV r361280: 2020-05-20 20:58:48 +00:00
libbegemot
libc-pwcache pwcache.3: Explicitly document OOM condition 2020-05-05 17:55:45 +00:00
libc-vis
libcxxrt Include <stdint.h> in unwind-arm.h, since it uses uint32_t and uint64_t 2019-09-13 21:00:19 +00:00
libdivsufsort
libedit Fix arm and aarch64 builds of libedit after r352275 2019-09-14 21:49:42 +00:00
libevent
libexecinfo Sync up with NetBSD libexecinfo changes 2014-2019 2019-10-26 06:59:59 +00:00
libgnuregex
libpcap MFV r355890: 2019-12-21 21:05:53 +00:00
libucl
libxo Import libxo-1.4.0: 2020-01-25 21:16:45 +00:00
llvm-project Merge commit 1ce07cd614be from llvm git (by me): 2020-08-22 10:55:55 +00:00
lua
lutok Add liblutok a lightweight C++ API for lua. 2020-03-23 18:26:23 +00:00
mandoc Revert r362809: Mention FreeBSD in the HISTORY sections of apropos(1) and makewhatis(8). 2020-07-14 12:02:30 +00:00
mknod
mtree mtree -O: Fix not descending on hash collisions 2019-09-12 20:46:46 +00:00
ncurses Update to 6.2-20200215 2020-02-19 17:09:08 +00:00
netbsd-tests regex(3): Interpret many escaped ordinary characters as EESCAPE 2020-07-29 23:21:56 +00:00
netcat Adjust .Dd, missed in r363084. 2020-07-10 19:58:07 +00:00
ngatm
ntp MFV r362565: 2020-06-24 01:51:05 +00:00
nvi Revert r362148. 2020-06-22 22:59:03 +00:00
ofed Fix style in r363220 2020-07-15 13:26:15 +00:00
one-true-awk
openbsm Fixup some incorrect information and some comments. These changes 2020-07-28 20:06:16 +00:00
opencsd/decoder Update opencsd to 0.14.2 2020-06-17 10:42:20 +00:00
openpam
openresolv MFV 354917, 354918, 354919 2019-11-20 23:56:20 +00:00
opie
pam_modules/pam_passwdqc
pf
pjdfstest
pnpinfo
processor-trace Update Intel Processor Trace decoder library. 2019-10-10 12:46:34 +00:00
sendmail Merge sendmail 8.16.1 to HEAD: See contrib/sendmail/RELEASE_NOTES for details 2020-07-15 18:28:54 +00:00
serf
smbfs mount_smbfs: Issue a warning when .nsmbrc section name contains lowercase characters. 2020-01-03 12:54:14 +00:00
sqlite3 MFV r362990: 2020-07-07 19:09:38 +00:00
subversion Update Subversion to 1.14.0 LTS. See contrib/subversion/CHANGES for a 2020-06-01 10:27:05 +00:00
tcp_wrappers Remove a duplicate global (rfc931_timeout). 2019-07-17 23:43:14 +00:00
tcpdump Revert r362466 2020-06-22 07:46:24 +00:00
tcsh MFV r359393: tcsh: import 6974bc35a5cd 2020-03-28 15:00:55 +00:00
telnet telnet(1): Document -P option 2020-08-07 08:41:14 +00:00
tnftp Fix poor performance of ftp(1) due to small SO_SNDBUF and SO_RCVBUF. 2020-02-27 19:49:59 +00:00
traceroute
tzcode ctime(3): Bump .Dd after r362165 2020-06-17 11:57:48 +00:00
tzdata Import tzdata 2020a 2020-04-24 05:05:58 +00:00
unbound MFV r361322: 2020-05-21 21:00:46 +00:00
unvis
vis
wpa Post CVE-2020-12695 cleanup patch: 2020-06-09 05:43:51 +00:00
xz liblzma: Make liblzma use libmd implementation of SHA256. 2020-06-20 21:32:07 +00:00