[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] [PATCH 16/17] ptrace: check for NULL arg.
From: |
Cody P Schafer |
Subject: |
[Libunwind-devel] [PATCH 16/17] ptrace: check for NULL arg. |
Date: |
Fri, 14 Sep 2012 17:12:01 -0700 |
tdep_get_func_addr in ppc64 passes NULL for the last argument of
as->access_mem. tdep_get_func_addr is called by elf_w(lookup_symbol),
which in turn is called by elf_w(get_proc_name_in_image).
elf_w(get_proc_name_in_image) is part of the API, and is only passed an
unw_addr_space_t, not a unw_cursor_t, meaning that we cannot recover the
UPT_info on the PPC64 platform.
This could be fixed by giving libunwind the knowledge to perform
relocations itself, thus not needing to look at the running image to
determine function addresses.
---
src/ptrace/_UPT_access_mem.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/ptrace/_UPT_access_mem.c b/src/ptrace/_UPT_access_mem.c
index b0c2ef0..918a8f9 100644
--- a/src/ptrace/_UPT_access_mem.c
+++ b/src/ptrace/_UPT_access_mem.c
@@ -32,6 +32,9 @@ _UPT_access_mem (unw_addr_space_t as, unw_word_t addr,
unw_word_t *val,
int write, void *arg)
{
struct UPT_info *ui = arg;
+ if (!ui)
+ return -UNW_EINVAL;
+
pid_t pid = ui->pid;
errno = 0;
@@ -65,6 +68,8 @@ _UPT_access_mem (unw_addr_space_t as, unw_word_t addr,
unw_word_t *val,
int write, void *arg)
{
struct UPT_info *ui = arg;
+ if (!ui)
+ return -UNW_EINVAL;
pid_t pid = ui->pid;
struct ptrace_io_desc iod;
--
1.7.11.3
- [Libunwind-devel] [PATCH v3 00/17] Fixup the PowerPC (64 & 32 bit) builds & clean up configure, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 01/17] ppc32: ppc64: use AC_COMPILE_IFELSE to test __powerpc64__ macro for ppc64, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 02/17] ppc32: remove unused dmy_vrregset, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 05/17] build: make libunwind-coredump build optional, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 04/17] ppc32: ppc64: test altivec support by running the compiler., Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 06/17] configure: use AS_HELP_STRING for configure args instead of manual formating, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 07/17] ppc64: remove tests/ppc64-test-wchar, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 08/17] configure: avoid using a shell function in autoconf, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 16/17] ptrace: check for NULL arg.,
Cody P Schafer <=
- [Libunwind-devel] [PATCH 14/17] configure: rename configure.in to configure.ac, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 11/17] UPT: Add reg offsets for ppc32/64, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 12/17] ppc64: be explicit in access_reg range check, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 17/17] ptrace: add more Debug to access_reg, Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 13/17] ppc64: add FRAME_POINTER & NIP to regname., Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 15/17] ptrace/access_reg: print out register name on "bad register", Cody P Schafer, 2012/09/14
- [Libunwind-devel] [PATCH 10/17] configure: use AC_ARG_ENABLE(arg, text, , custom-act), Cody P Schafer, 2012/09/14